JSON Schema Validator
Paste a JSON Schema and some JSON data. Every mismatch is listed with the path to the value, so you can fix the data or the schema.
Este conteúdo está em inglês.
Exemplos resolvidos
Data that fits
{"name":"Ann"}
Valid
The schema needs a name and the data has one.
Two problems
{"age":-1}
Invalid, 2 problems /: is missing the required property "name" /age: must be at least 0
A required key is missing and a number is below the minimum.
Sobre JSON Schema Validator
This validator checks JSON data against a JSON Schema. Paste the schema in the first box and the data in the second, and every mismatch is listed with the path to the value that caused it.
The common keywords are supported: type, enum, const, properties, required, additionalProperties, items, string and number limits, patterns, uniqueItems, allOf, anyOf, oneOf, not, if and then, and references to definitions in the same schema. Keywords the tool does not know are ignored.
Como usar JSON Schema Validator
- Paste your JSON Schema into the first box.
- Paste the JSON data you want to test into the second box.
- Read the result. Each problem starts with the path to the value.
Usos comuns
- Testing an API response against its published schema
- Checking a config file before it is deployed
- Writing a new schema and trying it on sample data
- Explaining to a colleague why some data is rejected
Perguntas frequentes
Which schema keywords are supported?
type, enum, const, properties, required, additionalProperties, patternProperties, propertyNames, items, contains, minItems, maxItems, uniqueItems, minLength, maxLength, pattern, minimum, maximum, exclusive limits, multipleOf, allOf, anyOf, oneOf, not, if with then and else, dependentRequired, and $ref to a local definition.
What does the path mean?
It shows where the problem is. /address/city is the city key inside the address object, and /items/2 is the third item in the items array. A single slash means the whole document.
What happens with keywords that are not supported?
They are ignored, so a Valid result means every supported rule passed. Rules the tool does not know are not checked.
Does it check formats such as email?
A few common ones are checked: email, date, date-time, time, uuid, uri and ipv4. Other formats are not tested.