GenerateRandomSearch

Nested JSON Generator

Generates a small sample JSON object with two levels of nesting — a user object that holds an address object — for API-mockup or documentation examples that need more structure than a flat object.

What this generator does

Produces a JSON object with nested structure, for exercising code paths that flat sample data never reaches — recursive rendering and deep property access.

How to use this tool

  1. Press generate for a nested JSON sample.

Worked examples

Use
Testing a tree component, a deep-merge function or a JSON viewer

Common use cases

  • API documentation examples needing nested structure
  • Placeholder data for mockups
  • Testing JSON-parsing code

How this generator works

Every document has the same shape: a numeric id, a user object containing a name and an address object with a city and a postcode, and a boolean active flag. The values are drawn from short fixed lists plus a random four-digit id, and the object is serialised with two-space indentation by the browser's own JSON serialiser, so what you copy is always well-formed.

Limitations and good to know

  • The shape is fixed: always two levels deep, always the same seven keys, no arrays and no null. It will not exercise a depth limit or a parser's handling of mixed types.
  • Structure only — the keys and values are shaped like data, not modelled on anything real, and the city and postcode are drawn separately, so they need not belong together.
  • No schema is produced alongside it, so this exercises a parser rather than a validator.