-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Open
Labels
status: waiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged
Description
I have a problem with setting a deserialization feature in Jackson 3. With Jackson 3 there's a change in behavior while mapping null values into primitive types. I created a configuration class, but unfortunately it's not working and I still get error while deserialization. What am I missing?
@Configuration
public class JsonMapperConfig {
@Bean
@Primary
JsonMapperBuilderCustomizer jacksonCustomizer() {
return builder -> builder.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
}
}The error I'm getting:
Caused by: tools.jackson.databind.exc.MismatchedInputException: Cannot map `null` into type `int` (set DeserializationConfig.DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES to 'false' to allow)
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); byte offset: #766] (through reference chain: xxx)
Metadata
Metadata
Assignees
Labels
status: waiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged