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
$schemaor picked by hand. Schemas without$schemaare checked as 2020-12. - Resolves references inside the schema, such as
#/$defs/addressand$id-based ones. References to other files or URLs are never fetched; paste those definitions into$defs. - Checks
formatkeywords such asemail,date-time,urianduuid.
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
$refpoints 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$defsand point the reference at#/$defs/name. - Are my schema and data uploaded?
- No. Validation runs in your browser.