forked from 0xWheatyz/SPARC
Auto-generate TypeScript API client from FastAPI OpenAPI spec #1283
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
The frontend manually defines types and fetch calls that mirror the FastAPI schema. These drift silently when the backend changes, causing runtime errors that are only caught during QA.
Roadmap reference: P3 - OpenAPI client generation
What to do
openapi-typescriptoropenapi-generator-cliscript to the frontend that generates a typed client from the FastAPIs/openapi.jsonendpoint.Acceptance criteria
npm run generate-api(or equivalent) produces a typed client infrontend/src/api/generated/.Triage: Already Implemented
TypeScript API client generation is fully implemented on
main:frontend/package.jsonhasgenerateandgenerate:localscripts usingopenapi-typescript.frontend/src/api/schema.d.tsis auto-generated from the FastAPI OpenAPI spec.test.yamlrunsnpm run generate:localand fails ifschema.d.tshas changed.Closing as completed.