Skip to content

Fix optional request bodies - #104

Merged
cubahno merged 1 commit into
mainfrom
allow-empty-non-req-body
Aug 9, 2026
Merged

Fix optional request bodies#104
cubahno merged 1 commit into
mainfrom
allow-empty-non-req-body

Conversation

@cubahno

@cubahno cubahno commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Operations with requestBody.required: false were failing decode when the client sent no body at all, since the generated handler always called jsonBodyDecoder and treated an empty body as an error.

Now, for optional bodies, the adapter distinguishes runtime.ErrRequestBodyEmpty from other decode errors: an empty body leaves opts.Body nil (so the request reaches the service), while any other decode error still fails as before.
Required bodies are unchanged.

@cubahno
cubahno merged commit 6e1abc8 into main Aug 9, 2026
3 checks passed
@cubahno
cubahno deleted the allow-empty-non-req-body branch August 9, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant