How to use JSON Schema Generator
Generate a starting JSON Schema from a sample JSON value. Review the inferred object, array and scalar types before using it as an interface contract.
- Paste a representative sample.
- Generate the schema and add rules for values, optional fields and cases absent from the sample.
Example input
{"title":"Field Notes","inStock":true,"quantity":12,"tags":["paper","stationery"]}Example use
Start a schema for an inventory fixture with the shapes used by both ordinary and special items.
Output and compatibility
Inference reflects the examples present. It cannot know whether a property is optional in real use, or derive business rules, accepted ranges and meaningful formats.
Troubleshooting
If a later value fails validation, add representative cases or edit the inferred schema to reflect the intended contract.
Use JSON Schema Validator to check varied samples before publishing the schema.
Frequently asked questions
Can it infer every valid value from one example?
A single example cannot establish a complete contract. Review its constraints.
Which schema format is generated?
The output declares JSON Schema draft 2020-12.