Closed
Description
I apologize if there's a similar issue already opened - I didn't find anything when searching.
Describe the bug
When a field has both the @JsonRawValue
and the @JacksonXmlText
annotations, the @JacksonXlmText
annotation has no effect.
Version information
com.fasterxml.jackson.core:jackson-annotations:2.13.3
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.3
To Reproduce
@JacksonXmlRootElement(localName = "test-pojo")
public class TestPojo {
@JacksonXmlProperty(isAttribute = true)
String id;
@JacksonXmlText
@JsonRawValue
String value;
}
//....
TestPojo sut = new TestPojo();
sut.id = "123";
sut.value = "<a>A</a><b someAttribute=\"B\">B</b>";
Actual output:
<test-pojo>
<id>123</id>
<value>
<a>A</a>
<b someAttribute="B">B</b>
</value>
</test-pojo>
Expected output:
<test-pojo>
<id>123</id>
<a>A</a><b someAttribute="B">B</b>
</test-pojo>
Additional context
- I tried cheating the system, by included a
@JsonProperty("")
annotation on thevalue
field, it had no effect.
Metadata
Metadata
Assignees
Labels
No labels