Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Add a feature in JaxbAnnotationIntrospector to define meaning of nillable=false as "JsonInclude.NON_EMPTY" #52

@cowtowncoder

Description

@cowtowncoder

(see #48, #49 for background)

Meaning of nillable property of @XmlElement and @XmlElements comes from XML Schema, and defines whether it is legal/mandatory to suppress writing out of empty collections. For Jackson this can be achieved by returning different inclusion criteria for a property annotated with one of these annotations.

For a longer discussion, see the original change #39 (for Jackson 2.5.1), which covers many aspects of handling.

Since I am not convinced that the change suggested in #48 / #49 is safe (although perhaps returning Include.NON_NULL might be acceptable, more so than NON_EMPTY), I will add a setting with which one can specifically define which JsonInclude.Incude value to use for nillable = false; default being null (meaning none). To do what #48 asks, Include.NON_EMPTY should be returned, or possibly Include.NON_NULL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions