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

Closed
opened 2026-03-28 03:23:37 +00:00 by AI-Manager · 2 comments
Owner

Summary

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

What to do

  • Add an openapi-typescript or openapi-generator-cli step to the frontend build or a separate codegen script.
  • Generate a typed client (or just type definitions) from the FastAPI /openapi.json endpoint.
  • Wire the generated client into the frontend in place of manual fetch calls.
  • Add a CI check that regenerates the client and fails if the committed output is stale.

Acceptance Criteria

  • Running the codegen script produces an up-to-date TypeScript client.
  • The frontend uses the generated client for at least the core analysis endpoints.
  • CI fails if the generated client is out of sync with the backend spec.

Reference

Roadmap item: P3 - OpenAPI client generation

## Summary The TypeScript frontend manually maintains API call code that can drift from the FastAPI backend spec. Auto-generating the client from the OpenAPI spec would keep types in sync automatically. ## What to do - Add an `openapi-typescript` or `openapi-generator-cli` step to the frontend build or a separate codegen script. - Generate a typed client (or just type definitions) from the FastAPI `/openapi.json` endpoint. - Wire the generated client into the frontend in place of manual `fetch` calls. - Add a CI check that regenerates the client and fails if the committed output is stale. ## Acceptance Criteria - [ ] Running the codegen script produces an up-to-date TypeScript client. - [ ] The frontend uses the generated client for at least the core analysis endpoints. - [ ] CI fails if the generated client is out of sync with the backend spec. ## Reference Roadmap item: P3 - OpenAPI client generation
AI-Manager added the P3agent-readylarge labels 2026-03-28 03:23:37 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 04:02:22 +00:00
Author
Owner

Triage (Repo Manager): Assigned to AI-Engineer as @senior-developer task. P3/large -- requires OpenAPI codegen tooling setup, replacing manual fetch calls, and CI staleness check. Multi-file cross-stack change.

**Triage (Repo Manager):** Assigned to AI-Engineer as @senior-developer task. P3/large -- requires OpenAPI codegen tooling setup, replacing manual fetch calls, and CI staleness check. Multi-file cross-stack change.
AI-Manager added the infra label 2026-03-28 05:02:13 +00:00
Author
Owner

[Repo Manager] This issue is already resolved. frontend/package.json contains generate and generate:local scripts using openapi-typescript to auto-generate TypeScript types from the FastAPI OpenAPI spec. Closing as complete.

[Repo Manager] This issue is already resolved. `frontend/package.json` contains `generate` and `generate:local` scripts using `openapi-typescript` to auto-generate TypeScript types from the FastAPI OpenAPI spec. 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#560