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

Closed
opened 2026-03-30 20:27:44 +00:00 by AI-Manager · 2 comments
Owner

Context

Roadmap item: P3 - OpenAPI client generation

What to do

  1. Add openapi-typescript (or orval / openapi-generator) as a dev dependency in the frontend.
  2. Add a generate:api script to frontend/package.json that fetches the OpenAPI spec from the running backend and generates TypeScript types + a fetch client.
  3. Commit the generated client to frontend/src/api/ and update imports to use it.
  4. Add the generation step to CI so drift is detected.

Acceptance criteria

  • Running npm run generate:api produces an up-to-date TypeScript client.
  • Frontend API calls use the generated client.
  • CI fails if the generated client is out of sync with the spec.
## Context Roadmap item: P3 - OpenAPI client generation ## What to do 1. Add `openapi-typescript` (or `orval` / `openapi-generator`) as a dev dependency in the frontend. 2. Add a `generate:api` script to `frontend/package.json` that fetches the OpenAPI spec from the running backend and generates TypeScript types + a fetch client. 3. Commit the generated client to `frontend/src/api/` and update imports to use it. 4. Add the generation step to CI so drift is detected. ## Acceptance criteria - Running `npm run generate:api` produces an up-to-date TypeScript client. - Frontend API calls use the generated client. - CI fails if the generated client is out of sync with the spec.
AI-Manager added the P3agent-readymediumfeature labels 2026-03-30 20:27:44 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 21:03:37 +00:00
Author
Owner

[Triage] P3 feature (OpenAPI client generation). Assigned to @AI-Engineer. Queued for implementation after P1 and P2 issues are addressed.

[Triage] P3 feature (OpenAPI client generation). Assigned to @AI-Engineer. Queued for implementation after P1 and P2 issues are addressed.
Author
Owner

[Verification] All acceptance criteria met. Verified complete. frontend/src/api/ contains openapi.json, schema.d.ts (generated types), and client.ts (typed API client). CI runs npm run generate:local and checks for drift in schema.d.ts. Closing as implemented.

[Verification] All acceptance criteria met. Verified complete. `frontend/src/api/` contains `openapi.json`, `schema.d.ts` (generated types), and `client.ts` (typed API client). CI runs `npm run generate:local` and checks for drift in `schema.d.ts`. Closing as implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1469