Skip to content

docs(openapi): fix POST /v1/customer 201 response-shape drift (#316)#317

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

docs(openapi): fix POST /v1/customer 201 response-shape drift (#316)#317
CryptoJones merged 1 commit into
masterfrom
docs/openapi-customer-post-response-shape

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #316.

Summary

Same envelope drift as #312 fixed for the GET endpoint, now for the create path. Spec said bare Customer; controller returns {message, customer}. Update the 201 schema to describe the envelope and pin with a test.

Test plan

  • npm run lint && npm test — 781 passing (was 780).

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

Companion to #312 (which fixed the same drift on the GET endpoint).
The OpenAPI spec declared the POST 201 body as a bare Customer
(`$ref: '#/components/schemas/Customer'`). The controller actually
wraps the row in a `{message, customer}` envelope (no `customers`
plural alias here — that wart is GET-only).

SDK generators reading the spec built clients that expected the
bare row and then failed to find the fields at runtime because
they live one level deeper inside the envelope. Same client-side
breakage; same fix here.

Pin the new shape with a test in `tests/api/openapi.test.js`
mirroring the GET-endpoint assertion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit c721a5a into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-customer-post-response-shape branch May 19, 2026 17:42
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: POST /v1/customer 201 response shape drift (bare Customer vs {message, customer} envelope)

1 participant