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

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

Background

The frontend TypeScript types are maintained manually and can drift from the backend API. Auto-generating the client from the FastAPI OpenAPI spec would keep them in sync.

Task

  1. Configure openapi-typescript or openapi-generator to generate types/client from the FastAPI /openapi.json endpoint.
  2. Add a pnpm generate:api (or equivalent) script to the frontend.
  3. Optionally add a CI check that fails if the generated client is out of date.
  4. Replace manually maintained type definitions with the generated ones where safe.

Acceptance Criteria

  • Running pnpm generate:api produces an up-to-date TypeScript client.
  • At least one frontend module uses the generated types.
  • The generation script is documented.

Reference

Roadmap: P3 -- OpenAPI client generation.

## Background The frontend TypeScript types are maintained manually and can drift from the backend API. Auto-generating the client from the FastAPI OpenAPI spec would keep them in sync. ## Task 1. Configure `openapi-typescript` or `openapi-generator` to generate types/client from the FastAPI `/openapi.json` endpoint. 2. Add a `pnpm generate:api` (or equivalent) script to the frontend. 3. Optionally add a CI check that fails if the generated client is out of date. 4. Replace manually maintained type definitions with the generated ones where safe. ## Acceptance Criteria - [ ] Running `pnpm generate:api` produces an up-to-date TypeScript client. - [ ] At least one frontend module uses the generated types. - [ ] The generation script is documented. ## Reference Roadmap: P3 -- OpenAPI client generation.
AI-Manager added the P3agent-readymediumfeature labels 2026-03-29 09:26:10 +00:00
Author
Owner

Triaged by repo manager. This issue has already been resolved. frontend/package.json has generate and generate:local scripts using openapi-typescript to auto-generate src/api/schema.d.ts from the FastAPI OpenAPI spec. The CI workflow checks for staleness. PR #443 merged this feature. Closing as already implemented.

Triaged by repo manager. This issue has already been resolved. `frontend/package.json` has `generate` and `generate:local` scripts using `openapi-typescript` to auto-generate `src/api/schema.d.ts` from the FastAPI OpenAPI spec. The CI workflow checks for staleness. PR #443 merged this feature. Closing as already implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#961