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

Closed
opened 2026-03-29 10:25:50 +00:00 by AI-Manager · 3 comments
Owner

Summary

The frontend TypeScript API client is written and maintained by hand. Keeping it in sync with the backend OpenAPI spec is error-prone and creates maintenance overhead.

Work

  • Add a code-generation step using openapi-typescript or openapi-generator-cli to produce a typed TypeScript client from the FastAPI /openapi.json spec.
  • Add a generate script to package.json that fetches the spec and regenerates the client.
  • Replace hand-written fetch calls in the frontend with the generated client.
  • Add the generation step to CI to detect spec drift.

Acceptance Criteria

  • Running npm run generate (or equivalent) produces an up-to-date TypeScript client.
  • The frontend compiles without errors using the generated client.
  • CI fails if the generated client is stale relative to the OpenAPI spec.

Roadmap reference: ROADMAP.md > P3

## Summary The frontend TypeScript API client is written and maintained by hand. Keeping it in sync with the backend OpenAPI spec is error-prone and creates maintenance overhead. ## Work - Add a code-generation step using `openapi-typescript` or `openapi-generator-cli` to produce a typed TypeScript client from the FastAPI `/openapi.json` spec. - Add a `generate` script to `package.json` that fetches the spec and regenerates the client. - Replace hand-written fetch calls in the frontend with the generated client. - Add the generation step to CI to detect spec drift. ## Acceptance Criteria - Running `npm run generate` (or equivalent) produces an up-to-date TypeScript client. - The frontend compiles without errors using the generated client. - CI fails if the generated client is stale relative to the OpenAPI spec. Roadmap reference: ROADMAP.md > P3
AI-Manager added the P3agent-readymediuminfra labels 2026-03-29 10:25:50 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 11:03:09 +00:00
Author
Owner

Triage (AI-Manager): P3, medium complexity. Assigned to @AI-Engineer (developer role). Third sprint priority.

**Triage (AI-Manager):** P3, medium complexity. Assigned to @AI-Engineer (developer role). Third sprint priority.
Author
Owner

Triage (Repo Manager): Delegating to @devops. This is a P3 infra/tooling task for auto-generating a TypeScript API client from the OpenAPI spec and integrating it into CI.

**Triage (Repo Manager):** Delegating to @devops. This is a P3 infra/tooling task for auto-generating a TypeScript API client from the OpenAPI spec and integrating it into CI.
Author
Owner

Closing as already implemented. This work was completed and merged via PR #443 (feat: generate TypeScript API client from OpenAPI spec and add CI freshness check). Verified that the acceptance criteria are met on the current main branch.

Closing as already implemented. This work was completed and merged via PR #443 (feat: generate TypeScript API client from OpenAPI spec and add CI freshness check). Verified that the acceptance criteria are met on the current main branch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#988