JSON Schema Validator (2026)
Validate JSON data against a JSON Schema. Powered by Ajv — the most-installed schema validator on npm. Supports drafts 04 through 2020-12. Pure browser.
When to validate against a schema
- Before sending a request body to an API — catch issues client-side instead of getting a 400.
- After receiving a response from an untrusted upstream — guarantee the shape your code expects.
- In CI against test fixtures — make sure your test data still matches the schema as you evolve it.
- In docs — Specway validates every example payload in your OpenAPI spec at build time. If an example doesn't match its declared schema, the build fails.
JSON Schema vs OpenAPI schema
The schemas in your openapi.yaml's components/schemas section are JSON Schema — with some constraints depending on OpenAPI version. OpenAPI 3.0 uses a draft-04-ish dialect; OpenAPI 3.1 fully aligns with JSON Schema 2020-12. Either way, you can paste a schema from your spec and validate request/response bodies against it with this tool.
What the validator catches
- Type errors — string where number expected, object where array expected.
- Missing required fields.
- Out-of-range values — minimum, maximum, minLength, maxLength.
- Pattern violations — regex on strings.
- Format violations — email, uri, date-time, uuid (with ajv-formats).
- Enum violations — values outside the allowed set.
- Additional properties when
additionalProperties: false.