forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #707
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
Roadmap item: P3 - OpenAPI client generation
The frontend TypeScript API client is maintained manually. When backend types change, the frontend types drift until someone notices a runtime error.
Work to do
openapi-typescript(ororval) as a dev dependency in the frontendgenerate:apithat fetches the OpenAPI spec from the running backend (or from a savedopenapi.json) and generates a typed clientsrc/api/generated/and commit itAcceptance criteria
npm run generate:apiproduces a typed client that matches the live backend specClosing as already implemented. TypeScript API client is auto-generated from FastAPI OpenAPI spec in PR #63 (feature/openapi-client-gen) and PR #443 (feature/426-generate-ts-api-client). See frontend/src/api/.