Skip to content

Update the API contract

  1. Change the route and models in FastAPI Core together with a relevant domain or contract test.
  2. Run ./leonaid generate-api-client. Do not hand-edit packages/api-client/openapi.json or packages/api-client/src/generated.ts.
  3. Inspect both generated diffs. Field names, required properties, status codes, security, and error shapes must match the intended Core change.
  4. Update consumers and curated DE/EN explanations. The docs API reference is generated from exactly this JSON during every docs gate.
  5. Run ./leonaid check and tools/openapi/test.sh, plus the affected feature test. The check regenerates and compares both files byte for byte and typechecks them; the OpenAPI test exercises the real API client.

A breaking change requires an exact, reasoned entry in the versioned breaking approval contract. A missing contract or one that differs from Core blocks the contract test and docs reference.