Replies: 1 comment
|
there is now a pull request that implements this suggestion #1222 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
It would be nice if the library could support ID and IDREF in the sense that JAXB can do with its @xmlid and @XmlIDREF where on serialization of an object tree, any field/attribute that is annotated as @XmlIDREF will emit just the field marked @xmlid from the child object (rather than the serializing the whole child object) and vice versa, on deserialising the referenced ID will be replaced with the whole child object wherever it appears. In xsdata it would seem natural to add similar xmlid and xmlidref (boolean) metadata items to the
fieldpart of the data modeland
At this point it should be relatively easy to alter the serialization to emit the ID, and rather less easy for the deserialisation where perhaps the most general thing to do would be to to double pass over the instantiated object tree to find the IDs and then to replace them with the actual objects.
Has anyone tried to implement this already, or has any improvements on the above ideas?
All reactions