Skip to content

feat(docs): add OpenAPI 3.0 specification (#26)#59

Open
josealfredo79 wants to merge 1 commit into
SmartDropLabs:mainfrom
josealfredo79:feat/openapi-spec
Open

feat(docs): add OpenAPI 3.0 specification (#26)#59
josealfredo79 wants to merge 1 commit into
SmartDropLabs:mainfrom
josealfredo79:feat/openapi-spec

Conversation

@josealfredo79

Copy link
Copy Markdown

Closes #26

Summary

Added a formal OpenAPI 3.0.3 specification for the SmartDrop API, served via Swagger UI in development mode. The spec defines all current endpoints and includes planned future endpoints marked with x-draft: true.

Changes

  • openapi.yaml — OpenAPI 3.0.3 spec at repo root with:
    • All endpoints from the issue (/health, /prices, /webhooks, /indexer/status, /ws)
    • JSON Schema definitions for all request/response bodies
    • Error schemas: 400, 401, 404, 422, 429, 500
    • Bearer token authentication in securitySchemes
    • x-rate-limit extension on rate-limited endpoints
    • Examples for every endpoint
    • Planned endpoints (/prices/batch, /indexer/status, /ws) marked with x-draft: true
  • routes/apiDocs.js — Serves the raw YAML at /api-docs/openapi.yaml and Swagger UI at /api-docs (development only)
  • index.js — Registers the /api-docs router
  • api-docs.test.js — 7 unit tests: spec validation + Swagger UI reachability
  • CI — Lint step with @redocly/cli lint openapi.yaml on every PR

Acceptance Criteria

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OpenAPI 3.0 specification for all API endpoints

2 participants