forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #682
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
Frontend API types are maintained by hand and drift from the backend schema over time. Auto-generating the client from the FastAPI OpenAPI spec would eliminate this drift.
What to do
openapi-typescriptor@hey-api/openapi-ts(or equivalent).frontend/src/api/(or similar).generate:apiscript topackage.jsonthat fetches the spec from the running backend and regenerates the client.Acceptance criteria
npm run generate:apiproduces an up-to-date TypeScript client.References
Roadmap item: P3 — OpenAPI client generation.
Triage: Already implemented
This issue has been fully addressed in the fork main branch.
Verification:
frontend/src/api/schema.d.tscontains the auto-generated TypeScript API client from the FastAPI OpenAPI spec.npm run generate:local+ git diff check intest.yamllines 43-51).Closing.