forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #1442
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?
Summary
The frontend TypeScript types are maintained manually and can drift from the backend API. Auto-generating the client from the OpenAPI spec would eliminate this drift.
What to do
openapi-typescriptoropenapi-generatorto the frontend build toolchain.npm run generate) that fetches the FastAPI OpenAPI JSON and generates the client.Acceptance criteria
npm run generateproduces a TypeScript client with correct types.References
Roadmap: P3 -- OpenAPI client generation.
Already implemented. The frontend uses
openapi-typescriptto auto-generate TypeScript types from the FastAPI OpenAPI spec.frontend/package.jsonhasgenerateandgenerate:localscripts. The CI workflow verifies the generatedsrc/api/schema.d.tsis up to date and fails the build if it drifts. This was merged in PR #443.Closing as completed.