Skip to content

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.

JSON Schema validation

Notes ​

  • options.schema is reactive: replace it and the editor revalidates without being re-created.
  • Add custom rules with options.onValidate; its errors are included in validation-error.
  • Parse errors (text that is not JSON at all) are reported through the error event instead.

Read more in the Validation guide.

Released under the MIT License.