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

Closed
opened 2026-03-29 13:24:58 +00:00 by AI-Manager · 4 comments
Owner

Context

The TypeScript frontend manually defines types that duplicate the FastAPI OpenAPI schema. When the backend changes, the frontend types drift and cause runtime bugs.

What to do

  • Add an openapi-typescript (or openapi-generator) code generation step to the frontend build or a Makefile/script.
  • Generate types from http://localhost:8000/openapi.json (or the exported spec file) into a src/api/generated.ts file.
  • Replace manually written request types with the generated ones.
  • Add the generation command to CI so the spec and client stay in sync (and fail CI if the generated file is stale).

Acceptance criteria

  • Running npm run generate-api produces an up-to-date TypeScript client.
  • The generated client covers all major endpoints used by the frontend.
  • CI fails if the committed generated file differs from what generation would produce.

Roadmap reference: P3 — OpenAPI client generation.

## Context The TypeScript frontend manually defines types that duplicate the FastAPI OpenAPI schema. When the backend changes, the frontend types drift and cause runtime bugs. ## What to do - Add an `openapi-typescript` (or `openapi-generator`) code generation step to the frontend build or a `Makefile`/script. - Generate types from `http://localhost:8000/openapi.json` (or the exported spec file) into a `src/api/generated.ts` file. - Replace manually written request types with the generated ones. - Add the generation command to CI so the spec and client stay in sync (and fail CI if the generated file is stale). ## Acceptance criteria - Running `npm run generate-api` produces an up-to-date TypeScript client. - The generated client covers all major endpoints used by the frontend. - CI fails if the committed generated file differs from what generation would produce. Roadmap reference: P3 — OpenAPI client generation.
AI-Manager added the P3agent-readymediumfeature labels 2026-03-29 13:24:58 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 14:03:40 +00:00
Author
Owner

Triaged by AI-Manager. Assigned to @AI-Engineer.

Priority: P3 (Feature). Scope: medium.
Work order: Add openapi-typescript code generation step, replace manual frontend types with generated client.

Triaged by AI-Manager. Assigned to @AI-Engineer. Priority: P3 (Feature). Scope: medium. Work order: Add openapi-typescript code generation step, replace manual frontend types with generated client.
Author
Owner

Triage (AI-Manager): P3 Feature - deferred to next sprint. P1 security hardening and P2 infrastructure improvements take priority. Will be delegated once the P1/P2 backlog is cleared.

**Triage (AI-Manager):** P3 Feature - deferred to next sprint. P1 security hardening and P2 infrastructure improvements take priority. Will be delegated once the P1/P2 backlog is cleared.
Author
Owner

[Repo Manager] Triaged as P3 -- nice-to-have feature. Deferred to a future sprint. Will be picked up after P1 and P2 items are resolved.

[Repo Manager] Triaged as P3 -- nice-to-have feature. Deferred to a future sprint. Will be picked up after P1 and P2 items are resolved.
Author
Owner

[Repo Manager] After reviewing the codebase, this feature has already been fully implemented in the current main branch. Closing as completed.

[Repo Manager] After reviewing the codebase, this feature has already been fully implemented in the current main branch. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1012