Browser-based developer utility · JSON Schema Draft-07 subset

Generate reproducible JSON Schema test fixtures

RandomGenerator QA Lab is a browser-based generator for valid examples and targeted invalid test cases from a documented JSON Schema Draft-07 subset. It helps developers and QA engineers create repeatable positive and negative test data without manually assembling every object. Paste or upload an object schema, choose a seed, inspect the built-in subset validator's results, and export JSON or JSONL fixtures. Schema text and generated fixture data are processed in this browser tab.

Local processing Seeded reproducibility Targeted boundary mutations JSON and JSONL export

Understand the fixture package before you generate it

A run produces more than a list of random values. The exported package records the schema, seed, generator and validator versions, generated fixture records, validation errors and rule-coverage outcomes. This context helps a developer understand where a test case came from and whether a negative case demonstrated the intended constraint.

  • Valid fixtures: candidate JSON instances accepted by this tool's documented subset validator.
  • Negative mutations: deliberately changed instances designed to test supported constraints such as required, numeric bounds, string lengths and array uniqueness.
  • Coverage status: VERIFIED means the built-in validator rejected a negative candidate only for the intended rule; UNVERIFIED and UNAVAILABLE cases must not be treated as successful isolated tests.

Use the exported fixtures as inputs to your own application's validator and test runner. This browser tool does not execute those tests or establish that your production API behaves correctly.

JSON Schema Test Fixture Studio

Paste a schema, check compatibility, then generate and inspect fixture cases.

Draft-07 subset · v2.1.3
Maximum 64 KB · Root type must be object
Paste JSON or choose a local .json file. Files are read locally in this browser tab.

Use the same schema, seed, count and application version to reproduce the same fixture data within that version. The seed is not cryptographic randomness.

“Verified” means the built-in validator accepted a valid fixture or rejected an invalid mutation only for its intended supported rule. It does not mean the complete JSON Schema Draft-07 specification or your application's validator has been independently verified.

JavaScript is required to generate fixtures. The product documentation remains available below.

3. Generated test cases

Fixture list

No fixtures yet.

Fixture details

Select a fixture to inspect its JSON and validation result.

Rule coverage and mutation results

Coverage appears after fixture generation.

How the JSON Schema test generator works

The studio reads your JSON Schema, checks that it fits the documented supported subset, creates candidate instances and validates each candidate with its built-in subset validator. Positive fixtures are included only when accepted. Negative mutations are marked verified only when the validator rejects them for the intended rule without unrelated validation failures.

  1. Paste or upload: provide JSON text or choose a local .json schema file.
  2. Check compatibility: unsupported keywords are reported instead of being silently treated as tested.
  3. Choose a seed: use the same schema, seed, fixture count and application version to reproduce output.
  4. Generate and inspect: create valid instances and targeted negative mutations, then inspect each validation result.
  5. Export: copy the package or download JSON and newline-delimited JSONL records.

What the tool accepts and returns

Input: a JSON Schema Draft-07 object schema with a root type: "object", within the documented size, depth and node limits.

Output: a package containing the input schema, seed, generator and validator version identifiers, valid fixture records, negative mutation records, validation errors and rule-coverage statuses. JSONL export contains one fixture record per line; it is not a single JSON array.

What it does not do: it does not call a live API, execute your Jest or Vitest suite, run your application code, fetch remote references or implement the complete JSON Schema Draft-07 specification.

Worked example: age validation boundaries

This complete object schema is illustrative and can be loaded into the studio. The sample fixture values below explain the expected shape; they are not claimed to be a generated result for a particular seed.

Example input schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "age": { "type": "integer", "minimum": 18, "maximum": 65 },
    "role": { "type": "string", "enum": ["member", "admin"] }
  },
  "required": ["age", "role"],
  "additionalProperties": false
}

Illustrative valid fixture

{ "age": 18, "role": "member" }

The value satisfies the required object properties, the integer type, the inclusive age boundary and the role enumeration.

Illustrative invalid mutation

{ "age": 17, "role": "member" }

The age value is below the declared minimum. An isolated mutation is verified by this tool only when its built-in subset validator reports the intended minimum failure and no unrelated validation failure.

Additional supported constraint examples

The following property-level examples illustrate several supported rules. They are examples for understanding the constraints, not claims about a particular generated seed. Each property belongs inside a root object schema, because this release requires the root schema to declare type: "object".

Required property

{
  "type": "object",
  "properties": { "email": { "type": "string" } },
  "required": ["email"]
}

{ "email": "qa@example.test" } includes the required property. {} violates the required rule.

String length

{ "type": "string", "minLength": 3, "maxLength": 8 }

"cat" is within the length range; "ox" is shorter than the minimum.

Array uniqueness

{
  "type": "array",
  "items": { "type": "string" },
  "minItems": 1,
  "maxItems": 3,
  "uniqueItems": true
}

