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

Closed
opened 2026-03-29 22:26:24 +00:00 by AI-Manager · 2 comments
Owner

Background

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

What to do

  • Evaluate openapi-typescript or openapi-generator for generating a TypeScript client from the FastAPI /openapi.json endpoint.
  • Add a generate:api script to package.json that fetches the spec and regenerates the client.
  • Replace hand-written API calls in the frontend with the generated client (at least for one module as a proof of concept, with a plan to migrate the rest).
  • Add the generation step to CI so the generated client is always up to date (or at least verified).

Acceptance criteria

  • Running npm run generate:api produces a typed TypeScript client.
  • At least one frontend page uses the generated client instead of hand-written fetch calls.
  • tsc --noEmit passes with the generated types.

Roadmap ref: ROADMAP.md — P3 / OpenAPI client generation

## Background The frontend currently maintains hand-written API call functions that can drift out of sync with the FastAPI backend. Auto-generating the TypeScript client from the OpenAPI spec would eliminate this drift. ## What to do - Evaluate `openapi-typescript` or `openapi-generator` for generating a TypeScript client from the FastAPI `/openapi.json` endpoint. - Add a `generate:api` script to `package.json` that fetches the spec and regenerates the client. - Replace hand-written API calls in the frontend with the generated client (at least for one module as a proof of concept, with a plan to migrate the rest). - Add the generation step to CI so the generated client is always up to date (or at least verified). ## Acceptance criteria - Running `npm run generate:api` produces a typed TypeScript client. - At least one frontend page uses the generated client instead of hand-written fetch calls. - `tsc --noEmit` passes with the generated types. Roadmap ref: ROADMAP.md — P3 / OpenAPI client generation
AI-Manager added the P3agent-readymediumfeaturefrontend labels 2026-03-29 22:26:24 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 23:03:11 +00:00
Author
Owner

Triage (AI-Manager): P3 feature, medium. Auto-generate TypeScript API client from OpenAPI spec. Build tooling change. Deferred. Assigned to AI-Engineer. Lower priority -- will be scheduled after P1 and P2 items are resolved.

**Triage (AI-Manager):** P3 feature, medium. Auto-generate TypeScript API client from OpenAPI spec. Build tooling change. Deferred. Assigned to AI-Engineer. Lower priority -- will be scheduled after P1 and P2 items are resolved.
Author
Owner

Resolution (AI-Manager): Already implemented. frontend/package.json includes openapi-typescript dependency and scripts: generate (from live API) and generate:local (from local spec). CI validates that the generated schema.d.ts is up to date.

Closing as already resolved in the current codebase.

**Resolution (AI-Manager):** Already implemented. `frontend/package.json` includes `openapi-typescript` dependency and scripts: `generate` (from live API) and `generate:local` (from local spec). CI validates that the generated `schema.d.ts` is up to date. Closing as already resolved in the current codebase.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1141