happytails.ai
English

JSON Schema Sample Generator

Create reproducible valid and invalid test data from a JSON Schema. Every sample is checked with a JSON Schema validator before it is offered.

Accepts a schema of up to 50,000 characters, 1 to 100 valid samples and 0 to 100 invalid samples, with a 4,000,000 character result. Everything runs in your browser. Downloads are a JSON report and JSON Lines files. Paste one schema as JSON or YAML. Local $ref links are followed. Up to 50,000 characters. Review the settings before running.

Your result

How to use JSON Schema Sample Generator
  1. Paste a JSON Schema as JSON or YAML.
  2. Choose a seed and how many valid and invalid samples you want.
  3. Run the generator and review which rule each invalid sample breaks.
  4. Download the report or the JSON Lines files.

Report a problem or share an idea.

Useful next steps

Accepts a schema of up to 50,000 characters, 1 to 100 valid samples and 0 to 100 invalid samples, with a 4,000,000 character result. Everything runs in your browser. Downloads are a JSON report and JSON Lines files.

How samples are made

The generator walks the schema and picks values from types, enums, ranges, lengths, simple patterns and common formats with a seeded random number generator, so the same seed gives the same samples. Each candidate is then validated with Ajv. A candidate that fails is replaced, and after 25 tries the sample is listed as one that could not be generated instead of being emitted.

Invalid samples

Invalid samples start from a valid one and break one rule at a time, such as a wrong type, a missing required property, a value outside an enum or range, or an extra property. Each is validated again and the report names the keyword that failed.

Limits

Only local references inside the schema are followed; references to other files or URLs are never fetched. Complex regular expressions, not and some combinations of oneOf can exceed the generator's supported search. Those samples are reported as not generated. Schemas using __proto__ as a property, pattern or dependency key are rejected because the bundled validator cannot check that key reliably. Literal instance data with that key is preserved.