Skip to content
OddsockLocal
Local
Source text
{
  "color": "red",
  "count": 2
}
1 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Leave the input blank or type field:type pairs.
  2. Pick the dataset if the input is blank.
  3. Set Rows and Seed. Output stays json unless you change it.
  4. Copy the array. The same seed repeats it.

What is Mock JSON?

Mock JSON is the same generator as the CSV page, with Output starting on json. Dataset users, seed guide, two rows is an array: id 1, Eden Taylor, eden.taylor.1@example.test, 6091 Cedar Street, then id 2, Inez Chen, inez.chen.2@example.test, 6541 Sycamore Street. The CSV of those same settings is the same people with a header row. The seed is doing the work. Drop it and the names move.

Read more

Blank input selects the preset for users, orders or products. A field list such as n:id,cost:price,active:boolean builds those columns instead, and a repeated call with the same seed returns the same booleans and prices. Unknown types fail with the list of types the generator implements. Rows above 10000 are rejected.

The array is ready for JSON to SQL if you want an INSERT, or for the data generator if you want the SQL or TypeScript written here. These are not accounts. The addresses are from a six-name street list.

Use cases

  • A frontend fixture needs two user objects, and the test asserts on eden.taylor.1@example.test.
  • You want the JSON array rather than the CSV header the other page writes for the same seed.
  • A custom schema of id, price and boolean should be stable across two runs when the seed is set.
  • The orders preset should be a JSON array of products and statuses, not an INSERT, until you ask the other page for SQL.

Two users as JSON, seed guide

Dataset users, output json, rows 2, seed guide.

[{ id: 1, name: Eden Taylor, email: eden.taylor.1@example.test, address: 6091 Cedar Street }, { id: 2, name: Inez Chen, email: inez.chen.2@example.test, address: 6541 Sycamore Street }]

Why use Oddsock

JSON is the default here so a fetch mock can paste the array. The CSV page would have wrapped the same people in a header.

Related tools

Using this tool

Eden Taylor, eden.taylor.1@example.test, 6091 Cedar Street. The second row is Inez Chen at 6541 Sycamore Street.