forked from 0xWheatyz/SPARC
Feature: auto-generate TypeScript API client from FastAPI OpenAPI spec #897
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 TypeScript frontend manually maintains API call code. Auto-generating the client from the FastAPI OpenAPI spec would keep frontend types in sync automatically.
Roadmap reference: P3 - OpenAPI client generation
What to do
openapi-typescript-codegenoropenapi-generator(TypeScript-fetch target).generate:apinpm script that fetches the OpenAPI spec fromhttp://localhost:8000/openapi.jsonand generates a typed client intosrc/api/generated/.fetch/axioscalls in the frontend with the generated client.Acceptance criteria
npm run generate:apiproduces a typed TypeScript client.This issue has been resolved. The changes are already merged into main.
TypeScript API client auto-generation set up with OpenAPI spec. CI freshness check added.
Closing as completed.