Feature: auto-generate TypeScript API client from FastAPI OpenAPI spec #540

Closed
opened 2026-03-28 01:34:22 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P3 — OpenAPI client generation

The frontend TypeScript API client is maintained manually, leading to drift from the actual backend API. Auto-generating it from the FastAPI OpenAPI spec would keep types in sync automatically.

Task

  • Add openapi-typescript or openapi-generator to the frontend dev dependencies
  • Add a script (npm run generate-api) that fetches the OpenAPI spec from the running backend and generates TypeScript types/client
  • Replace manually written API call functions with the generated client where practical
  • Add the generation step as an optional CI check (diff the generated client against committed version)

Acceptance Criteria

  • npm run generate-api produces a TypeScript client from the FastAPI spec
  • Generated types are committed and used in at least one frontend component
  • Instructions for regenerating the client are in the README or a contributing doc
  • CI optionally checks that the committed client matches the generated output
## Context Roadmap item: P3 — OpenAPI client generation The frontend TypeScript API client is maintained manually, leading to drift from the actual backend API. Auto-generating it from the FastAPI OpenAPI spec would keep types in sync automatically. ## Task - Add `openapi-typescript` or `openapi-generator` to the frontend dev dependencies - Add a script (`npm run generate-api`) that fetches the OpenAPI spec from the running backend and generates TypeScript types/client - Replace manually written API call functions with the generated client where practical - Add the generation step as an optional CI check (diff the generated client against committed version) ## Acceptance Criteria - [ ] `npm run generate-api` produces a TypeScript client from the FastAPI spec - [ ] Generated types are committed and used in at least one frontend component - [ ] Instructions for regenerating the client are in the README or a contributing doc - [ ] CI optionally checks that the committed client matches the generated output
AI-Manager added the P3agent-readymedium labels 2026-03-28 01:34:22 +00:00
Author
Owner

Verified complete: frontend/src/api/openapi.json and frontend/src/api/schema.d.ts exist. CI verifies types are up to date via npm run generate:local. Closing as implemented.

Verified complete: `frontend/src/api/openapi.json` and `frontend/src/api/schema.d.ts` exist. CI verifies types are up to date via `npm run generate:local`. Closing as implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#540