Skip to content

[Frontend] frontend/src/lib/api-types.ts type definitions are hand-written and not generated from or validated against the backend's actual OpenAPI/swagger schema #1117

Description

@grantfox-oss

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

frontend/src/lib/api-types.ts presumably hand-declares TypeScript interfaces mirroring backend API responses. With no generation step from backend/src/config/swagger.ts's OpenAPI spec, a backend field rename or type change (several of which are already tracked as separate backend issues) can silently desync from the frontend's types, producing runtime undefined access bugs that TypeScript won't catch because both sides compile independently.

Acceptance criteria

  • Evaluate a codegen tool (e.g. openapi-typescript) fed by the backend's swagger output
  • Either wire up generation as an opt-in dev script, or if out of scope for now, add a comment in api-types.ts noting it must be manually kept in sync and where the source of truth lives

Files to touch

  • frontend/src/lib/api-types.ts
  • backend/src/config/swagger.ts

Out of scope

  • Fully automating type generation in CI (can be a stretch goal noted in the issue, not required)
  • Rewriting existing API call sites

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasksrefactorRefactoring existing code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions