docs(openapi): fix POST /v1/customer 201 response-shape drift (#316)#317
Merged
Merged
Conversation
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>
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 #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/