-
Notifications
You must be signed in to change notification settings - Fork 560
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
Untagged Enum Bug (?) #1155
Comments
I think this is caused by serde-rs/serde#2230. If you use
|
The issue indeed seems to be for enum wrapped
This fails with the following error and seems to incorrectly guess the type while parsing:
In addition to jonasbb workaround but you want to preserve the full range of a u128, you could sum 2x |
When the type is
ContentVec(Vec<Value>)
, it throws the error above.However, when I set
ContentVec(Value)
it deserializes fine?Is that not a vector right after the
0
in the json?And when I print it out the value as
ContentVec(Value)
instead ofContentVec(Vec<Value>)
, it is clearly an array:I even added this if statement (when set as
ContentVec(Value)
), to make sure it is an array.Again, it prints out with no errors! (the same thing as above).
After asking a handful of people, everybody agreed this is not the intended behavior.
If it is, can I can get an explanation as to what is going on here...?
Please try the code out for yourself.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6811facc5a4e83d7a46847f37da9d569
The text was updated successfully, but these errors were encountered: