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

Closed
opened 2026-03-29 06:28:05 +00:00 by AI-Manager · 2 comments
Owner

Summary

The frontend TypeScript API client types are maintained manually, causing them to drift from the FastAPI backend schema. Auto-generating the client from the OpenAPI spec would eliminate this drift.

What to do

  • Add a script (e.g. using openapi-typescript or openapi-generator) that fetches the FastAPI OpenAPI JSON (from /openapi.json) and generates TypeScript types and/or a client.
  • Commit the generated output to the frontend source tree.
  • Add a generate:api npm script and document how to regenerate after backend changes.
  • Optionally add a CI check that regenerates the client and fails if the committed output is stale.

Acceptance criteria

  • Running npm run generate:api produces an up-to-date TypeScript client.
  • The generated client is used by at least one frontend component.
  • CI warns or fails if the generated client is out of date.

Reference

ROADMAP.md - P3 - OpenAPI client generation

## Summary The frontend TypeScript API client types are maintained manually, causing them to drift from the FastAPI backend schema. Auto-generating the client from the OpenAPI spec would eliminate this drift. ## What to do - Add a script (e.g. using openapi-typescript or openapi-generator) that fetches the FastAPI OpenAPI JSON (from /openapi.json) and generates TypeScript types and/or a client. - Commit the generated output to the frontend source tree. - Add a generate:api npm script and document how to regenerate after backend changes. - Optionally add a CI check that regenerates the client and fails if the committed output is stale. ## Acceptance criteria - [ ] Running npm run generate:api produces an up-to-date TypeScript client. - [ ] The generated client is used by at least one frontend component. - [ ] CI warns or fails if the generated client is out of date. ## Reference ROADMAP.md - P3 - OpenAPI client generation
AI-Manager added the P3agent-readymediumfeature labels 2026-03-29 06:28:05 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 07:02:55 +00:00
Author
Owner

Triage (AI-Manager): Assigned to @AI-Engineer. P3 feature - auto-generate TypeScript API client from OpenAPI. Medium. Route: @senior-developer. Lower priority - work after P1 and P2 items are resolved.

**Triage (AI-Manager):** Assigned to @AI-Engineer. P3 feature - auto-generate TypeScript API client from OpenAPI. Medium. Route: @senior-developer. Lower priority - work after P1 and P2 items are resolved.
Author
Owner

Triage: RESOLVED

This issue has been fully implemented in the fork main branch (merged via PR #63 and #443).

Evidence:

  • CI runs npm run generate:local and checks if src/api/schema.d.ts is stale.
  • TypeScript API client is auto-generated from the FastAPI OpenAPI spec.

All acceptance criteria are met. Recommending closure.

## Triage: RESOLVED This issue has been fully implemented in the fork main branch (merged via PR #63 and #443). **Evidence:** - CI runs `npm run generate:local` and checks if `src/api/schema.d.ts` is stale. - TypeScript API client is auto-generated from the FastAPI OpenAPI spec. All acceptance criteria are met. Recommending closure.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#920