-
Notifications
You must be signed in to change notification settings - Fork 565
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
Cannot deserialize struct variant using sequence #1049
Comments
This would be fixed by serde-rs/serde#2465 |
This is a serde_json issue. Deserializing the same data structure using This is unrelated to serde-rs/serde#2465 which involves untagged and adjacently tagged enums. The code above does not use untagged or adjacently tagged enums. |
I encountered the same issue. What I need to do to circumvent this issue is by converting the Value back to a string (using let deserialized: Value = serde_json::from_str(raw_json).unwrap();
... // do some validation
let object: MyType = serde_json::from_value(deserialized).unwrap(); |
Hello I've encounter following problem,
Having enum like this:
I cannot deserialize it using sequence:
Error:
However extracting variant body to a struct, works well:
Used crates:
Full test for reproduction:
The text was updated successfully, but these errors were encountered: