You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/08/04 14:52:00 UTC

[jira] [Assigned] (CAMEL-18345) EMPTY_ELEMENT_AS_NULL disabled by default in jackson-dataformat-xml

     [ https://issues.apache.org/jira/browse/CAMEL-18345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-18345:
-----------------------------------

    Assignee: Claus Ibsen

> EMPTY_ELEMENT_AS_NULL disabled by default in jackson-dataformat-xml
> -------------------------------------------------------------------
>
>                 Key: CAMEL-18345
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18345
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jacksonxml
>    Affects Versions: 3.3.0
>            Reporter: José Bustamante
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 3.19.0
>
>         Attachments: image-2022-08-04-11-36-25-666.png, image-2022-08-04-11-41-09-007.png, image-2022-08-04-11-48-11-568.png
>
>
> Jackson 2.12.x changed the default for the 'EMPTY_ELEMENT_AS_NULL' feature from true to false (see [here|[https://github.com/FasterXML/jackson-dataformat-xml/issues/411]]) and we can enable back this property using XMLMapper:
> {quote}xmlMapper.configure(FromXmlParser.Feature.EMPTY_ELEMENT_AS_NULL, true);
> {quote}
> However, there's no way to enable this behaviour in jaxonxml inside camel routes. In the [documentation|[https://camel.apache.org/components/3.14.x/dataformats/jacksonxml-dataformat.html#_enabling_or_disable_features_using_jackson],] It's specified that we can enable or disable certain types of properties that are inside SerializationFeature, DeserializationFeature and MapperFeature but there's no way to enable EMPTY_ELEMENT_AS_NULL since is in another enum (FromXmlParser). We've tried enabling the feature ACCEPT_EMPTY_STRING_AS_NULL_OBJECT but that doesn't work either.
> We've managed to implement a workaround by using <bean> instead of <jacksonxml> in our camel routes (we use Camel XML DSL), but that's not efficient as we would have to replace all <jacksonxml> references. So we need to have the possibility to enable back EMPTY_ELEMENT_AS_NULL from <jacksonxml> in camel XML DSL.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)