Skip to content
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

WebClientResponseException.getResponseBodyAs throws exception instead of returning null for empty body #31179

Closed
kzander91 opened this issue Sep 6, 2023 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@kzander91
Copy link
Contributor

Spring Framework: 6.0.11

The Javadoc of org.springframework.web.reactive.function.client.WebClientResponseException#getResponseBodyAs(java.lang.Class<E>) states:

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 6, 2023
@rstoyanchev rstoyanchev self-assigned this Sep 7, 2023
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 7, 2023
@rstoyanchev rstoyanchev added this to the 6.0.12 milestone Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants