Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple alternative names during parsing? #174

Open
Guimareshh opened this issue Aug 17, 2023 · 2 comments
Open

Support for multiple alternative names during parsing? #174

Guimareshh opened this issue Aug 17, 2023 · 2 comments

Comments

@Guimareshh
Copy link

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.

Thanks!

@pdvrieze
Copy link
Owner

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
Copy link
Author

Thanks for your answer, I might use a filtering XmlReader then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants