-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Improve handling of empty response #125562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of empty response #125562
Conversation
Today `ActionResponse$Empty` implements `ToXContentObject`, but yields no bytes of content when serialized which creates an invalid JSON response. This commit removes the bogus interface and adjusts the affected REST APIs to send a `text/plain` response instead.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @DaveCTurner, I've created a changelog YAML for you. |
Hi @DaveCTurner, I've updated the changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to wait for Ryan's review but this looks good to me. Nice use of capabilities too!
I have only a tiny doubt about BwC tests: with the changes you made to the rest spec YAML, are those going to be affected? E.g. for mixed clusters? |
I don't follow - I'm skipping these tests in a mixed cluster unless all the nodes have the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow
It was just a general concern; if you can skip those and not care it's fine.
LGTM
Today `ActionResponse$Empty` implements `ToXContentObject`, but yields no bytes of content when serialized which creates an invalid JSON response. This commit removes the bogus interface and adjusts the affected REST APIs to send a `text/plain` response instead. Backport of elastic#125562 to `8.x`
Today `ActionResponse$Empty` implements `ToXContentObject`, but yields no bytes of content when serialized which creates an invalid JSON response. This commit removes the bogus interface and adjusts the affected REST APIs to send a `text/plain` response instead. Backport of elastic#125562 to `8.x`
Ah as this is a bugfix I meant to mark it for backport to 8.19 but forgot - backported now in #126393 but I've left that for review in case you have concerns about backporting it. |
The backport to `8.x` needed some changes to pass through CI; this commit forward-ports the relevant bits of those changes back into `main` to keep the branches aligned.
Today `ActionResponse$Empty` implements `ToXContentObject`, but yields no bytes of content when serialized which creates an invalid JSON response. This commit removes the bogus interface and adjusts the affected REST APIs to send a `text/plain` response instead. Backport of #125562 to `8.x`
Today
ActionResponse$Empty
implementsToXContentObject
, but yieldsno bytes of content when serialized which creates an invalid JSON
response. This commit removes the bogus interface and adjusts the
affected REST APIs to send a
text/plain
response instead.Closes #57639