Jackson unmarshalling failure messages should be improved #2897
Labels
3 - in progress
Someone is working on this ticket
hackathon
Issues that could be tackled during a hackathon
help wanted
Identifies issues that the core team will likely not have time to work on
t:java
Issues related to the Java DSL
t:marshalling
Milestone
Currently we wrap a failure to unmarshall with Jackson in an IllegalArgumentException with the text "Cannot unmarshal JSON as [type]" and then pass the exception with details as a cause, however when this ends up in the routing tree only the top level exception message is in the response body, and that isn't very useful for figuring out what is wrong with the request JSON.
I think we should provide the validation error details from Jackson in the exception message or have a specific exception type for the failure and handle that in the ExceptionHandler.
The text was updated successfully, but these errors were encountered: