How the JSON Schema Generator Works
AnyTool infers a JSON Schema from a sample document by walking the parsed JSON to detect types, nested objects, arrays of mixed records (merged into a superset rather than just the first item), null handling, and required fields. An opt-in heuristic pass detects enums (low-cardinality string sets) and string formats (date-time, email, uri, uuid). A draft adapter re-renders the output for Draft-04, 06, 07, 2019-09, or 2020-12, mapping keywords like $defs/definitions and $id/id correctly. Generation is debounced and runs live as you type.
- Type, required, and nested-structure inference
- Arrays of varied objects merged into a superset schema
- Opt-in enum and format (date-time/email/uri/uuid) detection
- All drafts: 04, 06, 07, 2019-09, 2020-12 via a draft adapter
- Debounced live generation; copy or download the schema
