onError function passed as an option into the JSONEditor doesn't get invoked when the JSON doesn't meet the schema requirements. Would there be anything you would recommend?
Thanks.
That's an interesting one. Currently errors are only thrown when the document contains invalid JSON but doesn't reckon with a JSON schema. A JSON Schema will only result in warnings being displayed to the user.
If you want to force a user to have JSON conform a JSON Schema before applying something, you have to manually validate the schema again.
A workaround is to check the internal result of the schema validation. When
// the internal validateSchema.errors is null when valid schema,
// and an array with messages when invalid
var errors = editor.validateSchema.errors;
Makes sense to me to create a neat public API to check the validity against the configured schema.
Makes sense to me to create a neat public API to check the validity against the configured schema.
+1
Most helpful comment
+1