How to use it
- Paste your schema in the first box and the JSON to check in the second, or open them as files.
- Leave the draft on “From $schema” or pick one by hand.
- Read the result: each error shows where it is (tap the line number to jump there in the box) and what the schema expected.
What it checks
- Every validation keyword of drafts 04 to 2020-12: types, required and additional properties, enums and const, numbers and lengths, patterns, array items, uniqueness,
if/then/else,allOf/anyOf/oneOf/not,$refand$defs, and unevaluated properties and items. - The schema itself: a keyword with a wrong value, such as
"type": "integr", and keywords the draft doesn't know, which are usually typos. - Syntax first: if either box isn't valid JSON, you see the line with a
^under the mistake, as in our JSON formatter.
Example
The sign-up schema loaded above needs a name, an email and an age of at least 18. The data has "email": "asha.rao.example.com" and "age": 17, so the validator reports 2 errors: /email (line 3, column 12) isn't a valid email address, and /age (line 4, column 10) must be at least 18 but is 17. Change the email to [email protected] and the age to 18 and it says the data is valid.
Make a schema from your data
No schema yet? Paste a sample of your JSON and press “Make a schema from this data”. You get a draft 2020-12 schema with each value's type, the keys of each object marked required, arrays described by their items, and common formats (email, date, date-time, URI, UUID) spotted. Tighten it by hand: add limits, enums and "additionalProperties": false, and drop keys from required that may be missing.
Validation uses the open-source json-schema-library (MIT licence), which reads the schema step by step instead of generating code, so nothing you paste is ever run.