happytails.ai

JSON Schema Sample Generator

Open JSON Schema Sample Generator on Happytails.ai. This view has the same page content and links, with explicit tool capabilities. Read the processing notes before using a tool.

Tool capabilities

{
  "id": "json-schema-sample-generator",
  "category": "data-tools",
  "built": true,
  "requirements": "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.",
  "implementation": {
    "fields": [
      {
        "key": "seed",
        "label": "Seed",
        "value": "1",
        "type": "text",
        "inputMode": "numeric",
        "maxLength": 10,
        "help": "Whole number from 0 to 4294967295. The same schema, seed and counts always give the same samples."
      },
      {
        "key": "validCount",
        "label": "Valid samples",
        "value": "3",
        "type": "text",
        "inputMode": "numeric",
        "maxLength": 3,
        "help": "Whole number from 1 to 100."
      },
      {
        "key": "invalidCount",
        "label": "Invalid samples",
        "value": "3",
        "type": "text",
        "inputMode": "numeric",
        "maxLength": 3,
        "help": "Whole number from 0 to 100. Each one breaks a single rule of the schema."
      },
      {
        "key": "draft",
        "label": "JSON Schema draft",
        "value": "auto",
        "type": "select",
        "values": [
          "auto",
          "draft-07",
          "2019-09",
          "2020-12"
        ]
      }
    ],
    "registrationFamily": "api-contracts-reference",
    "codeDirection": "ltr",
    "inputMaxLength": 50000,
    "inputErrorCode": "API_CONTRACTS_REFERENCE_TOO_LONG",
    "note": "Runs in your browser in a background worker. Accepts a schema of up to 50000 characters and returns only samples that the Ajv validator has checked.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 50000,
      "inputMode": "text",
      "label": "JSON Schema",
      "placeholder": "{\"type\":\"object\",\"required\":[\"id\"],\"properties\":{\"id\":{\"type\":\"integer\"}}}",
      "help": "Paste one schema as JSON or YAML. Local $ref links are followed. Up to 50,000 characters. Review the settings before running.",
      "helpParts": [
        "Paste one schema as JSON or YAML. Local $ref links are followed.",
        "Up to 50,000 characters.",
        "Review the settings before running."
      ],
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}

Page guide

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

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.

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.