>_devtools

JSON Schema Validator

Validate JSON against a JSON Schema (draft-07, 2019-09, 2020-12) and see each error with its instance path and line number.

What this does

Paste a JSON Schema and a JSON document. The validator checks the document against the schema as you type and lists every error, not just the first, with the instance path to the failing value (a JSON Pointer such as /roles/2), the keyword that failed, the schema location, and the line and column in your JSON where the value starts.

/id       must be >= 1                                  line 2, column 9
/email    must match format "email"                     line 3, column 12
/roles/1  must be equal to one of the allowed values    line 7, column 5
/roles    must NOT have duplicate items (items ## 0 and 2 are identical)
(root)    must NOT have additional properties           line 10, column 15

Drafts

The draft is chosen from the schema's $schema keyword: Draft-07, 2019-09, or 2020-12. A schema without $schema is treated as 2020-12. You can also pick a draft explicitly from the Draft menu, which is useful for schemas that omit $schema but use Draft-07 features such as array-formitems. Older drafts (Draft-04 and Draft-06) are not supported and are reported as such.

Validation details

  • The schema is itself checked against the draft's meta-schema first, so a typo such as"type": "strng" is reported at its line in the schema instead of being ignored.
  • Standard formats (email, uri, date-time, uuid,ipv4, and others) are checked using the ajv-formats rules. Untick “Validate formats” to treat format as an annotation only.
  • References resolve inside the schema only (#, #/$defs/name,#/definitions/name). Remote and file $ref values are never fetched, so validation cannot make network requests; the error message names the reference you need to inline.
  • With a schema and no data, the tool just tells you whether the schema is valid for its draft.
  • Limits: 1 MB for the schema, 5 MB for the data, and the first 500 errors are listed. Validation runs in a background worker and is stopped after 10 seconds, which protects the page from a schema with a catastrophic regular expression.

Engine

Validation uses Ajv 8, a widely used JSON Schema validator, so results match what you would get in a Node.js service using the same library.

Privacy

Both documents are validated in your browser. Nothing is uploaded, stored, or fetched.