Open mkaut opened 5 years ago
I think validation should work as expected as this is not part of VJE, but the UI does not yet support all JSON Schema features... but I accept PRs :-)
I am not sure what you mean by "should work", but the validation clearly does not work, since it validates files that break the additionalProperties
or patternProperties
requirements. If the validation is not part of VJE, can you file a bug upstream?
since it validates files that break the additionalProperties or patternProperties requirements
That’s probably because they are loaded into the ui model and then the data gets lost when converting the ui model back for validation...
See also: http://njsonschema.org
The following example (taken from https://cswr.github.io/JsonSchema/spec/objects/) does not work:
The file is correctly validated, but the "age" property is not shown in the editor, and neither is it possible to add new properties (allowed by the schema). Also, if I change "age" to "25" (a string), the JSON is still validated, even if it is invalid. It even validates with
additionalProperties: false
... In other words, it looks like theadditionalProperties
keyword is ignored in the schema. I have also testedpatternProperties
and it does not work either,I could understand if you did not want to have additional properties in the editor (since without
additionalProperties: false
, one can add anything anywhere), but it would be nice if the validating worked correctly and also if the already present (and valid) keys we shown in the editor...