DX: auto-generate TypeScript API client from FastAPI OpenAPI spec #268

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

Background

The frontend TypeScript types are maintained by hand and can drift from the actual FastAPI schema. Auto-generating the client from the OpenAPI spec would keep them in sync automatically.

Task

  1. Add an openapi-ts (or openapi-generator-cli) code generation step
  2. Configure it to fetch the OpenAPI spec from the running FastAPI app (or from the exported openapi.json)
  3. Add a pnpm run generate-client (or similar) script that regenerates the TypeScript client
  4. Replace manual API call functions in the frontend with the generated client
  5. Add the generation step to CI (with a check that the committed client is up to date)

Acceptance Criteria

  • Running pnpm run generate-client produces a valid TypeScript client
  • The generated client is committed to the repo (or generated at build time)
  • CI fails if the spec changes but the client is not regenerated
  • At least one frontend page uses the generated client instead of manual fetch calls

Reference

Roadmap: P3 — OpenAPI client generation

## Background The frontend TypeScript types are maintained by hand and can drift from the actual FastAPI schema. Auto-generating the client from the OpenAPI spec would keep them in sync automatically. ## Task 1. Add an `openapi-ts` (or `openapi-generator-cli`) code generation step 2. Configure it to fetch the OpenAPI spec from the running FastAPI app (or from the exported `openapi.json`) 3. Add a `pnpm run generate-client` (or similar) script that regenerates the TypeScript client 4. Replace manual API call functions in the frontend with the generated client 5. Add the generation step to CI (with a check that the committed client is up to date) ## Acceptance Criteria - [ ] Running `pnpm run generate-client` produces a valid TypeScript client - [ ] The generated client is committed to the repo (or generated at build time) - [ ] CI fails if the spec changes but the client is not regenerated - [ ] At least one frontend page uses the generated client instead of manual fetch calls ## Reference Roadmap: P3 — OpenAPI client generation
AI-Manager added the P3agent-readymedium labels 2026-03-27 09:25:30 +00:00
Author
Owner

Triage: P3 - Deferred to future sprint. Will be prioritized after P1/P2 work is complete.

**Triage**: P3 - Deferred to future sprint. Will be prioritized after P1/P2 work is complete.
Author
Owner

Triage update: P3 — deferred to future sprint. All P1 issues are now resolved. Remaining P2 issues (#253, #256, #257, #260) take priority before P3 work begins.

**Triage update**: P3 — deferred to future sprint. All P1 issues are now resolved. Remaining P2 issues (#253, #256, #257, #260) take priority before P3 work begins.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#268