JSON Schema validator
Check a JSON document against a JSON Schema and list every failure with its path.
Runs in your browser. Your input is not uploaded.
What it does
JSON Schema describes the shape a JSON document must have: required properties, types, formats and ranges. Validators use it to check API requests, config files and test fixtures.
Validation uses @cfworker/json-schema, which supports drafts 2020-12, 2019-09, 7 and 4 without evaluating generated code.
How to use it
- Paste the schema on the left and the JSON document on the right.
- Choose the draft if the schema has no
$schemakeyword. - Read the result. Each error shows the path to the failing value and the rule it broke.
Things to watch for
formatkeywords such asemailare checked here, but many validators treat them as annotations only. Do not rely on them across tools.- Remote
$refURLs are not fetched. Put referenced definitions in$defsin the same schema.
Questions
- Which draft should I use?
- Draft 2020-12 for new schemas. OpenAPI 3.1 uses 2020-12; OpenAPI 3.0 uses an extended subset of draft 4/5.
- What does additionalProperties: false do?
- It rejects any property not listed in
properties. It is the usual way to catch typos in config. - Why does a missing property pass?
- Properties are optional unless listed in
required. - Can I generate a schema from JSON?
- Not here yet. This tool validates against a schema you supply.