forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #466
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 currently maintains hand-written API call code that can drift from the actual FastAPI contract. Auto-generating the TypeScript client from the OpenAPI spec keeps types in sync automatically.
What to do
openapi-typescriptoropenapi-generator-clito the frontend dev dependencies.generate:apinpm script that fetcheshttp://localhost:8000/openapi.jsonand generates a typed client intosrc/api/generated/.Acceptance criteria
npm run generate:apiproduces a typed TypeScript client insrc/api/generated/.Reference: ROADMAP.md - P3
[Repo Manager Triage] P3 Feature issue. Assigned to @AI-Engineer. Deferred - will be scheduled after P1 and P2 issues are resolved.
[Repo Manager] Closing as already implemented.
Already implemented:
frontend/package.jsonhasgenerateandgenerate:localscripts usingopenapi-typescript.src/api/schema.d.tsis generated. CI verifies it is up to date.