On Tue, Sep 2, 2025 at 12:51 PM 'Leonel Gayard' via jackson-user <[email protected]> wrote: > > (Please forgive about doubling posting in the mailing list and github issues; > I'm not sure about the etiquette and preferred channels, when reporting > issues.) > > As per raised issue #308 [1], when serializing to XML: > > > One class has a List field annotated with @XmlElements. I expected that the > > object would be serialized into a parent element, and the contents of the > > list field would be direct children of that element. Instead, Jackson > > introduces an unwanted intermediary element, so that the contents of the > > list become grand children. > > Note: I see different outputs when using Glassfish Jaxb and Jackson. > > Can you advise? Is there some config I can apply to Jackson to change the > output generation? Or is it a bug? > > [1] https://github.com/FasterXML/jackson-modules-base/issues/308
It's a limitation wrt inclusion of Polymorphic Type Ids (`@JsonTypeInfo` for regular Jackson annotations). Handling is in XML module and there's an old issue: https://github.com/FasterXML/jackson-dataformat-xml/issues/197 Unfortunately this is quite a difficult thing to support so no quick fix is likely. -+ Tatu +- > > -- > Leonel > > -- > 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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/jackson-user/35c51622-1832-4a93-aff9-77e57f3f6609n%40googlegroups.com. -- 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/jackson-user/CAGrxA27W-GAs5aDsdMECPm-ok0dZD-%3DZ70d4nOb20b4EKUdZNw%40mail.gmail.com.
