Skip to content
SDETRole
SDETRole

JSON & Data

JSON Schema Validator

Validate JSON against draft 2020-12 or draft-07 schemas, or infer one.

Runs entirely in your browser No sign-up

Schema · 2020-12

JSON data

Paste a schema and some data, or load the sample

No schema yet? Paste a known-good response as data and click “Generate schema from data” to get a starting point.

About this tool

Schema validation turns “the response looks right” into a repeatable contract check: required fields, types, formats, enums and array shapes. This validator uses Ajv, the same library many JavaScript test suites use, with ajv-formats for email, date-time, uuid and uri checks. Every error is listed with its instance path (/items/1/qty) and a plain-English message, and all errors are reported, not just the first. If you have no schema yet, paste a known-good response and generate a starting schema from it, then tighten it by hand.

How to use it

  1. Paste the schema on the left and the JSON data on the right, or load the sample order schema and its intentionally broken data.
  2. Leave the draft on “Auto” to follow the schema’s $schema keyword, or force 2020-12 or draft-07.
  3. Fix the listed errors; the result updates as you type.
  4. To start a new schema, paste a real response as data and click “Generate schema from data”.

JSON Schema Validator FAQ

Should I use draft 2020-12 or draft-07?

Use whatever your other tools support. OpenAPI 3.1 aligns with 2020-12, while many older validators and OpenAPI 3.0 tooling are closer to draft-07. The main visible differences are tuple arrays (prefixItems in 2020-12, items as an array in draft-07) and $defs versus definitions.

How good is the generated schema?

It is a starting point inferred from one sample: types, nested objects, array item shapes, common string formats and every key seen in the sample marked as required. It cannot know which fields are optional, which values are enums, or numeric limits, so review it before using it as a contract.

Why is an invalid email accepted?

The “format” keyword is only enforced when a validator enables format checks. This tool enables them via ajv-formats; if your test framework does not, add the formats plugin there too or the same data will pass.

Type to search across SDETRole.

Full-text search by Pagefind · runs in your browser Open search page →