Skip to content

fix(kibana): send an empty object when no body is provided on POST, PUT, PATCH and DELETE - #586

Merged
JoshMock merged 2 commits into
mainfrom
kibana-empty-body
Sep 1, 2026
Merged

fix(kibana): send an empty object when no body is provided on POST, PUT, PATCH and DELETE#586
JoshMock merged 2 commits into
mainfrom
kibana-empty-body

Conversation

@JoshMock

@JoshMock JoshMock commented Sep 1, 2026

Copy link
Copy Markdown
Member

Kibana was interpreting an empty body as null, and failing the request. This fix ensures non-GET requests always send an empty object instead.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 0.61s
✅ REPOSITORY gitleaks yes no no 55.32s
✅ REPOSITORY git_diff yes no no 0.13s
✅ REPOSITORY secretlint yes no no 10.38s
✅ REPOSITORY trivy yes no no 22.48s
✅ TYPESCRIPT eslint 3 0 0 3.12s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

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.

🟡 Changes recommended

Definitions without body properties remain unnormalized despite the PR’s stated guarantee.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates Kibana request construction to normalize missing mutation bodies to {}.

Changes:

  • Adds empty-body handling while excluding GET, HEAD, and multipart requests.
  • Adds regression tests using synthetic and real API definitions.
  • Updates functional-test skip classifications.
File summaries
File Description
src/kb/request-builder.ts Adds empty-body normalization.
test/kb/request-builder.test.ts Covers normalization behavior and exceptions.
codegen/functional/kb.ts Updates functional-test skip reasons and entries.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/kb/request-builder.ts
Comment on lines +80 to +82
def.method !== 'GET' && def.method !== 'HEAD' &&
!isMultipart &&
Object.values(props).some((p) => p['x-found-in'] === 'body' || p['x-found-in'] === undefined)
@JoshMock
JoshMock merged commit 8917ae5 into main Sep 1, 2026
34 checks passed
@JoshMock
JoshMock deleted the kibana-empty-body branch September 1, 2026 20:27
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