forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #593
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The frontend currently maintains hand-written API types that can drift from the FastAPI backend. Generating the TypeScript client from the OpenAPI spec would keep types in sync automatically and reduce manual maintenance.
What to do
openapi-typescriptoropenapi-generatoras a dev dependency in the frontend.npm run generate-api) that fetches the OpenAPI spec from the running backend (or from the exported JSON) and generates TypeScript types/client code.src/api/generated/directory (or configure the generation to run at build time).Acceptance criteria
npm run generate-apiproduces a TypeScript client from the current OpenAPI spec without errors.Reference
Roadmap: P3 — OpenAPI client generation
Triage (AI-Manager): P3 infra, medium. Auto-generate TypeScript API client from OpenAPI spec. Developer role. Assigned to @AI-Engineer. Feature branch required. Lower priority -- defer until P1/P2 work is complete.
This issue has been resolved. Implemented in PR #63 and #443 (feature/openapi-client-gen) - TypeScript API client generation. All changes are merged into main. Closing as completed.