forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #91
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 TypeScript API client is maintained manually, leading to drift from the backend API contract. Auto-generating it from the FastAPI OpenAPI spec would keep types in sync automatically.
Work
/openapi.json).openapi-typescriptoropenapi-generatorto generate a typed client from the spec.generate-clientscript topackage.jsonthat fetches the spec and regenerates the client.Acceptance Criteria
npm run generate-clientproduces a type-safe API client.References
Roadmap: P3 — OpenAPI client generation.
Resolved. OpenAPI TypeScript client auto-generation set up using
openapi-typescript. Thenpm run generatescript produces typed API schema. Implemented in PR #63 (merged). Seefrontend/package.jsonandfrontend/src/api/.