This tool generates valid JSON Schema documents in the draft 2020-12 dialect, complete with randomly chosen property types, formats, and constraints. It is built for testing the tools that consume schemas — validators, form generators, mock-data producers, and documentation renderers — without hand-writing each example.
How it works
The generator builds an object schema and fills its properties map with a configurable
number of fields. Each field is assigned a random type and type-appropriate constraints:
string -> format: email | date-time | uri (sometimes), minLength, maxLength
integer -> minimum, maximum
number -> minimum, maximum
boolean -> (no extra constraints)
array -> items: { type: <random scalar> }
object -> nested properties (when nesting is enabled)
If you enable required fields, a random subset of the property names is copied into a
required array — and because those names are taken from the actual properties, the schema
stays internally consistent. The additionalProperties flag and $schema declaration are
added so the document is a complete, standalone schema.
Tips and notes
Enable nested objects to test how your tooling handles recursive subschemas, and toggle
additionalProperties to check both the open and closed object cases. Use a high property
count to stress-test renderers and form generators. The output is deterministic only within a
single generation — regenerate for a new shape, or copy and save a schema you want to reuse in
a fixed test.