-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: there is no check in place for schema validity. #437
Comments
Ive just tried the schema validator here https://github.com/java-json-tools/json-schema-validator and it seems quite capable. There is an online version at http://json-schema-validator.herokuapp.com/ but it assumes a one page schema, so that has minimal use for us. I built a unit test that loads the schema from https://signalk.org/specification/1.0.0/schemas, which then reports detailed issues with a sample json. That could be wrapped into a web validator pinned to signalk versions, so samples can be tested online. Output example:
|
Needs http access to the different versions of the schema (v1.0.0 differs from v1.0.4 ), currently I only see v1.0.0. |
https://ajv.js.org might be a useful tool in validating. |
@rob42, sorry perhaps my post was misleading. There is no problem in getting the existing TV4 validator to validate the schema, it just that such a test hasn't been implemented yet. All other json validation tools are useless to us at present as none support the TV4 'banUnknownProperties' flag which our schemas require in order to work properly (see issue #246). We already have an online validator tool at http://node-master.signalk.org/@signalk/playground/dist/ which uses TV4. The current proposal is to update the existing schema to be draft-04 compliant thus removing the dependency on TV4. At that point any json validator can be used for validation and the proposal is to move to AJV. This will also give us coverage stats for our tests. |
ah - ok. I'll leave it then |
There are currently no automated tests in place for schema validity and these should be added to prevent recurrence of invalid schemas (issues #434 and #320).
The current json validator in use (TV4) does not check for schema validity as part of its tests.
The text was updated successfully, but these errors were encountered: