Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Entities that can't be serialized now return a 500 #1347
Jackson is good about serializing types that conform to the Bean spec, but
added a commit
this pull request
Nov 20, 2015
I've come come across a scenario where this causes a 500, which should probably be a 4xx. I believe it is related to this change, although I'm not sure where the appropriate fix is.
The JSR310 module re-throws parser exceptions as JsonMappingExceptions (https://github.com/FasterXML/jackson-datatype-jsr310/blob/7eccc43bbaac9e742f80b3897256563e28812345/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/JSR310DeserializerBase.java#L60), so if the client request body contains a value that is not parseable into the necessary instance type, a 500 is generated.
Is this fix to handle this in the exception mapper, or should the JSR310 module throw a different exception, or something else entirely?