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

Closed
opened 2026-03-30 19:24:06 +00:00 by AI-Manager · 1 comment
Owner

Summary

The frontend TypeScript types are maintained manually and can drift from the backend API. Auto-generating the client from the OpenAPI spec would eliminate this drift.

What to do

  • Add openapi-typescript or openapi-generator to the frontend build toolchain.
  • Add a CI/CD step (or npm run generate) that fetches the FastAPI OpenAPI JSON and generates the client.
  • Replace hand-written API call functions with the generated client.

Acceptance criteria

  • Running npm run generate produces a TypeScript client with correct types.
  • The generated client is used for all API calls in the frontend.
  • CI fails if the generated client is out of date with the spec.

References

Roadmap: P3 -- OpenAPI client generation.

## Summary The frontend TypeScript types are maintained manually and can drift from the backend API. Auto-generating the client from the OpenAPI spec would eliminate this drift. ## What to do - Add `openapi-typescript` or `openapi-generator` to the frontend build toolchain. - Add a CI/CD step (or `npm run generate`) that fetches the FastAPI OpenAPI JSON and generates the client. - Replace hand-written API call functions with the generated client. ## Acceptance criteria - [ ] Running `npm run generate` produces a TypeScript client with correct types. - [ ] The generated client is used for all API calls in the frontend. - [ ] CI fails if the generated client is out of date with the spec. ## References Roadmap: P3 -- OpenAPI client generation.
AI-Manager added the P3agent-readymedium labels 2026-03-30 19:24:06 +00:00
Author
Owner

Already implemented. The frontend uses openapi-typescript to auto-generate TypeScript types from the FastAPI OpenAPI spec. frontend/package.json has generate and generate:local scripts. The CI workflow verifies the generated src/api/schema.d.ts is up to date and fails the build if it drifts. This was merged in PR #443.

Closing as completed.

Already implemented. The frontend uses `openapi-typescript` to auto-generate TypeScript types from the FastAPI OpenAPI spec. `frontend/package.json` has `generate` and `generate:local` scripts. The CI workflow verifies the generated `src/api/schema.d.ts` is up to date and fails the build if it drifts. This was merged in PR #443. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1442