-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Retain order of produces
media types in @ExceptionHandler
#35587
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
Retain order of produces
media types in @ExceptionHandler
#35587
Conversation
produces
media types in @ExceptionHandler
Hi @IMurzich, Congratulations on submitting your first PR for the Spring Framework! 👍 However, before we process this PR, we need to take care of the following.
Regarding point # 1, I realize you added some text to this issue's description, but it is not fully clear to me what you mean. So, perhaps you can just expound on that. Thanks |
Hi @sbrannen, I've added test. Please check it. Thanks. |
Purpose of change: I have a controller and exception handler in it. My REST service can return JSON or XML replies. Therefore I want to return exceptions in JSON or XML too. Exception handler is annotated with: @ExceptionHandler(exception = Exception.class, produces = {"application/json", "application/xml"}) And I expect to get JSON response with error ( |
@IMurzich, can you please sign off your commits so that the Developer Certificate of Origin (DCO) check passes? Thanks |
@IMurzich please sign the DCO. You can do that with by issuing the following commands on your fork:
|
cf5eefd
to
625a918
Compare
Signed-off-by: Igor Murzich <[email protected]>
Signed-off-by: Igor Murzich <[email protected]>
625a918
to
6057763
Compare
Closes gh-35587 Signed-off-by: Igor Murzich <[email protected]>
Fixed via 7699b4a |
Fix error when corrupt order of
produces
media types for@ExceptionHandler
.For example, the following returns xml by default.