Skip to main content
The JSON spec lets you define your entire API — routes, subroutes, HTTP methods, and mock data — in a single file. Pass it to ant generate api with --json to generate all layers at once.

Minimal valid spec

This creates a single GET /health endpoint with a placeholder response.

Full spec structure

Fields

project (optional)

routes (required)

A map of route names to route configurations. Each key becomes a Flask Blueprint registered at /<route_name>.

Route configuration

Subroute configuration

Mock data

Mock data can be any valid JSON value:
If mock is omitted:
  • GET routes return: "Your <name> route is working!"
  • POST subroutes return: "Successfully created <subroute> for <route> with data: {data}"

Full example

This generates:

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
HTTP methods:
  • GET, POST, PUT, DELETE only (case-insensitive)
  • PATCH, HEAD, OPTIONS are not supported

Validation errors

All validation errors are self-descriptive:
Multiple errors are collected and returned together. Use --dry-run to validate without generating files: