forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #823
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?
Background
The frontend API client is hand-written and can drift from the actual FastAPI schema. Any new endpoint or changed response shape requires manual updates to both the backend and frontend.
What to do
openapi-typescript+openapi-fetch, ororval)generate:apiscript inpackage.jsonthat fetches the OpenAPI spec from the running backend (or from the exported JSON) and regenerates the clientAcceptance criteria
pnpm generate:apiregenerates the TypeScript client from the current OpenAPI specReferences
Roadmap item: P3 -- OpenAPI client generation
This issue has already been resolved and merged into main via PR #63 (feat: add OpenAPI TypeScript client generation setup) and PR #443 (Generate TypeScript API client from OpenAPI spec). Closing as completed.
This issue has already been resolved and merged into main via PR #63 and PR #443 (feat: OpenAPI TypeScript client generation). Closing as completed.