Skip to content

docs(openapi): document /healthz 503 body shape — db_error was undeclared#236

Merged
CryptoJones merged 1 commit into
masterfrom
docs/openapi-healthz-503-response-shape
May 19, 2026
Merged

docs(openapi): document /healthz 503 body shape — db_error was undeclared#236
CryptoJones merged 1 commit into
masterfrom
docs/openapi-healthz-503-response-shape

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #235.

Summary

Controller emits db_error on the 503 path but the OpenAPI spec didn't declare any 503 body schema. SDK generators had no way to surface it.

Declare the full 503 shape (status/db/uptime_s/version/elapsed_ms/migration/db_error). Pinned in tests/api/openapi.test.js.

Test plan

  • npm run lint clean
  • npm test — 681 → 682 (+1 OpenAPI assertion on /healthz 503 body shape)

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

…undeclared

The healthz controller emits a `db_error` string on the 503 path
(when `SELECT 1` throws), but the OpenAPI spec only had:

  503: { description: 'Degraded — DB unreachable' }

…with no body schema. SDK generators (openapi-typescript et al.) had
no way to surface `db_error` on the client side, even though the
controller always sends it on degraded responses.

Declare the full 503 body shape — status / db / uptime_s / version /
elapsed_ms / migration / db_error — mirroring the 200 path plus the
extra error string.

Pinned in `tests/api/openapi.test.js` so a future change that drops
`db_error` from the controller is forced to also update (or remove)
the matching spec field.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 796e5a3 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-healthz-503-response-shape branch May 19, 2026 11:40
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.

openapi: /healthz 503 response doesn't declare its body schema (db_error field hidden from SDK gen)

1 participant