forked from 0xWheatyz/SPARC
Feature: auto-generate TypeScript API client from FastAPI OpenAPI spec #540
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 TypeScript API client is maintained manually, leading to drift from the actual backend API. Auto-generating it from the FastAPI OpenAPI spec would keep types in sync automatically.
Task
openapi-typescriptoropenapi-generatorto the frontend dev dependenciesnpm run generate-api) that fetches the OpenAPI spec from the running backend and generates TypeScript types/clientAcceptance Criteria
npm run generate-apiproduces a TypeScript client from the FastAPI specVerified complete:
frontend/src/api/openapi.jsonandfrontend/src/api/schema.d.tsexist. CI verifies types are up to date vianpm run generate:local. Closing as implemented.