About json to json schema
JSON Schema describes the shape of JSON data so it can be validated, documented and used to generate code. The tool builds a schema from a sample.
What the schema holds
- The type of each property.
- A list of required properties.
- Nested objects and array item types.
Tighten it yourself
A generated schema is a starting point. Add limits such as minLength, minimum or enum values, based on the rules of your data.
A worked example
From {"id":1,"email":"[email protected]"} the tool writes a schema of type object with properties id (integer) and email (string) and lists both as required. You could then add "format": "email" and "minimum": 1 by hand.
Using the schema
- Validate incoming requests in your API.
- Generate forms, documentation and mock data.
- Store it with your code so that changes to the data format are reviewed.
