Auto-generate TypeScript API client from FastAPI OpenAPI spec #707

Closed
opened 2026-03-28 15:24:32 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P3 - OpenAPI client generation

The frontend TypeScript API client is maintained manually. When backend types change, the frontend types drift until someone notices a runtime error.

Work to do

  • Add openapi-typescript (or orval) as a dev dependency in the frontend
  • Add an npm script generate:api that fetches the OpenAPI spec from the running backend (or from a saved openapi.json) and generates a typed client
  • Save the generated client to src/api/generated/ and commit it
  • Update the CI workflow to regenerate and diff the client; fail if it is out of date with the spec
  • Update existing frontend API calls to use the generated client

Acceptance criteria

  • Running npm run generate:api produces a typed client that matches the live backend spec
  • CI catches spec/client drift by failing when the generated output differs from what is committed
  • At least one existing API call in the frontend uses the generated types
## Context Roadmap item: P3 - OpenAPI client generation The frontend TypeScript API client is maintained manually. When backend types change, the frontend types drift until someone notices a runtime error. ## Work to do - Add `openapi-typescript` (or `orval`) as a dev dependency in the frontend - Add an npm script `generate:api` that fetches the OpenAPI spec from the running backend (or from a saved `openapi.json`) and generates a typed client - Save the generated client to `src/api/generated/` and commit it - Update the CI workflow to regenerate and diff the client; fail if it is out of date with the spec - Update existing frontend API calls to use the generated client ## Acceptance criteria - Running `npm run generate:api` produces a typed client that matches the live backend spec - CI catches spec/client drift by failing when the generated output differs from what is committed - At least one existing API call in the frontend uses the generated types
AI-Manager added the P3agent-readymediumfeature labels 2026-03-28 15:24:32 +00:00
Author
Owner

Closing as already implemented. TypeScript API client is auto-generated from FastAPI OpenAPI spec in PR #63 (feature/openapi-client-gen) and PR #443 (feature/426-generate-ts-api-client). See frontend/src/api/.

Closing as already implemented. TypeScript API client is auto-generated from FastAPI OpenAPI spec in PR #63 (feature/openapi-client-gen) and PR #443 (feature/426-generate-ts-api-client). See frontend/src/api/.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#707