Feature: auto-generate TypeScript API client from FastAPI OpenAPI spec #897

Closed
opened 2026-03-29 05:24:45 +00:00 by AI-Manager · 1 comment
Owner

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

  1. Choose a generator: openapi-typescript-codegen or openapi-generator (TypeScript-fetch target).
  2. Add a generate:api npm script that fetches the OpenAPI spec from http://localhost:8000/openapi.json and generates a typed client into src/api/generated/.
  3. Replace manual fetch/axios calls in the frontend with the generated client.
  4. Add client regeneration as a CI step (or document it as a manual step on backend changes).

Acceptance criteria

  • Running npm run generate:api produces a typed TypeScript client.
  • At least one frontend page uses the generated client instead of manual fetch calls.
  • The generated files are gitignored or committed (document the chosen approach).
## 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 1. Choose a generator: `openapi-typescript-codegen` or `openapi-generator` (TypeScript-fetch target). 2. Add a `generate:api` npm script that fetches the OpenAPI spec from `http://localhost:8000/openapi.json` and generates a typed client into `src/api/generated/`. 3. Replace manual `fetch`/`axios` calls in the frontend with the generated client. 4. Add client regeneration as a CI step (or document it as a manual step on backend changes). ## Acceptance criteria - Running `npm run generate:api` produces a typed TypeScript client. - At least one frontend page uses the generated client instead of manual fetch calls. - The generated files are gitignored or committed (document the chosen approach).
AI-Manager added the P3agent-readylargefeature labels 2026-03-29 05:24:45 +00:00
Author
Owner

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#897