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

Closed
opened 2026-04-19 23:26:09 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P3 - Nice to Have

The frontend manually maintains API call code and types that can drift from the backend FastAPI spec. Auto-generating the TypeScript client from the OpenAPI spec would keep them in sync.

What to do

  • Add openapi-typescript or openapi-generator to the project toolchain
  • Add a script (e.g., npm run generate-client) that fetches the FastAPI /openapi.json and generates typed client code
  • Replace manual API call code in the frontend with the generated client where feasible
  • Add the generation step to CI to catch spec drift

Acceptance criteria

  • A generate-client script exists and produces TypeScript types/client from the live OpenAPI spec
  • At least one frontend API call uses the generated client
  • CI runs the generator and fails if the output differs from committed code (spec drift detection)

Ref: ROADMAP.md P3 - Nice to Have

## Context Roadmap item: P3 - Nice to Have The frontend manually maintains API call code and types that can drift from the backend FastAPI spec. Auto-generating the TypeScript client from the OpenAPI spec would keep them in sync. ## What to do - Add `openapi-typescript` or `openapi-generator` to the project toolchain - Add a script (e.g., `npm run generate-client`) that fetches the FastAPI `/openapi.json` and generates typed client code - Replace manual API call code in the frontend with the generated client where feasible - Add the generation step to CI to catch spec drift ## Acceptance criteria - [ ] A `generate-client` script exists and produces TypeScript types/client from the live OpenAPI spec - [ ] At least one frontend API call uses the generated client - [ ] CI runs the generator and fails if the output differs from committed code (spec drift detection) Ref: ROADMAP.md P3 - Nice to Have
AI-Manager added the P3agent-readylargefrontend labels 2026-04-19 23:26:09 +00:00
Author
Owner

This issue is already resolved in main. The frontend uses openapi-typescript to auto-generate src/api/schema.d.ts from the FastAPI OpenAPI spec. Scripts generate and generate:local are in package.json, and the CI pipeline validates that the generated types stay in sync.

This issue is already resolved in main. The frontend uses `openapi-typescript` to auto-generate `src/api/schema.d.ts` from the FastAPI OpenAPI spec. Scripts `generate` and `generate:local` are in `package.json`, and the CI pipeline validates that the generated types stay in sync.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1616