Skip to content

Add OpenAPI 3.0 specification for all API endpoints #26

Description

@prodbycorne

Overview

There is no formal API contract. Integrators must read source code to understand request/response shapes, error codes, and authentication. An OpenAPI 3.0 spec enables auto-generated client SDKs, Postman collections, and interactive docs.

Endpoints to Document

  • GET /health
  • GET /api/v1/prices/:assetCode with optional ?issuer= query param
  • POST /api/v1/prices/batch
  • POST /api/v1/webhooks
  • GET /api/v1/webhooks
  • DELETE /api/v1/webhooks/:id
  • POST /api/v1/webhooks/:id/test
  • GET /api/v1/indexer/status
  • WS /ws (described as an AsyncAPI or OpenAPI extension)

Deliverables

  1. openapi.yaml at repo root — OpenAPI 3.0.3 format
  2. Serve the spec at GET /api-docs/openapi.yaml
  3. Serve Swagger UI at GET /api-docs using swagger-ui-express
npm install swagger-ui-express yamljs

Schema Requirements

  • All request bodies have Zod-equivalent JSON Schema definitions
  • All error responses documented: 400, 401, 404, 422, 429, 500
  • Authentication documented: Bearer scheme in securitySchemes
  • x-rate-limit extension on rate-limited endpoints
  • Examples provided for every endpoint

Acceptance Criteria

  • openapi.yaml at repo root with all endpoints
  • Spec validates with @redocly/cli lint openapi.yaml
  • Swagger UI reachable at /api-docs in development
  • All error shapes documented
  • Authentication scheme included
  • CI step: lint the spec on every PR

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignapiREST API design and endpointsdocumentationImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions