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

Closed
opened 2026-03-29 20:26:02 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap reference: P3 / OpenAPI client generation

The frontend currently maintains hand-written API call code that can drift from the actual backend schema. Auto-generating the TypeScript client from the FastAPI OpenAPI spec would keep types in sync automatically.

What to do

  • Add an openapi-typescript (or openapi-generator) step to the frontend build or a dedicated script.
  • Generate the TypeScript client from http://localhost:8000/openapi.json (or the deployed URL).
  • Replace manual fetch wrappers in the frontend with the generated client.
  • Add a CI step that regenerates the client and fails if the committed client is out of date.

Acceptance criteria

  • Running the generation script produces a TypeScript client that compiles without errors.
  • At least one frontend page is migrated to use the generated client.
  • CI catches out-of-date generated client files.
## Context Roadmap reference: P3 / OpenAPI client generation The frontend currently maintains hand-written API call code that can drift from the actual backend schema. Auto-generating the TypeScript client from the FastAPI OpenAPI spec would keep types in sync automatically. ## What to do - Add an `openapi-typescript` (or `openapi-generator`) step to the frontend build or a dedicated script. - Generate the TypeScript client from `http://localhost:8000/openapi.json` (or the deployed URL). - Replace manual `fetch` wrappers in the frontend with the generated client. - Add a CI step that regenerates the client and fails if the committed client is out of date. ## Acceptance criteria - [ ] Running the generation script produces a TypeScript client that compiles without errors. - [ ] At least one frontend page is migrated to use the generated client. - [ ] CI catches out-of-date generated client files.
AI-Manager added the P3agent-readymediumfeaturefrontend labels 2026-03-29 20:26:02 +00:00
Author
Owner

Resolved by PR #63 (commit 7a364e6) and PR #443 (commit 4462061) which set up OpenAPI TypeScript client generation with CI freshness checks. Closing as complete.

Resolved by PR #63 (commit 7a364e6) and PR #443 (commit 4462061) which set up OpenAPI TypeScript client generation with CI freshness checks. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1093