How to Validate JSON Against a Schema
JSON Schema Validation
When to Validate Schemas
Validate API payloads, config files, and webhook bodies against JSON Schema before deployment or integration testing. Paste your JSON instance and schema to see precise validation errors with paths.
Real-World Examples
Reject API requests where email is missing or not a string
Verify config files require version as a number before deploy
Catch webhook payloads with unexpected extra fields using additionalProperties: false
Common Mistakes
- Confusing JSON syntax errors with schema violations — parse JSON first
- Using draft-04 keywords in a draft 2020-12 schema (or vice versa)
- Expecting automatic type coercion —
"42"is a string, not a number
Developer Tips
- Store schemas in version control alongside OpenAPI specs
- Use
requiredarrays for mandatory fields,enumfor allowed values - Run schema validation in CI for config and fixture files
Frequently asked questions
Is this the same as JSON syntax validation?
No. Syntax validation checks whether text parses as JSON. Schema validation checks whether parsed data matches your declared structure and types.
Which JSON Schema draft is supported?
This tool uses Ajv, which supports modern JSON Schema drafts. Check your schema $schema field for compatibility.
How do I read validation errors?
Each error includes a JSON Pointer path (e.g. /user/email) and a message describing the failed constraint.