-
-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Labels
2.16For issues planned for 2.16For issues planned for 2.16
Milestone
Description
jackson-dataformat-xml version: 2.9.8
When using an XMLMapper with Jdk8Module to serialize Streams, the serializer seems to ignore annotation @JacksonXmlElementWrapper placed on a Stream.
For example, if I try to serialize this DTO as XML:
public class StreamBasedDto {
private Stream<String> data;
@JacksonXmlElementWrapper(localName = "elements")
@JacksonXmlProperty(localName = "element")
public Stream<String> getData() {
return data;
}
public void setData(Stream<String> data) {
this.data = data;
}
}I get the following result:
<StreamBasedDto>
<element>foo</element>
<element>bar</element>
</StreamBasedDto>whereas I was expecting the following:
<StreamBasedDto>
<elements>
<element>foo</element>
<element>bar</element>
</elements>
</StreamBasedDto>You can find a Java project reproducing the issue here: https://github.com/ndionisi/jackson-xml-element-wrapper-stream. The project tests that @JacksonXmlElementWrapper is properly taken into account when serializing List, but not when serializing Stream.
Metadata
Metadata
Assignees
Labels
2.16For issues planned for 2.16For issues planned for 2.16