-
Notifications
You must be signed in to change notification settings - Fork 5
Add custom error messages for uischema validation #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add or modify a test that explicitly checks for the changed error messages?
d8057d9
to
06fb8e9
Compare
06fb8e9
to
d238b17
Compare
Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error messages regarding type seem to be wrong.
src/models/ui-metaschema.ts
Outdated
'scope': 'Control scope should match pattern "^#\\/properties\\/{1}"', | ||
'suggestion': 'Control suggestion should be array', | ||
'options': 'Control options should be object', | ||
'label': 'Control label should be string,boolean or label object' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add whitespace after comma
src/models/ui-metaschema.ts
Outdated
}, | ||
'required': { | ||
'scope': 'Control should have an object property "scope"', | ||
'type': 'Control should have an object property "type"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't type a string -> remove 'object'?
src/models/ui-metaschema.ts
Outdated
'type': 'Control should have an object property "type"' | ||
}, | ||
'additionalProperties': 'Control should not have properties ' + | ||
'other than type,label,scope,options,suggestion and rule' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add whitespace after each comma
src/models/ui-metaschema.ts
Outdated
}, | ||
'required': { | ||
'elements': 'Root should have an array property "elements"', | ||
'type': 'Root should have an object property "type"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be of type string
src/models/ui-metaschema.ts
Outdated
'type': 'Root should have an object property "type"' | ||
}, | ||
'additionalProperties': 'Root should not have properties ' + | ||
'other than type,elements,label and rule' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace after each comma
Added ajv custom error messages