WebClientResponseException.getResponseBodyAs
throws exception instead of returning null
for empty body
#31179
Milestone
Spring Framework: 6.0.11
The Javadoc of
org.springframework.web.reactive.function.client.WebClientResponseException#getResponseBodyAs(java.lang.Class<E>)
states:spring-framework/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java
Line 229 in 8404537
However, when the response body is empty, the following exception is thrown:
org.springframework.core.codec.DecodingException: JSON decoding error: No content to map due to end-of-input
Reproducer (extract and run the test):
demo.zip
I was expecting
null
, but I'm getting an exception instead.The text was updated successfully, but these errors were encountered: