forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #1117
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 currently has manually-maintained API call code. When backend types change, the frontend is not automatically updated, leading to drift. Auto-generating the client from the OpenAPI spec would keep both in sync.
What to do
openapi-typescript-codegen(or@hey-api/openapi-ts) as a dev dependency infrontend/.generate:apiscript tofrontend/package.jsonthat fetches the spec from the running backend and generates types.Acceptance criteria
npm run generate:apiregeneratesfrontend/src/api/without errors.Roadmap reference: P3 - OpenAPI client generation
This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.