JSON Schema Generator
Infer a starter JSON Schema recursively from the observed types and nested structure of a JSON sample.
How to use
- Provide a representative JSON sample, choose the schema draft, and run.
Capabilities and scope
A dedicated runner can emit Draft 2020-12 or Draft 7 and handles object, array, integer, number, string, boolean, and null recursively.
How it works
Object keys become properties and required entries; arrays compare observed element schemas and use one items schema or anyOf for multiple shapes.
Example
A sample with a user object and string roles array produces nested object and string-array schemas.
Useful for
- Bootstrap a schema skeleton from an API example
Before you use it
- Formats, ranges, patterns, enums, optional fields, and semantic constraints cannot be inferred reliably from one sample and are not invented.
Standards and references
Frequently asked questions
Are all observed keys marked required?
Yes. The current runner marks every key present in the sample as required, so review it against the actual contract.