-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Aliases for enum variants are not working with flattened enums #1847
Comments
Closing as a duplicate of #1504. |
While the duplicate issue, #1504, is closed, the issue in the original comment here is still a problem. Using the same code from the original comment, I have put together an example using It seems that the solution to #1504 fixed the problem for field aliases, but not variant aliases. Can we reopen this issue? Or is there another issue tracking enum variant aliases? |
Probably, #2566 will fix that, the relevant lines seems to the here: |
@Anders429 You have a nice repro for the outstanding problem with enum variants. I would open a separate issue for better tracking. |
Seems like the outstanding problem with enum+alias+flattened is also reported here #2188 |
#2566 being merged does completely resolve this issue. This can be verified by rerunning the playground I linked above. |
I have an enum with some aliases for the variants. The enum is placed as field inside a struct. If I add the
flatten
tag to the field, the deserialization fails with the errorno variant of enum MyEnum found in flattened data
. If I don't use the flatten tag, everything works as expected.Not working example (with flatten tag):
Working example (without flatten tag):
I've used quick-xml as deserializer here, but it semse to be a bug of serde.
The text was updated successfully, but these errors were encountered: