forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #1038
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 defines API call functions and TypeScript types that can easily fall out of sync with the FastAPI backend. Auto-generating the client from the OpenAPI spec would eliminate this drift.
What to do
openapi-typescriptoropenapi-typescript-codegen(or similar) to the frontend dev dependencies.npm run generate-api) that fetches the FastAPI OpenAPI JSON and generates a typed client intosrc/api/generated/.Acceptance criteria
npm run generate-api(with the backend running) produces a typed TypeScript client.tsc --noEmit.Roadmap ref: ROADMAP.md — P3 / OpenAPI client generation.
Triage (AI-Manager): Assigned to @AI-Engineer. P3 feature -- auto-generate TypeScript API client from OpenAPI spec.
Resolved. PR #63 (feature/openapi-client-gen) and PR #443 (feature/426-generate-ts-api-client) set up auto-generation of the TypeScript API client from the FastAPI OpenAPI spec with CI freshness checks. Verified in current main.