The JSON Schema Generator reads a sample JSON value — an API response, a config file, a webhook payload — and writes a JSON Schema that validates it. It infers the type of every field, merges an array of objects into a single item schema rather than a noisy union, derives which keys are required from the ones present in every record, and can tag string formats like date-time, email, uri and uuid. You paste data you already have; you get the schema you would otherwise hand-write clause by clause.
Writing a schema by hand is slow and easy to get subtly wrong. It is tempting to type what you think a payload contains, miss a nested field, mark an occasionally-null property as required, or forget that one endpoint returns an array where another returns a single object. A schema generated straight from real data starts from the actual shape, so the document you validate against matches what the service genuinely sends. From there you tighten constraints — patterns, enums, minimums — by hand, but the tedious scaffolding is done.
Everything runs in your browser. The inference engine is dependency-free TypeScript, not a wrapper around a hosted API, so payloads — which routinely carry tokens, emails and internal IDs — never leave the page. Choose Draft-07 or the 2020-12 dialect, add a title, toggle required-field detection, format detection and strict `additionalProperties`, then copy the schema or download it as a .json file.
Drop in an API response, a fixture, or any JSON value. Load the sample first to see how nested objects, arrays of objects and string formats are handled.
Choose Draft-07 for the widest tooling support or 2020-12 for the current specification. The correct $schema URI is written onto the output for you.
Add an optional title, decide whether to emit a required array, detect string formats, and lock objects down with additionalProperties: false for strict validation.
Press Generate. Review the inferred types and required fields, then copy the schema to your clipboard or download it as a .json file ready to drop into your validator.
Emit either the widely-supported Draft-07 dialect or the current 2020-12 specification. The matching $schema identifier is written onto the root so validators pick the right rules.
An array of objects becomes a single items schema describing one element, not a sprawling anyOf. Keys present in every element are required; keys that appear in only some are left optional.
The generator derives the required array from keys present in every object it sees, which is exactly how real paginated data behaves — some fields are always there, others are not.
Recognises date-time, date, time, email, uri, uuid and ipv4 strings and tags them with the appropriate format keyword, giving you validation you would otherwise add by hand.
Generate TypeScript interfaces from any JSON sample. Infers nested types, merges arrays of objects into a single interface, marks nullable and missing keys optional, and emits clean exportable code. 100% client-side.
Format, validate, and minify JSON data
Convert JSON to clean, valid YAML instantly — configurable indentation and safe string quoting
0 comments
No comments yet. Be the first to share your thoughts!