GenerateRandomSearch

JSON Array Generator

Generates a small array (2-4 items) of sample JSON objects — for API-mockup or documentation examples that need a list rather than a single object, with every element sharing a consistent type since that is what most real consumers of a JSON array actually expect.

What this generator does

Produces a small JSON array for pasting into a test, a mock response or documentation. It is a fixed-shape sample rather than a schema you design.

How to use this tool

  1. Press generate for a JSON array sample.

Worked examples

Use
Somewhere that needs a syntactically valid array with a few plausible entries

Common use cases

  • API documentation examples needing a list response
  • Placeholder data for mockups
  • Testing JSON-array-parsing code

How this generator works

Between two and four objects are built, each with a four-digit id, a name from a short fixed list and a boolean active flag, and the array is serialised with two-space indentation by the browser's own JSON serialiser. Every element has the same three keys with the same types, which is the deliberate part: JSON permits a mixed array and almost every consumer of one expects a uniform one.

Limitations and good to know

  • The shape is an example, not a contract for any real API. Adjust it to match the system you are testing.
  • Always two to four elements, with no control for the length, so it will not test pagination, virtualised lists or anything else that needs volume.
  • The ids and names are drawn independently for each element, so a name can repeat within one array and, rarely, so can an id.
  • No wrapping object or schema is produced, so a consumer expecting a named field will need one added.