What is JSON Schema Draft 2020-12?
JSON Schema Draft 2020-12 is the latest stable specification of JSON Schema, defined by the JSON Schema specification working group. It introduces $dynamicRef, $dynamicAnchor, prefixItems for tuple validation, and improvements to vocabularies. Most modern validators (Ajv 8+, Pydantic v2, opis/json-schema) support it. The generator emits 2020-12 by default — change the $schema URI to draft-07 if you target an older validator.
How are required fields detected?
The generator marks every key present in the sample object as required, on the assumption that fields you observed in a real payload are part of the contract. If a field is optional in your API, remove it from the required array after generating. For optional fields, also consider adding nullable: true (Draft 7) or "type": ["string", "null"] (Draft 2020-12).
Can I generate Draft 7 instead?
Yes — change the $schema value to "http://json-schema.org/draft-07/schema#". Draft 7 is widely used by OpenAPI 3.0 and many existing tools, though OpenAPI 3.1 fully supports 2020-12. The generated structure (type/properties/required/items) is identical between the two drafts for the cases produced here, so swapping $schema is enough.
How does this differ from a TypeScript or Java type generator?
A type generator produces source code in a language. A JSON Schema generator produces a portable validation contract that any language can consume — Ajv in JavaScript, Pydantic in Python, opis/json-schema in PHP, JSON-Schema-Validator in Java. Use the schema as the source of truth and generate language-specific types from it (quicktype, json-schema-to-typescript) for full interoperability.
How are nested objects represented?
Each nested object becomes an inline object schema with its own type, properties, and required arrays. For deduplication, refactor identical nested shapes into $defs and reference them with $ref. The generator does not deduplicate automatically — that requires structural diffing across paths.
How are arrays handled?
A JSON array becomes "type": "array" with an items schema inferred from the first element. If the array is empty, items is left as {} (no constraint). For tuple validation (positional items of different types), switch to prefixItems in Draft 2020-12.
Is the JSON uploaded to your servers?
No. Conversion runs entirely in your browser via JavaScript. Open DevTools → Network and click Convert — no requests are made. Even production payloads with PII or tokens never leave your machine.
How do I validate JSON against the generated schema?
In JavaScript: install Ajv (npm i ajv), then const ajv = new Ajv(); const validate = ajv.compile(schema); validate(data). In Python: pip install jsonschema, then jsonschema.validate(data, schema). In Java: networknt/json-schema-validator. Each library returns errors with paths, perfect for API request body validation.