About json schema tester
Test JSON data against a JSON Schema to catch missing fields and wrong types before they reach your code.
What it reports
- Every violation with its location in the data.
- Missing required properties.
- Values of the wrong type or outside allowed ranges.
Why validate
Validating input at the edge of your system stops bad data early and gives clearer error messages.
A worked example
With a schema that requires an integer id and an email string, the data {"id":"7","email":"not-an-email"} fails twice: id has the wrong type and email does not match the format. Each message gives the path to the problem so you can fix it quickly.
Writing good schemas
- Mark required fields explicitly.
- Use enum, minimum, maximum and pattern to describe valid values.
- Set additionalProperties to false if unknown fields should be rejected.
Draft versions
JSON Schema has several drafts, such as 2019-09 and 2020-12. Make sure your schema's $schema value matches the validator you will use in your project.
