You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I have a strange problem with jackson-databind 2.9.* (with 2.8.* everything work good):
Data class:
@Data
public class PackInstanceOrder {
private Long orderId;
private Long orderTypeId;
}
Simple test:
@Test
fun test() {
val XML_OBJECT_MAPPER = XmlMapper()
val xml = "<orders></orders>"
val orders: List<PackInstanceOrder> = XML_OBJECT_MAPPER.readValue(xml,
XML_OBJECT_MAPPER.getTypeFactory().constructCollectionType(List::class.java, PackInstanceOrder::class.java))
assertThat(orders, notNullValue())
}
throw an error:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "" (class PackInstanceOrder), not marked as ignorable (2 known properties: "orderId", "orderTypeId"])
at [Source: (StringReader); line: 1, column: 18] (through reference chain: java.util.ArrayList[0]->PackInstanceOrder[""])
When adding @JsonIgnoreProperties(ignoreUnknown = true) annotation to PackInstanceOrder, error was changed:
com.fasterxml.jackson.databind.exc.MismatchedInputException: Unexpected end-of-input when binding data into PackInstanceOrder
at [Source: (StringReader); line: 1, column: 18] (through reference chain: java.util.ArrayList[1])
BUT! When I change xml to <orders/>
test didn't throw any errors and pass well.
The text was updated successfully, but these errors were encountered:
Hello,
I have a strange problem with jackson-databind 2.9.* (with 2.8.* everything work good):
Data class:
Simple test:
throw an error:
When adding @JsonIgnoreProperties(ignoreUnknown = true) annotation to PackInstanceOrder, error was changed:
BUT! When I change xml to
<orders/>
test didn't throw any errors and pass well.
The text was updated successfully, but these errors were encountered: