Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.3.0
-
None
-
Unknown
Description
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:
xmlMapper.configure(FromXmlParser.Feature.EMPTY_ELEMENT_AS_NULL, true);
However, there's no way to enable this behaviour in jaxonxml inside camel routes. In the documentation 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.