Open SimonCockx opened 1 month ago
This is a known "most wanted feature", not specific to XML Schema (as in, supported by JAXB and other xml tools). Unfortunately such "flattening" (of nested elements) is not really supported by Jackson XML module.
It would be great to support it, but problem is that requires kind of structural transformation that is currently difficult to achieve due to the way Type[De]Serializer
s and regular Json[De]Serializer
s interact.
XSD schema's support a way to name an element based on its runtime type through substitution groups. I'm trying to deserialise such a substitution group. Is this supported in some way?
Example. Suppose there is two types of
Animal
s:Cow
s andGoat
s. Based on their type, I want their element to be named eithercow
orgoat
. This would be modelled as follows:XSD:
XML example instances:
Java model:
Is there a way of annotating the classes to get the desired behaviour?