diff --git a/Neo/neojs/src/domain/SubjectValidator.ts b/Neo/neojs/src/domain/SubjectValidator.ts index 174eb22c..17cd0ab0 100644 --- a/Neo/neojs/src/domain/SubjectValidator.ts +++ b/Neo/neojs/src/domain/SubjectValidator.ts @@ -28,11 +28,17 @@ export class SubjectValidator { return true; // Statements for unknown properties are considered valid } + const property = schema.getPropertyDefinitions().get( statement.propertyName ); + + if ( property.format !== statement.format ) { + return false; // Values in the wrong format are considered invalid + } + const errors = this.getValueFormat( statement ) - .validate( + .validate( // TODO: maybe we need to verify the statement value matches the statement format statement.value, - schema.getPropertyDefinitions().get( statement.propertyName ) + property ); return errors.length === 0;