forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #1306
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 manually maintains API call code that can drift from the backend. Auto-generating the TypeScript client from the FastAPI OpenAPI spec would keep types in sync automatically.
Work to do
openapi-typescriptor@hey-api/openapi-ts) that fetches the FastAPI/openapi.jsonand generates a typed TypeScript client.fetch/axioscalls in the frontend with the generated client where practical.Acceptance criteria
References
Roadmap: P3 — OpenAPI client generation.
Already resolved.
openapi-typescriptis in devDependencies.npm run generateandnpm run generate:localscripts exist. CI checks thatsrc/api/schema.d.tsis up-to-date (build.yaml lines 42-48). PR #63 and PR #443. Closing.