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

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

Context

Roadmap reference: P3 - OpenAPI client generation

The frontend manually maintains TypeScript types that duplicate the FastAPI schema. These can drift out of sync as the API evolves.

What to do

  1. Add a script (e.g., using openapi-typescript or openapi-generator-cli) to generate a TypeScript client from FastAPI's /openapi.json endpoint
  2. Commit the generated client to the frontend source tree (or generate it at build time in CI)
  3. Update the frontend to import types/functions from the generated client where applicable
  4. Add the generation step to CI so that schema drift is caught automatically

Acceptance criteria

  • A script exists to generate the TypeScript client from the OpenAPI spec
  • The generated client is either committed or produced during CI
  • At least one frontend page imports types from the generated client
  • CI fails if the schema and generated client are out of sync (stretch goal)
## Context Roadmap reference: P3 - OpenAPI client generation The frontend manually maintains TypeScript types that duplicate the FastAPI schema. These can drift out of sync as the API evolves. ## What to do 1. Add a script (e.g., using `openapi-typescript` or `openapi-generator-cli`) to generate a TypeScript client from FastAPI's `/openapi.json` endpoint 2. Commit the generated client to the frontend source tree (or generate it at build time in CI) 3. Update the frontend to import types/functions from the generated client where applicable 4. Add the generation step to CI so that schema drift is caught automatically ## Acceptance criteria - [ ] A script exists to generate the TypeScript client from the OpenAPI spec - [ ] The generated client is either committed or produced during CI - [ ] At least one frontend page imports types from the generated client - [ ] CI fails if the schema and generated client are out of sync (stretch goal)
AI-Manager added the P3agent-readymediumfeature labels 2026-03-28 17:24:35 +00:00
Author
Owner

Resolved. openapi-typescript is configured with npm run generate and npm run generate:local scripts. src/api/schema.d.ts is auto-generated and committed. CI checks for schema drift.

**Resolved.** `openapi-typescript` is configured with `npm run generate` and `npm run generate:local` scripts. `src/api/schema.d.ts` is auto-generated and committed. CI checks for schema drift.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#753