Skip to content

Add OpenAPI code generation CI step #272

Description

@usmanimamu17-create

Labels / Complexity: dx, ci · Trivial — 2 pts

Summary

The frontend includes a codegen script in package.json that generates TypeScript types from the backend's OpenAPI spec. However, this step is not run in CI, allowing the generated types in src/types/api.generated.ts to drift from the actual backend API. This can cause type mismatches that only surface at runtime.

Proposal

  • Add a GitHub Actions workflow step that runs npm run codegen
  • Compare the generated output with the committed src/types/api.generated.ts
  • Fail the build if the generated types differ from committed (indicating drift)

Acceptance criteria

  • CI runs the OpenAPI codegen step
  • CI fails if generated types differ from committed
  • The workflow file is added at .github/workflows/api-codegen-check.yml

Out of scope

Automatically committing the updated types (require manual update).

Getting started

Files in scope:

  • .github/workflows/api-codegen-check.yml (new file)
  • package.json (existing codegen script)

Build/test commands:

npm run codegen
git diff src/types/api.generated.ts

Good first files to read: package.json for codegen script, .github/workflows/ for existing CI patterns.

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaigncicdissue-trackingdevxissue-tracking

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions