Search before asking
Describe the bug
XmlMapper wrongly interprets collection element null tag to mean the Collection to be null.
Version Information
3.2.0
Reproduction
xmlMapper.readValue("<Collection><e xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\"/></Collection>", xmlMapper.constructType( new ParameterizedTypeImpl( CollectionWrapper.class, new Type[] {String.class}, null ));
with the model:
@JsonRootName(value = "Collection")
public static class CollectionWrapper<E> {
@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "e")
Collection<E> value;
public CollectionWrapper() {
this.value = new ArrayList<>();
}
public CollectionWrapper(Collection<E> value) {
this.value = value;
}
}
Returns a CollectionWrapper with a null for value, whereas it should be a collection with a null element like in Jackson 3.1.4 and before.
Expected behavior
Return a CollectionWrapper with a collection containing a null value.
Additional context
No response
Search before asking
Describe the bug
XmlMapperwrongly interprets collection elementnulltag to mean theCollectionto benull.Version Information
3.2.0
Reproduction
with the model:
Returns a
CollectionWrapperwith anullforvalue, whereas it should be a collection with anullelement like in Jackson 3.1.4 and before.Expected behavior
Return a
CollectionWrapperwith a collection containing anullvalue.Additional context
No response