Skip to content

Schema

Chimera supports schema files as input to define mock API routes and auto-generate data.

  • Directoryproject/
    • schema.json

Run chimera with schema.json

Terminal window
chimera-cli --path schema.json http -X

This runs chimera-cli as a mock http server at port 8080 using schema.json

{
"routes": [
{
"path":"api/v2/data",
"no_of_entries": 2,
"schema": {
"id": "id",
"created_on": "date",
"mssg": "lorem"
},
"null_percentage": 5
},
{
"path":"products",
"no_of_entries": 3,
"schema": {
"id": "id",
"rsnd": "integer",
"name": "name",
"probability": "boolean",
"date": "datetime",
"desc": "lorem"
},
"null_percentage": 0
}
]
}

Here

  • path: The API endpoint
  • no_of_entries: It is the no. of objects in the response of the endpoint
  • null_percentage: It is the percent of null values that will be present in the response
  • schema: It is the schema for the response of that endpoint
PlaceholderDescription
nameRandom name
idRandom number
integerRandom number
dateDate in DD-MM-YYYY format
datetimeDate in DD-MM-YYYYTHH:MM:SS format
loremRandom text
stringRandom word
booleanRandom boolean value