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
Make empty body configurable behaviour #10810
Comments
@CezaryBD for an empty body I think a 204 response would be more idiomatic. |
@sdelamo depends on the approach, but generally, yes - 204 would be a much better solution. |
That change did not introduce empty behavior, it added an exception message for decoding failures. What would you like to happen when the body is empty? We can't decode it as json. |
I think if the status code > 200, then no exception should be fired, cause this can be an expected behaviour. |
For status codes >=400 we already have exception-on-error-status. For 2xx with empty body, we can't parse the body as json, so there is no sensible default to return. We must throw |
Pardon my manners, example app was not included in the ticket description. |
ah, you want an empty mono? that would indeed be a reasonable value. i was thinking of the blocking case. |
empty Mono should be passed just fine |
Expected Behavior
It should be configurable if fail or pass the response.
Actual Behaviour
ab5c4a2#diff-af18b3b8347409fdb81dedda7689f9d13c962d129830818e2dbd4c48770ddecdR151
Line #166.
This change introduces a default behaviour that I would prefer to be configurable.
An empty body on 200 OK status is not an error :)
Steps To Reproduce
No response
Environment Information
No response
Example Application
https://github.com/CezaryBD/micronaut-reactor-mono-void-bug-01/blob/main/src/test/java/com/example/DemoTest.java
Version
4.3.3
The text was updated successfully, but these errors were encountered: