Skip to content

Add OpenAPI examples for /api/gateway [b#086] - #1141

Open
EmperorNexus wants to merge 1 commit into
CalloraOrg:mainfrom
EmperorNexus:feat/gateway-openapi-examples-b086
Open

Add OpenAPI examples for /api/gateway [b#086]#1141
EmperorNexus wants to merge 1 commit into
CalloraOrg:mainfrom
EmperorNexus:feat/gateway-openapi-examples-b086

Conversation

@EmperorNexus

Copy link
Copy Markdown

Summary

Adds typed request/response examples for the /api/gateway surface in src/openapi.yaml, following the same pattern used by the /api/webhooks examples (GrantFox FWC26).

Changes

  • GET /api/gateway — cursor-paginated listing
    • cursor / limit query parameter examples
    • populated page (with endpoint pricing) and empty-page (nextCursor: null) response bodies
  • GET /api/gateway/health/{apiSlug} — per-API upstream health
    • healthy (closed breaker with latency percentiles), no-traffic (null latency), and open-breaker examples
    • 404 unknown-slug example with StandardErrorEnvelope
  • GET / POST /api/gateway/{apiId} — authenticated proxy route
    • x-api-key header examples and forwarded request-body examples
    • pass-through 200 response example
    • StandardErrorEnvelope examples for 401, 402, 403, 429 (with Retry-After header), 502, 503, and 504
  • New typed component schemas: GatewayEndpointPricing, GatewayApiEntry, GatewayListResponse, GatewayHealthResponse, GatewayProxyRequest, GatewayProxyResponse

Tests

  • Added src/routes/gateway.openapi.test.ts — contract test asserting every gateway path, operation, and schema is documented. 26/26 tests pass.

Documentation

  • API/visible changes are limited to OpenAPI example bodies; no runtime behavior changes.

Checklist

  • Implemented per the description above
  • Added focused tests for the change
  • Documented API/visible changes
  • Adheres to repo lint and code style (eslint + typecheck pass)

Closes #951

….yaml

- Document GET /api/gateway cursor-paginated listing with cursor/limit
  query parameter examples and populated/empty response bodies
- Document GET /api/gateway/health/{apiSlug} with healthy, no-traffic,
  and open-breaker latency examples plus a 404 not-found example
- Document the authenticated proxy route (/api/gateway/{apiId}) for GET
  and POST with forwarded body examples, a pass-through 200 response, and
  StandardErrorEnvelope examples for 401/402/403/429/502/503/504
- Add typed component schemas: GatewayEndpointPricing, GatewayApiEntry,
  GatewayListResponse, GatewayHealthResponse, GatewayProxyRequest,
  GatewayProxyResponse
- Add src/routes/gateway.openapi.test.ts contract test asserting all
  gateway paths, operations, and schemas are documented

Closes CalloraOrg#951
@drips-wave

drips-wave Bot commented Aug 4, 2026

Copy link
Copy Markdown

@EmperorNexus Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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 examples for /api/gateway [b#086]

1 participant