JSON Schema Validation
Pass a JSON Schema as options.schema. Invalid nodes are highlighted in the editor, and the validation-error event gives you the list of errors, here used to show a live status. Try fixing the email and age.
Notes
options.schemais reactive: replace it and the editor revalidates without being re-created.- Add custom rules with
options.onValidate; its errors are included invalidation-error. - Parse errors (text that is not JSON at all) are reported through the
errorevent instead.
Read more in the Validation guide.