JSON Schema Validator
Paste a schema and a JSON document. I tell you whether the document is valid and, if it is not, exactly where it goes wrong and which schema rule it breaks.
Paste a schema and a document to see the result.
Come utilizzare JSON Schema Validator
Paste the schema
In the first field, write the JSON Schema (draft-07, 2019-09 or 2020-12). Local $ref references to $defs or definitions are supported.
Paste the document
In the second field, put the JSON to check. If it is not valid JSON, I show you the line and column of the first error.
Read the path and the rule
For each error you see the document field (e.g. /users/1/age), the schema rule that failed and the explanation.
Suggerimenti
- If a oneOf rule fails with 0 valid branches, below you will find the errors of the branch closest to passing.
- The number 1.0 is an integer for JSON Schema: JSON does not distinguish 1 from 1.0.
Domande frequenti
Which JSON Schema versions are supported?
The core common to draft-07, 2019-09 and 2020-12: types, enum, const, required, properties, patternProperties, additionalProperties, items and prefixItems, numeric and length limits, pattern, format, allOf, anyOf, oneOf, not and if/then/else. Unsupported keywords are listed in the result, not silently ignored.
Why do external $ref references not work?
By design: downloading a schema from an address would mean making a network request based on your data. The tool resolves only local references (#/$defs/name, #/definitions/name, $anchor). Paste the definitions you need into the schema.
What does an error path mean?
It is a JSON Pointer (RFC 6901): /users/1/age is the age field of the second element of the users array. The schema has a similar path, which tells you which rule failed.
Is the format keyword checked?
Yes, for date, date-time, time, email, uuid, hostname, ipv4, ipv6 and uri. In JSON Schema 2020-12 format is normally only an annotation, so other validators may not report it.
Can a pattern freeze the page?
Some regular expressions can take a huge amount of time on certain texts. The tool does not run patterns with nested quantifiers, such as (a+)+, and reports it; it also limits depth, steps and the number of errors shown.
Strumenti simili
Want to learn more?
Read our in-depth articles on related topics: