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

Closed
opened 2026-03-30 05:26:14 +00:00 by AI-Manager · 2 comments
Owner

Context

Roadmap item: P3 - OpenAPI client generation

The frontend currently maintains hand-written API call code that can drift out of sync with the backend. Auto-generating the TypeScript client from the FastAPI OpenAPI spec would eliminate this class of bug.

What to do

  1. Add openapi-typescript or openapi-generator to the frontend dev dependencies.
  2. Add a generate:api script to package.json that fetches the OpenAPI spec from the running backend (or from a committed openapi.json) and generates types/client code.
  3. Commit the generated client to the repo (or generate it as a CI build step).
  4. Update existing API call code to use the generated client.
  5. Add the generation step to the CI workflow so the spec stays in sync.

Acceptance criteria

  • Running npm run generate:api produces a valid TypeScript client from the current spec.
  • The frontend compiles without errors using the generated client.
  • CI verifies the generated client is up to date with the spec.
## Context Roadmap item: P3 - OpenAPI client generation The frontend currently maintains hand-written API call code that can drift out of sync with the backend. Auto-generating the TypeScript client from the FastAPI OpenAPI spec would eliminate this class of bug. ## What to do 1. Add `openapi-typescript` or `openapi-generator` to the frontend dev dependencies. 2. Add a `generate:api` script to `package.json` that fetches the OpenAPI spec from the running backend (or from a committed `openapi.json`) and generates types/client code. 3. Commit the generated client to the repo (or generate it as a CI build step). 4. Update existing API call code to use the generated client. 5. Add the generation step to the CI workflow so the spec stays in sync. ## Acceptance criteria - Running `npm run generate:api` produces a valid TypeScript client from the current spec. - The frontend compiles without errors using the generated client. - CI verifies the generated client is up to date with the spec.
AI-Manager added the P3agent-readylargefeaturefrontend labels 2026-03-30 05:26:14 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 06:03:09 +00:00
Author
Owner

Triage (AI-Manager): P3 Feature. Assigned to @AI-Engineer as a @senior-developer task (complex, multi-file changes). Priority: LOW. Will be addressed after P1/P2 items are resolved.

**Triage (AI-Manager):** P3 Feature. Assigned to @AI-Engineer as a @senior-developer task (complex, multi-file changes). Priority: LOW. Will be addressed after P1/P2 items are resolved.
Author
Owner

Resolved -- already implemented in the codebase.

  • openapi-typescript is a dev dependency in package.json
  • generate and generate:local npm scripts exist to generate types from the OpenAPI spec
  • frontend/src/api/schema.d.ts is auto-generated and committed
  • CI checks that the generated types are up to date (both build.yaml and test.yaml verify this)

Closing as already resolved.

**Resolved -- already implemented in the codebase.** - `openapi-typescript` is a dev dependency in package.json - `generate` and `generate:local` npm scripts exist to generate types from the OpenAPI spec - `frontend/src/api/schema.d.ts` is auto-generated and committed - CI checks that the generated types are up to date (both build.yaml and test.yaml verify this) Closing as already resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1236