Open dontcallmedom opened 12 months ago
Invalid commas removed, and tested succesfully with JSON validator. Following that, the schema was used as input to this JSON schema validator: https://www.jsonschemavalidator.net/
The JSON schema was then used to validate VISSv2 messages such as
{"action":"subscribe","path":"Vehicle","filter":[{"type":"paths","parameter":["CurrentLocation.Latitude", "CurrentLocation.Longitude"]}, {"type":"curvelog","parameter":{"maxerr":"0.00001","bufsize":"100"}}],"requestId":"285"}
The schema validator responded: No errors found. JSON validates against the schema.
Judging from this, it seems the "object/array" expression is a valid schema expression.
I don't know how thorough or reliable https://www.jsonschemavalidator.net/ - I can't find any mention of "object/array" in the JSON schema specs I see, and from the look of the VISS schema, "object" is probably what is wanted here. But the point remains that not knowing which version of the spec and which module the schema is based on is problematic given that this is a normative part of the spec.
Would it be an idea to add the actual schema as separate file in the repo, then we could as part of continuous integration add whatever validator we consider to be correct. Possibly using something like https://www.xmodulo.com/validate-json-command-line-linux.html, possibly using multiple validators if we want to make sure that none report an error
Then we just need to make sure that the version in the html documentation is identical to the individual file in the repo. This could also be used to have more test cases/examples, i.e. the spec only showing a subset of the examples, for the rest look at the text folder.
Set to "object" in PR#489
VISSv2 Transport JSON Schema is invalid:
"type": "object/array"
- although maybe it is valid in some version of JSON schema - but the spec should have a normative reference to the JSON schema version it relies on)