Skip to content

Keep the published OpenAPI specification in sync with the implemented routes #23

Description

@priscaenoch

Problem

The indexer serves /api/openapi.yaml and the repository depends on swagger-jsdoc/swagger-ui-express, but nothing verifies that the published specification matches the routes that actually exist. Given the very large API surface and the presence of stub/unmounted routers elsewhere in the repository, the spec can silently drift from reality, which misleads the frontend and any external integrator.

What needs to be done

  • Determine whether the spec is generated from annotations or maintained by hand.
  • Add a CI check that fails when the implemented routes and the published spec disagree (for example by generating the spec and diffing it against the committed artifact, or by reusing the existing route-validation tooling).
  • Ensure endpoints that are experimental or return mock data are marked as such in the spec (coordinate with the mock-data issue).
  • Document how to regenerate the spec.

Files

  • indexer/src/api.js (spec route)
  • .github/workflows/ci.yml
  • docs/

Acceptance deliverables

  • The published OpenAPI spec provably matches the implemented routes.
  • Drift fails CI.

Tests to pass

  • The spec-drift check passes on the current main and fails when a route is added without a spec update.

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions