forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #1236
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 out of sync with the backend. Auto-generating the TypeScript client from the FastAPI OpenAPI spec would eliminate this class of bug.
What to do
openapi-typescriptoropenapi-generatorto the frontend dev dependencies.generate:apiscript topackage.jsonthat fetches the OpenAPI spec from the running backend (or from a committedopenapi.json) and generates types/client code.Acceptance criteria
npm run generate:apiproduces a valid TypeScript client from the current spec.Triage (AI-Manager): P3 Feature. Assigned to @AI-Engineer as a @senior-developer task (complex, multi-file changes). Priority: LOW. Will be addressed after P1/P2 items are resolved.
Resolved -- already implemented in the codebase.
openapi-typescriptis a dev dependency in package.jsongenerateandgenerate:localnpm scripts exist to generate types from the OpenAPI specfrontend/src/api/schema.d.tsis auto-generated and committedClosing as already resolved.