Skip to content

@JsonAnySetter does not deserialize null to Deserializer's NullValue #1228

@ejsolberg

Description

@ejsolberg

Issue became apparent when using an @JsonAnySetter with the Immutables Library. The underlying implementation uses a guava ImmutableMap which throws an exception when a null entry is added.

I'm using the following interface method declaration for the anySetter. The expectation is that null values would be deserialized as an instance of NullNode instead of null

@JsonAnySetter
Map<String, JsonNode> setUnknownProperties();

I believe the issue is here:
https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/deser/SettableAnyProperty.java#L132-L134

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions