Build a fixture from constraints
Paste a schema, choose a seed, and generate a sample. Required properties are included, enum and const constrain values, and numeric and string bounds guide generation. Optional properties can be included or left out. Examples and default values may be used when they also satisfy validation.
{
"type": "object",
"properties": {
"sku": {"type": "string", "pattern": "^[A-Z]{3}-[0-9]{4}$"},
"quantity": {"type": "integer", "minimum": 1, "maximum": 10}
},
"required": ["sku", "quantity"],
"additionalProperties": false
}
Generation and validation have different jobs
A schema describes acceptable values, but not necessarily an easy way to construct one. Overlapping oneOf alternatives, recursion and conditional requirements can be difficult to generate. This tool makes up to eight deterministic attempts and validates each with Ajv. Failure to find a sample does not prove that the schema is impossible.
Local references and limits
Keep definitions and references in one document; remote references are never fetched. Processing runs in a worker with an eight-second timeout. Schemas are limited to 500 KB, nesting to 100 levels, and size constraints to 1,000. Generated output is limited to 2 MB. Custom faker/chance extensions are disabled.
Need a schema first? Use JSON to JSON Schema. To validate existing records, use JSON Schema Validator.
Frequently asked questions
Is the generated sample guaranteed to match the schema?
An independent Ajv check validates every generated sample against the original schema before it is shown. If generation cannot satisfy the constraints, an error is shown instead. The generator does not support every JSON Schema feature.
What is the seed for?
It makes generation repeatable. With the same schema, options and seed, you get the same result. Changing the seed gives a different candidate. It is not a cryptographic random source and should not be used for passwords or secrets.
Which schemas work best?
Common draft 7 and 2020-12 object, array, string, numeric, enum, const, format and local-reference schemas work best. Complex conditionals, recursive constraints or contradictory combinations may fail generation. Large constraints and external references are rejected.
Can I use a schema written in YAML?
Yes. JSON and YAML are accepted. Values that cannot be represented exactly as JavaScript numbers are rejected rather than silently rounded.