Skip to content
MtrXTools

JSON Schema validator

Validate a JSON document against a JSON Schema (draft 2020-12, 2019-09, 7 or 4) and see every error by path, with the schema rule that failed. References inside the schema are resolved; remote ones are never fetched. Runs in your browser.

Last updated

What it does

  • Validates a JSON document against a JSON Schema and lists every error, not just the first: the path in the document (/tags/1), what is wrong, and the schema rule that failed (#/properties/tags/items/$ref/maxLength).
  • Supports drafts 2020-12, 2019-09, 7 and 4, chosen from the schema's $schema or picked by hand. Schemas without $schema are checked as 2020-12.
  • Resolves references inside the schema, such as #/$defs/address and $id-based ones. References to other files or URLs are never fetched; paste those definitions into $defs.
  • Checks format keywords such as email, date-time, uri and uuid.

Reading the errors

Errors are reduced to the most specific rule that failed, so a bad tag shows the tag's own rule rather than a chain of "property does not match" messages above it.

A property that isn't in properties under additionalProperties: false is reported as not allowed. Declared properties that break their own rules are reported only for those rules.

Questions

Which draft should I use?
Use whatever your validator in production uses. OpenAPI 3.1 uses 2020-12; OpenAPI 3.0 uses a variant of draft 4 (draft 4 here is close). Most new schemas should declare 2020-12 in $schema.
Why does it say a reference can't be resolved?
The $ref points at a definition that isn't in the schema, or at another file or URL. This tool never fetches remote schemas, so paste the definition into $defs and point the reference at #/$defs/name.
Are my schema and data uploaded?
No. Validation runs in your browser.