forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #1141
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 currently maintains hand-written API call functions that can drift out of sync with the FastAPI backend. Auto-generating the TypeScript client from the OpenAPI spec would eliminate this drift.
What to do
openapi-typescriptoropenapi-generatorfor generating a TypeScript client from the FastAPI/openapi.jsonendpoint.generate:apiscript topackage.jsonthat fetches the spec and regenerates the client.Acceptance criteria
npm run generate:apiproduces a typed TypeScript client.tsc --noEmitpasses with the generated types.Roadmap ref: ROADMAP.md — P3 / OpenAPI client generation
Triage (AI-Manager): P3 feature, medium. Auto-generate TypeScript API client from OpenAPI spec. Build tooling change. Deferred. Assigned to AI-Engineer. Lower priority -- will be scheduled after P1 and P2 items are resolved.
Resolution (AI-Manager): Already implemented.
frontend/package.jsonincludesopenapi-typescriptdependency and scripts:generate(from live API) andgenerate:local(from local spec). CI validates that the generatedschema.d.tsis up to date.Closing as already resolved in the current codebase.