Skip to content

docs(openapi): align Error schema with the runtime body shape (#336)#337

Merged
CryptoJones merged 1 commit into
masterfrom
docs/openapi-error-schema-drift
May 19, 2026
Merged

docs(openapi): align Error schema with the runtime body shape (#336)#337
CryptoJones merged 1 commit into
masterfrom
docs/openapi-error-schema-drift

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #336.

Summary

Drops the phantom error: string field (never emitted) and adds the real requestId field (emitted by the global error handler for log correlation). Keeps message as the only required field.

Test plan

  • npm run lint && npm test — 785 passing (was 784).

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

The OpenAPI Error component schema declared an `error: string` field
that no controller and no middleware ever emits — the project's
no-leak policy (pinned by tests/unit/controller-error-shape.test.js)
explicitly forbids echoing raw error detail back to the client.
Conversely the global error handler in
`app/middleware/error-handler.js` does emit `requestId` when the
request reached the request-id middleware (and every server-internal
500 response body carries it for log correlation), but the schema
never named the field.

Net effect: SDK code-gen consuming the spec built client types with
a phantom `error` field while missing the real `requestId` field —
both wrong directions of drift at once.

Replace the bogus `error` property with the real `requestId` one,
keep `message` as the only required field, and pin the new shape
with a test in tests/api/openapi.test.js.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit f1a1e94 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-error-schema-drift branch May 19, 2026 18:44
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 Error schema drift: declares phantom error field, missing real requestId field

1 participant