Repository navigation
Do not decode the body of a ResponseEntity<Void> - #1442
Merged
ryanjbaxter merged 1 commit intoOct 8, 2026
Merged
Conversation
Contributor
|
Can you submit this against 5.0.x? |
ResponseEntityDecoder passed Void.class on to the delegate decoder, so a ResponseEntity<Void> or HttpEntity<Void> method failed with UnknownContentTypeException when the server sent a text/plain or text/html body. RestTemplate and RestClient skip the body for Void response entities; do the same here and keep the status and headers. Signed-off-by: kdelay <kdelay20@gmail.com>
kdelay
force-pushed
the
fix/response-entity-void-body
branch
from
October 8, 2026 00:46
1b1eba8 to
0996889
Compare
Contributor
Author
|
Done. Rebased onto 5.0.x and retargeted the PR; the change applies unchanged there and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A client method returning
ResponseEntity<Void>orHttpEntity<Void>fails withUnknownContentTypeException("no suitable HttpMessageConverter found for response type [class java.lang.Void] and content type [text/plain]") when the server sends a non-JSON body, for example a 202 with a short text message.ResponseEntityDecoderhandsVoid.classto the delegate decoder.RestTemplateandRestClientdo not read the body forVoidresponse entities. This change does the same and still returns the status and headers.Tests:
SpringDecoderTestscases fail without the fix with the exception above../mvnw -P spring -pl spring-cloud-openfeign-core verifypasses (456 tests, 0 Checkstyle violations).