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. |
|
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 |
ldematte
left a comment
There was a problem hiding this comment.
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$EmptyimplementsToXContentObject, 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/plainresponse instead.Closes #57639