Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Neo/neojs/src/domain/SubjectValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading