Cześć,
Mam problem z deserializacją xmla który posiada numer telefonu (a czasami listę numerów):
<telNumber><value>1234567</value><id>3433</id></telNumber>
lub listę:
<telNumber><telNumber><value>1234567</value><id>3433</id></telNumber><telNumber><value>77777</value><id>123</id></telNumber></telNumber>
Klasa ma ustawione to pole jako lista. Przez co w przypadku wysłania pojedynczego obiektu dostaje exception:
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.test.TelNumber` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('1234567')
at [Source: UNKNOWN; line: 1, column: 1487] (through reference chain: com.test.Application["person"]->java.util.ArrayList[0]->com.test.Person["telNumber"]->java.util.ArrayList[0])
Wiecie czy jest szansa skonfigurować fasterxml żeby radził sobie z pojedynczymi obiektami? Znalazłem rozwiązanie dla jsonów, ale potrzebuję dla xml.