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

Error: data did not match any variant of untagged enum #798

Closed
EmekaLiberas opened this issue Aug 28, 2024 · 1 comment
Closed

Error: data did not match any variant of untagged enum #798

EmekaLiberas opened this issue Aug 28, 2024 · 1 comment
Labels
serde Issues related to mapping from Rust types to XML

Comments

@EmekaLiberas
Copy link

Hi, so I am working on a project using your library and I get this error when trying to deserialize an enum. If I get the underlying struct and try to deserialize it, it works fine. I have replicated this issue in a git hub repo that you can download and see for yourself. Any help on this would be appreciated. Thank you.

https://github.com/EmekaLiberas/quick-xml-enum-deserialize-issue/tree/main/enum-deserialization/src

@Mingun Mingun added the serde Issues related to mapping from Rust types to XML label Aug 28, 2024
@Mingun
Copy link
Collaborator

Mingun commented Aug 28, 2024

Untagged enums uses bufferisation which defeat ability of quick-xml serializer return anything that is not String or Map. This is essentially a serde-rs/serde#1183, we cannot fix it from quick-xml side. You can find many problems related to this issue. Try to use serde-untagged.

@Mingun Mingun closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

No branches or pull requests

2 participants