About JSON Schema validator
A JSON Schema describes the shape a document must have: which fields are required, what type each one is, and which values are allowed. Validating against it catches mistakes before they reach production. MyJson checks a document against a schema and lists every problem with the line it occurs on.
If you do not have a schema yet, generate one from a sample document and refine it. Drafts 4, 6, 7, 2019-09 and 2020-12 are supported.
How to use it
- 1Paste the dataAdd the JSON document to validate in the Data panel.
- 2Paste or generate the schemaAdd an existing JSON Schema to the Schema panel, or press Generate schema to write one from your data.
- 3ValidateProblems appear in the list below the panels with the JSON pointer, the line number and the rule that failed.
- 4Fix and repeatClick a problem to jump to its line. Validation reruns as you edit either panel.
Features
- JSON Schema drafts 4 through 2020-12
- Every problem with its JSON pointer and line number
- Click a problem to jump to the line
- Generate a schema from sample JSON
- Copy a validation report
- Runs locally with Ajv
When to use it
- Checking an API payload against its published contract
- Validating configuration files before deployment
- Writing a schema for a new endpoint from a real response
- Debugging why a strict parser rejects a document
Frequently asked questions
Which JSON Schema drafts are supported?
Draft 4, draft 6, draft 7, 2019-09 and 2020-12. The draft is read from the $schema keyword, and 2020-12 is used when it is missing.
Can I generate a schema from JSON?
Yes. Generate schema infers types, required fields and array item shapes from your sample. Review the result and loosen or tighten rules as needed.
Is validation done on a server?
No. The validator runs in your browser. Neither the data nor the schema is uploaded.
Related tools
Looking to learn more? Browse our JSON guides and tutorials.