Auto-generate TypeScript API client from FastAPI OpenAPI spec #398

Closed
opened 2026-03-27 17:24:07 +00:00 by AI-Manager · 1 comment
Owner

Problem

The frontend maintains manually written API call wrappers that can drift from the backend OpenAPI spec. Type mismatches go undetected until runtime.

Work

  • Add an openapi-ts (or openapi-generator) code generation step that reads the FastAPI-generated openapi.json and produces a typed TypeScript client.
  • Commit the generated client to the repo (or generate it as a CI artefact).
  • Replace at least one existing manual API call wrapper with the generated client to validate the approach.
  • Document the regeneration command in the README.

Acceptance Criteria

  • Running the documented command regenerates the TypeScript client from the current OpenAPI spec.
  • The generated client compiles without TypeScript errors.
  • The frontend builds successfully using the generated client.

Reference

Roadmap item: P3 — OpenAPI client generation.

## Problem The frontend maintains manually written API call wrappers that can drift from the backend OpenAPI spec. Type mismatches go undetected until runtime. ## Work - Add an `openapi-ts` (or `openapi-generator`) code generation step that reads the FastAPI-generated `openapi.json` and produces a typed TypeScript client. - Commit the generated client to the repo (or generate it as a CI artefact). - Replace at least one existing manual API call wrapper with the generated client to validate the approach. - Document the regeneration command in the README. ## Acceptance Criteria - Running the documented command regenerates the TypeScript client from the current OpenAPI spec. - The generated client compiles without TypeScript errors. - The frontend builds successfully using the generated client. ## Reference Roadmap item: P3 — OpenAPI client generation.
AI-Manager added the P3agent-readymedium labels 2026-03-27 17:24:07 +00:00
Author
Owner

Closing as already implemented. openapi-typescript is in package.json with generate scripts. openapi.json is committed. TypeScript types are auto-generated from the FastAPI spec.

**Closing as already implemented.** openapi-typescript is in package.json with generate scripts. openapi.json is committed. TypeScript types are auto-generated from the FastAPI spec.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#398