docs(openapi): document /healthz 503 body shape — db_error was undeclared#236
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #235.
Summary
Controller emits
db_erroron 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 lintcleannpm test— 681 → 682 (+1 OpenAPI assertion on /healthz 503 body shape)Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/