ant generate api with --json to generate all layers at once.
Minimal valid spec
GET /health endpoint with a placeholder response.
Full spec structure
Fields
project (optional)
| Field | Type | Description |
|---|---|---|
description | string | Displayed in --verbose mode only. Not used in generation. |
routes (required)
A map of route names to route configurations. Each key becomes a Flask Blueprint registered at /<route_name>.
Route configuration
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | HTTP method for the main route endpoint. One of GET, POST, PUT, DELETE (case-insensitive). |
mock | any JSON | No | Mock data returned by the service. If omitted, returns a placeholder string. |
subroutes | object | No | Map of subroute names to subroute configurations. |
Subroute configuration
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | HTTP method. One of GET, POST, PUT, DELETE. |
mock | any JSON | No | Mock data for this subroute. |
Mock data
Mock data can be any valid JSON value:mock is omitted:
- GET routes return:
"Your <name> route is working!" - POST subroutes return:
"Successfully created <subroute> for <route> with data: {data}"
Full example
| Method | URL |
|---|---|
| GET | /users |
| GET | /users/profile |
| POST | /users/create |
| GET | /orders |
| GET | /orders/items |
| POST | /orders/submit |
| GET | /health |
Validation rules
Route names:- Must be valid Python identifiers
- Letters, digits, and underscores only
- Cannot start with a digit
✅ users, user_posts, api_keys—❌ my-route, 1users, user posts
GET,POST,PUT,DELETEonly (case-insensitive)PATCH,HEAD,OPTIONSare not supported
Validation errors
All validation errors are self-descriptive:--dry-run to validate without generating files: