Skip to content

Reject empty JSON response bodies - #521

Merged
geemus merged 1 commit into
masterfrom
fix/empty-json-responses
Nov 21, 2026
Merged

geemus merged 1 commit into
masterfrom
fix/empty-json-responses

Conversation

@ydah

@ydah ydah commented Nov 20, 2026

Copy link
Copy Markdown
Member

Empty JSON responses are replaced with {}, allowing object schemas to pass and producing misleading type errors for array schemas.

Parse empty bodies as JSON so they fail consistently. Preserve existing HEAD behavior and header validation, non-JSON bodies, and custom parsers.

@geemus geemus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@geemus
geemus merged commit dd86021 into master Nov 21, 2026
11 checks passed
@geemus
geemus deleted the fix/empty-json-responses branch November 21, 2026 16:34
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.

2 participants