JSON payload validator for the rules a receiver enforces
Paste a JSON object or an array of objects, list the fields the receiving API accepts, and see every value that breaks a rule, with its exact position. Nothing is sent to a server.
Loading the tool…
Paths for nested data
A field is named by its path. A dot goes into an object, and [] goes through every element of an array:
customer.emailis theemailinsidecustomer.lines[].skuis theskuof every element oflines. A problem is reported with its index, such aslines[2].sku.tags[]is every value of an array of plain values.
JSON is checked strictly: the number 5 is not the string "5". That is what most receiving APIs do, and it is the difference that a quick visual check misses.
What it checks
- Required fields that are absent,
nullor empty. - Types: string, integer, number, boolean, date, datetime (ISO 8601), email.
- Minimum and maximum length of strings, minimum and maximum of numbers.
- Allowed values, for status codes and other closed lists.
- Fields the contract does not name, if you choose to refuse them.
How this differs from JSON Schema
This is not a JSON Schema validator. A contract here is a flat list of paths with a type and a few limits, the same for JSON and for CSV. It is quicker to write and to read, and it can be compared version to version. If your API publishes a JSON Schema with conditional rules or references, use a JSON Schema validator for that.
To apply a contract to every call rather than to one pasted message, create a validation endpoint.
Questions
- Can it infer the contract from a sample?
- Yes. Paste a payload you know is accepted and use “Infer the contract from this sample”. Types and required flags are proposed, and string lengths are the ones observed, to be replaced by the real limits.
- Does it accept an array of objects?
- Yes. Each element is checked as one record and problems are reported with the item number.
- Is the payload sent anywhere?
- No. The check runs in your browser.