Closed cwichoski closed 10 years ago
The marshaling is completely done by JAXB, StAXON only provides the writer. All that StAXON knows is the (root) class to be serialized. StAXON does not analyze/traverse your model to compose multiple-paths from other model classes.
While I agree that this may not seem optimal, it's the way it is: you need to specify all the reachable multiple-paths for each root element you want to marshal.
Note: In your example, you may simply use path suffix carAccessoryList
instead of car/carAccessoryList
in CarInStock
.
If I use just List everything that ends with List will works? or must be exact phrase? as I have carAccessoryList, carCostList, carDriverList, etc... and many classes that points to Car, and a change in car with a new List I must change every referer class.
Must be exact phrase, i.e. { "carAccessoryList", "carCostList", "carDriverList" }
.
Hi,
I'm using staxon 1.3 and annotate some classes with multiplePaths but appears that I must always define the paths on RootElement, Staxon dont recognizes multiplePaths of references, here a sample:
In this model if load a Car, I get correct array in carAcessoryList, but if load CarInStock the the carAcessoryList attribute of car always is one JSON object of that list and never gets to correct JSON array.
a workaround for this is to anotate the CarInStock with multiplePaths too, like this:
Then that works as expected, but I think that STAXON would deal with that automatically, as there is an anotation in Car class.
Then my doubt is this is a BUG, New Feature request or a specification matter that you need to specify all paths from root including the ones in the references?
Best regards.
Clóvis