On Wed, Jul 10, 2019 at 4:55 PM Dmitriy Grigoryev <lynxpl...@gmail.com> wrote:
> Hi! > I have the following formatted xml fragment of some service response: > > ... > <items> > </items> > ... > > > *Note! *There is *linebreak* between start and closing elements. > > And I have the following corresponding code fragment: > > @JacksonXmlProperty(localName = "item") > @JacksonXmlElementWrapper(localName = "items") > private List<Item> items; > > Why I get the following deserialization error ? > > > Cannot deserialize instance of `java.util.ArrayList` out of VALUE_STRING token > > I think that if we have this combination of annotations for a field then it > should consider only collection items and nothing else inside the wrapping > element. > > Is it bug or feature ? > > It is difficult to say since you are only including snippets and not the whole XML or whole class definition. If you include both (or maybe even reproduction), it will be easier to see what the problem is. But the way to troubleshoot things with Jackson XML module is usually to reverse the process: see what kind of output you would get for specific annotated class, and make that match what you expect as input. -+ Tatu +- -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user+unsubscr...@googlegroups.com. To post to this group, send email to jackson-user@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/CAGrxA24E52o9LShXr362UJiRT71zANuXNMqBNTFmywLyjMr8mA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.