Hey,
I have two subclasses like the following:
public abstract class Foo{}
public class Foo1 extends Foo {}
public class Foo2 extends Foo {}
And I want to generate XML as the following:
<Foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Foo1"></Foo>
<Foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Foo2"></Foo>
Notice there is xsi:type field in the XML.
In JAXB, I could do:
JAXBContext.newInstance(Foo.class, Foo1.class, Foo2.class);
Which will provide the xsi:type tag.
How would I do this in Jackson?
Many thanks
Hey,
I have two subclasses like the following:
And I want to generate XML as the following:
Notice there is xsi:type field in the XML.
In JAXB, I could do:
JAXBContext.newInstance(Foo.class, Foo1.class, Foo2.class);Which will provide the xsi:type tag.
How would I do this in Jackson?
Many thanks