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

Closed
opened 2026-03-26 18:25:00 +00:00 by AI-Manager · 2 comments
Owner

Context

The frontend hand-writes API call logic that must be kept in sync with the FastAPI backend manually. Generating the TypeScript client from the OpenAPI spec eliminates this drift.

Work

  • Add a code generation step using openapi-typescript or openapi-generator to produce a typed TypeScript client from GET /openapi.json.
  • Integrate the generation step into the frontend build or as a separate npm run gen-api script.
  • Replace manual API call wrappers in the frontend with the generated client.
  • Add the generation step to CI so the generated client is always up to date.

Acceptance Criteria

  • Running npm run gen-api produces a valid TypeScript client from the live OpenAPI spec.
  • The frontend compiles with zero TypeScript errors using the generated client.
  • CI fails if the generated client is out of date relative to the current backend spec.

References

Roadmap: P3 — OpenAPI client generation.

## Context The frontend hand-writes API call logic that must be kept in sync with the FastAPI backend manually. Generating the TypeScript client from the OpenAPI spec eliminates this drift. ## Work - Add a code generation step using `openapi-typescript` or `openapi-generator` to produce a typed TypeScript client from `GET /openapi.json`. - Integrate the generation step into the frontend build or as a separate `npm run gen-api` script. - Replace manual API call wrappers in the frontend with the generated client. - Add the generation step to CI so the generated client is always up to date. ## Acceptance Criteria - Running `npm run gen-api` produces a valid TypeScript client from the live OpenAPI spec. - The frontend compiles with zero TypeScript errors using the generated client. - CI fails if the generated client is out of date relative to the current backend spec. ## References Roadmap: P3 — OpenAPI client generation.
AI-Manager added the P3agent-readymedium labels 2026-03-26 18:25:00 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-26 19:03:13 +00:00
Author
Owner

Triage (AI-Manager)

Priority: P3 | Size: Medium | Agent: @developer

Execution order: Wave 3 -- After API stabilizes in Wave 1-2.

Dependencies: Benefits from API changes in Wave 1-2 being complete.

Scope: Add openapi-typescript code generation, npm run gen-api script, replace manual API wrappers.

## Triage (AI-Manager) **Priority:** P3 | **Size:** Medium | **Agent:** @developer **Execution order:** Wave 3 -- After API stabilizes in Wave 1-2. **Dependencies:** Benefits from API changes in Wave 1-2 being complete. **Scope:** Add openapi-typescript code generation, npm run gen-api script, replace manual API wrappers.
Author
Owner

Closing: already implemented on main. The feature/openapi-client-gen branch was merged. frontend/src/api/client.ts contains the auto-generated TypeScript API client.

Closing: already implemented on main. The feature/openapi-client-gen branch was merged. frontend/src/api/client.ts contains the auto-generated TypeScript API client.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#168