Skip to content

[Avro] JsonInclude.Include.NON_NULL does not use default values #165

@amorimjuliana

Description

@amorimjuliana

In the following example, I'd expect that the default value defined for the property map would be used. Instead, null is passed, which produces an error as null is not allowed for this field.

Schema

{"type": "map", "values": "string", "default": []}

POJO

class Foo {
    @JsonProperty("map")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    Map<String, String> getMap();
}

Error

com.fasterxml.jackson.databind.JsonMappingException: null of map in field map of Foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions