Skip to content

fix(openapi): send empty required JSON request bodies - #442

Merged
punkpeye merged 1 commit into
punkpeye:mainfrom
remote-controlled-man:codex/fastmcp-required-empty-json-body
Oct 17, 2026
Merged

punkpeye merged 1 commit into
punkpeye:mainfrom
remote-controlled-man:codex/fastmcp-required-empty-json-body

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

A generated OpenAPI tool accepts {} when a required JSON object's properties are all optional, but currently sends no HTTP body. Send {} in that case, including closed empty objects and required JSON bodies without a schema. This also works when only query arguments are supplied.

Omitted optional bodies, form bodies, and explicit whole-body inputs retain their existing behavior. This follows the dictionary-body investigation in #381 and fixes the separate required flattened-body presence case.

Validation:

  • The two focused suites show 10 expected assertion failures on the unchanged base and 159 passes with the fix. The 24 added cases include public MCP calls for OpenAPI 3.0 and 3.1 and omission/encoding controls.
  • Windows / Node 22.20.0 / pnpm 10.32.1: repository-wide Prettier, ESLint, TypeScript, 1,055 offline tests and the normal package build passed. The DiskStore suite was executed separately: 14 passed, 2 POSIX permission tests skipped, and the same 2 Windows rename failures reproduced on both base and head.
  • All 15 OpenAPI network benchmark/live tests passed, including the live Petstore calls.

The existing Deno 1.41.3 JSR dry-run still fails on both base and head with the same 10 dependency declaration diagnostics; their outputs are byte-identical. Linux / Node 24 remains for upstream CI.

AI assistance was used for investigation, implementation, and tests.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@punkpeye
punkpeye merged commit 040cf50 into punkpeye:main Oct 17, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 4.22.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants