Skip to content

fix: retain required request bodies without schema constraints - #372

Merged
rowkav09 merged 1 commit into
mainfrom
fix/required-unconstrained-body
Oct 5, 2026
Merged

rowkav09 merged 1 commit into
mainfrom
fix/required-unconstrained-body

Conversation

@rowkav09

@rowkav09 rowkav09 commented Oct 5, 2026

Copy link
Copy Markdown
Member

A required request body whose JSON schema has no constraints ({} or {type: object}) was treated as empty and dropped, so the tool had no way to send the body the API requires. I now never treat a required body as empty, so the whole-body argument stays and is required.

One widening: a required body with content: {} and no media type also gets a required body argument now.

The new tests cover {} and {type: object} and check the content type, the required body input and the whole-body field path. They fail on main and pass with the change. Full suite passes, typecheck passes. Mock-only, no live API call.

Closes #371.

I keep required bodies in the operation metadata even when their JSON
schema is unconstrained, so tools cannot silently omit a required body.

I added fail-first regressions for empty and object-only schemas.
@rowkav09
rowkav09 merged commit aadae20 into main Oct 5, 2026
4 checks passed
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.

A required request body with an unconstrained schema is dropped from the tool

1 participant