Data Autogeneration
Chimera allows you to automatically generate mock JSON data using a custom schema file. This is useful when you need realistic sample data for testing or demos without manually crafting each entry.
Schema Format
Section titled “Schema Format”A schema file defines the structure of the data and how values should be generated. Here’s a simple example:
{ "routes": [ { "path":"api/v2/data", "no_of_entries": 2, "schema": { "id": "id", "created_on": "date", "mssg": "lorem" }, "null_percentage": 0 } ]}
Supported Placeholders
Section titled “Supported Placeholders”Placeholder | Description |
---|---|
name | Random name |
id | Random number |
integer | Random number |
date | Date in DD-MM-YYYY format |
datetime | Date in DD-MM-YYYYTHH:MM:SS format |
lorem | Random text |
string | Random word |
boolean | Random boolean value |
More placeholder types will be added in future versions.
Use the --path
flag with the -X
option to autogenerate data:
chimera-cli.exe --path schema.json http -X
This will generate mentioned items for each endpoint defined in the schema and serve them as mock API routes.
path
: Name of the routeno_of_entries
: Number of mock entries to generateschema
: Define fields and their data typenull_percentage
: Percentage of fields and rows to be randomly set asnull
You can also combine it with other flags like --port
, --latency
, and --sort
.
Example Schema File
Section titled “Example Schema File”{ "routes": [ { "path":"api/v2/data", "no_of_entries": 2, "schema": { "id": "id", "created_on": "date", "mssg": "lorem" }, "null_percentage": 0 }, { "path":"products", "no_of_entries": 3, "schema": { "id": "id", "rsnd": "integer", "name": "name", "probability": "boolean", "date": "datetime", "desc": "lorem" }, "null_percentage": 0 } ]}
Output Example
Section titled “Output Example”Output response for route /api/v2/data
[ { "created_on": "05-07-2025", "id": 1, "mssg": "est nostrum nulla dolores ex voluptas.\nomnis quisquam neque est omnis at." }, { "created_on": "05-07-2025", "id": 2, "mssg": "laboriosam nostrum blanditiis voluptas rerum quaerat exercitationem molestiae autem." }]
Output response for route /products
[ { "date": "2025-07-05T17:59:55.523450+00:00", "desc": "et eveniet veniam et architecto rerum.", "id": 1, "name": "Keaton Gutmann", "probability": true, "rsnd": 74 }, { "date": "2025-07-05T17:59:55.524469200+00:00", "desc": "asperiores molestiae corrupti delectus repellendus consequuntur at.\nid aut autem fuga officia.", "id": 2, "name": "Shakira Hickle", "probability": true, "rsnd": 38 }, { "date": "2025-07-05T17:59:55.524489100+00:00", "desc": "quis sit sit consequuntur et animi similique.\niste dicta et aperiam unde ut et.", "id": 3, "name": "Virgie Nitzsche", "probability": true, "rsnd": 36 }]