["red", "blue"] contains distinct items; ["red", "red"] violates uniqueItems.

Practical QA use cases

  • Request and response payloads: create examples for your own API contract tests, then run them through the validator used by your service.
  • Form validation: exercise required fields, numeric boundaries, string lengths and array-size constraints.
  • Regression fixtures: keep a versioned JSON package beside your tests and compare output after schema changes.
  • Serialization checks: test how your application handles valid values and deliberately rejected inputs.

The generator provides fixture data. Your test runner and application remain responsible for executing assertions and validating production behaviour.

Using exported fixtures in a test suite

The JSON package contains a fixtures array. A test can load that array and pass each value to the validator used by your project. The following Jest-style example is a template: replace validateWithYourApplication with your own validation function.

const fixturePackage = require('./randomgenerator-fixtures.json');
const validFixtures = fixturePackage.fixtures.filter(
  (fixture) => fixture.kind === 'valid'
);

test.each(validFixtures)('accepts $id', (fixture) => {
  expect(validateWithYourApplication(fixture.value)).toBe(true);
});

This site does not install dependencies, generate test-runner files, or execute that test. It exports data for your existing workflow.

Supported JSON Schema features and limitations

This release implements a deliberately limited JSON Schema Draft-07 validation and generation subset. It is not a complete Draft-07 validator. The root schema must declare type: "object".

Supported in this release

  • Nested object properties and required properties.
  • String, number, integer, boolean and null types.
  • Enum and const values.
  • Numeric minimum, maximum, exclusiveMinimum and exclusiveMaximum.
  • String minLength and maxLength.
  • Arrays with a single items schema, minItems, maxItems and uniqueItems.
  • minProperties, maxProperties and boolean additionalProperties.
  • Nested object and array traversal up to a configured depth limit.
Not supported for validation or generation: regular-expression pattern, format, multipleOf, $ref and remote references, tuple items, schema-valued additionalProperties, patternProperties, composition keywords (allOf/anyOf/oneOf), conditional schemas, dependencies and arbitrary custom keywords. Type unions are also outside this release. Unsupported keywords are reported rather than treated as tested.

Methodology, accuracy and reproducibility

The generator uses a deterministic xoshiro128** pseudo-random stream. The same schema text, seed, requested valid count and application version reproduce the same fixture data within that version. Changing the schema, seed or generator version can change the output. This is reproducibility for software testing, not cryptographic randomness.

Numeric and string boundary mutations are derived from supported constraints. Array and object mutations are constructed from a valid base fixture. The built-in validator checks expected and actual outcomes. A mutation that fails for more than its intended rule is marked unverified. A rule that cannot produce a supported isolated case is reported as unavailable.

Validation follows the documented subset behaviour, not the complete JSON Schema specification. Review exported fixtures and cross-check important cases with the independent validator used by your own application.

Privacy and local processing

The application reads pasted schema text and selected JSON files in the browser. Fixture generation, validation and export are performed locally. This template does not include an application backend, remote schema fetcher, validator CDN or analytics script, and it does not send schema or fixture contents to a RandomGenerator application server.

The website itself is hosted by Blogger/Google. Blogger, browser features, and any site-level analytics or advertising services configured separately by the publisher may process ordinary visit, request or device information under their own terms. See the published Privacy Policy for the deployed configuration.

Frequently asked questions

What does this JSON Schema test fixture generator do?

It creates valid JSON examples and targeted invalid test cases from supported Draft-07 object schemas, checks them with its built-in subset validator and exports fixture records.

Does it support every JSON Schema feature?

No. It supports a limited subset described above. Patterns, formats, references, composition keywords, conditionals and other advanced features are not supported. Compatibility checks report unsupported keywords.

Are my schemas uploaded?

The tool processes schemas and fixtures in your browser and does not send their contents to a RandomGenerator application backend. The site is hosted by Blogger/Google; other services configured on the site may have separate data practices.

Can I test a live API?

No. The tool creates fixture files. It does not send HTTP requests to your API or execute your application's tests.

Is the seed secure for passwords or tokens?

No. The seed is for deterministic test-data reproduction only. Do not use it to create passwords, credentials, tokens or secrets.

Can I import exported fixtures into Jest or Vitest?

Yes. You can load the downloaded JSON package or JSONL records into your own test code. This release does not generate or execute Jest, Vitest, Playwright or Postman tests.

Why is a negative fixture marked unverified?

The candidate may fail for an additional rule or may not demonstrate the intended validation keyword in isolation. Review the validator errors and schema constraints before using that case.

What are the generation limits?

The schema input is limited to 64 KB, schema depth to 10, schema nodes to 500, valid examples to 1–20, array generation to 50 items and mutation coverage to 100 rules. Generated strings are limited to 500 Unicode code points.