Tools

JSON Schema validator

Check a JSON document against a JSON Schema with Ajv and see every failing path, not just the first one.

Runs in your browserAI developer tools14.8K
Free

Input

0 B

Result

The result will appear here.

When a model's structured output, a webhook payload or a config file is rejected, the useful answer is a list: which paths fail and which rule each one breaks. This validator runs Ajv, the JSON Schema implementation most JavaScript tooling is built on, with allErrors switched on, so a document with five problems shows five lines — the JSON pointer to the value, the message, and the path inside the schema that produced it. Put the schema in the schema box and the document in the input pane.

How it works

  • The dialect follows the schema's own $schema: 2020-12 and 2019-09 use Ajv's matching classes, draft-07 or no declaration the default one.
  • ajv-formats is loaded, so format keywords such as email, date-time, uri and uuid are checked instead of silently ignored.
  • Strict mode is off, so annotations such as examples or vendor keywords do not stop validation; a schema that is itself invalid is reported as such.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.

What it costs

This tool is free, with no sign-in and no points.

Common questions

Why is my draft-04 schema refused?
Draft-04 defines exclusiveMinimum and exclusiveMaximum as booleans, while later drafts made them numbers, so running an old schema under a newer dialect can pass data it should fail. Rather than guess, the tool asks you to update $schema. Draft-06 schemas are accepted and checked as draft-07, which only adds keywords.
What does the path after 'at' mean?
It is the schema path of the rule that failed, for example #/properties/items/items/properties/price/minimum. The first path on each line points into your data, and this second one points into the schema, which is what you need when the schema, not the data, turns out to be wrong.
Does it fetch $ref URLs from the internet?
No. References inside the same schema (#/$defs/… or #/definitions/…) resolve, but remote $ref URLs are not downloaded, and a schema that depends on one fails to compile with a message naming the reference. Paste the referenced definitions into $defs to validate offline.

The open-source behind it

This tool runs on ajv-validator/ajv, released under MIT. If you need the same behaviour inside your own program, that is the library to reach for.

ajv-validator/ajv

Also known as

  • json schema validator
  • validate json against schema
  • ajv online
  • json schema 2020-12
  • json schema draft 7