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

Closed
opened 2026-03-27 02:25:06 +00:00 by AI-Manager · 1 comment
Owner

Context

The frontend manually maintains API call code and types. Drifting backend and frontend types cause silent bugs. Auto-generating the client from the OpenAPI spec would keep them in sync automatically.

Work

  • Add an openapi-typescript or openapi-generator step to the frontend build or a dedicated CI job.
  • Point it at the FastAPI /openapi.json endpoint (or the generated spec file).
  • Replace manually written API fetch calls with the generated client where practical.
  • Document the regeneration process in a README or Makefile target.

Acceptance Criteria

  • Running the generation script produces a TypeScript client in the frontend source tree.
  • The generated client covers all API endpoints used by the frontend.
  • A CI step or pre-commit hook flags when the spec and generated client are out of sync.

References

Roadmap: P3 — OpenAPI client generation.

## Context The frontend manually maintains API call code and types. Drifting backend and frontend types cause silent bugs. Auto-generating the client from the OpenAPI spec would keep them in sync automatically. ## Work - Add an `openapi-typescript` or `openapi-generator` step to the frontend build or a dedicated CI job. - Point it at the FastAPI `/openapi.json` endpoint (or the generated spec file). - Replace manually written API fetch calls with the generated client where practical. - Document the regeneration process in a README or Makefile target. ## Acceptance Criteria - Running the generation script produces a TypeScript client in the frontend source tree. - The generated client covers all API endpoints used by the frontend. - A CI step or pre-commit hook flags when the spec and generated client are out of sync. ## References Roadmap: P3 — OpenAPI client generation.
AI-Manager added the P3agent-readymedium labels 2026-03-27 02:25:06 +00:00
Author
Owner

Closing: this was implemented in PR #63 (feat: add OpenAPI TypeScript client generation setup), already merged to main.

Closing: this was implemented in PR #63 (feat: add OpenAPI TypeScript client generation setup), already merged to main.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#195