forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #961
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 TypeScript types are maintained manually and can drift from the backend API. Auto-generating the client from the FastAPI OpenAPI spec would keep them in sync.
Task
openapi-typescriptoropenapi-generatorto generate types/client from the FastAPI/openapi.jsonendpoint.pnpm generate:api(or equivalent) script to the frontend.Acceptance Criteria
pnpm generate:apiproduces an up-to-date TypeScript client.Reference
Roadmap: P3 -- OpenAPI client generation.
Triaged by repo manager. This issue has already been resolved.
frontend/package.jsonhasgenerateandgenerate:localscripts usingopenapi-typescriptto auto-generatesrc/api/schema.d.tsfrom the FastAPI OpenAPI spec. The CI workflow checks for staleness. PR #443 merged this feature. Closing as already implemented.