You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for multiple alternative names during parsing? #174
Hello!
First of all all thanks for this amazing library!
I was wondering if it's possible to have multiple names during parsing? Like @JsonNames in Kotlin.Serialization. Currently @XmlSerialName is not repeatable.
You're welcome. Currently there is no direct support for matching broader names. This doesn't mean you can not make this work. I may provide more direct support but it would work the same way as the explicit way (just provide some convenience).
The explicit way is to use a filtering XmlReader (rather than directly deserializing from string/reader/inputstream - the directs are just shortcuts). The filter can then apply renames as needed (without having to make the serialization itself even more complex).
ps. the serialization plugin doesn't support repeatable annotations (only one is retained)
Activity
pdvrieze commentedon Aug 17, 2023
You're welcome. Currently there is no direct support for matching broader names. This doesn't mean you can not make this work. I may provide more direct support but it would work the same way as the explicit way (just provide some convenience).
The explicit way is to use a filtering XmlReader (rather than directly deserializing from string/reader/inputstream - the directs are just shortcuts). The filter can then apply renames as needed (without having to make the serialization itself even more complex).
ps. the serialization plugin doesn't support repeatable annotations (only one is retained)
Guimareshh commentedon Aug 18, 2023
Thanks for your answer, I might use a filtering XmlReader then!