-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Search before asking
- I searched in the issues and found nothing similar.
Describe the bug
An UnrecognizedPropertyException is thrown on fields "message" and/or "suppressed" while deserializing a custom exception.
(since correction #3497)
Workaround : adding ".configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)" (but with operationnal impact)
Version Information
2.14+
Reproduction
public class CustomException extends Exception{
public CustomException (){
super();
}
}
String json = JsonMapper.builder().build().writeValueAsString(new CustomException());
JsonMapper.builder().build().readValue(json, CustomException.class);
==> UnrecognizedPropertyException
Expected behavior
Deserialization is possible without disabling FAIL_ON_UNKNOWN_PROPERTIES
Additional context
Since f27df63
with the removal of "builder.addIgnorable("localizedMessage");" and "builder.addIgnorable("suppressed");" In class [BeanDeserializerFactory.java] (line 452 and line 454)