Skip to content

Default DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT to enabled for XmlMapper #245

@cowtowncoder

Description

@cowtowncoder

In XML, empty content for elements has to be represented as either null or empty String; and since it is often better do latter, it is usually also appropriate to allow data-binding level coercion into actual null if a String value is not allowed. For this reason it seems best to make XmlMapper default settings to enable ACCEPT_EMPTY_STRING_AS_NULL_OBJECT unlike vanilla ObjectMapper. This mostly stems from the fact that where JSON can indicate difference between Strings, Numbers and Booleans, XML can not, without schema of some sort.

Users may still disable setting if they choose to: this is simply default setting.

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