Open
Description
Search before asking
- I searched in the issues and found nothing similar.
Describe the bug
Following class can't be deserialized with Jackson 2.18.2:
public record Variable( @JacksonXmlProperty(isAttribute = true, localName = "name") String name, @JacksonXmlText String value) {}
deserialization fails with:
Invalid definition for property '' (of type com.Variable): Could not find creator property with name '' (known Creator properties: [name, value]) at [Source: (StringReader); line: 1, column: 1]
it works with Jackson 2.17.2. Also it works with 2.18.2 but with POJO only
Version Information
2.18.2
Reproduction
-->
public record Variable(
@JacksonXmlProperty(isAttribute = true, localName = "name") String name,
@JacksonXmlText String value) {
public static void deserialize() throws JsonProcessingException {
XmlMapper xmlMapper = new XmlMapper();
Variable deserialized = xmlMapper.readValue(
"<jackson name=\"value\">test</jackson>", Variable.class);
System.out.println(deserialized);
}
}
Expected behavior
Java record is deserialized
Additional context
No response