You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd expect the unknown field to be an empty object in both cases.
This is clearly a bug as extra data is being parsed which clearly should not have been.
This bug is clearly caused by the way the derive attributes generate deserializing logic.
It also happens on other formats (I actually encoutered this problem while implementing my own format), I chose serde_json to make the examples more readable.
The text was updated successfully, but these errors were encountered:
When flattening an enum the values aren't discared and they get deserialized twice.
Here is a reproducible example:
link to playground
This outputs the following:
The enum values get parsed both in the status field and the unknown field.
The same thing doesn't happen when using a struct:
link to playground
Which outputs the following:
I'd expect the
unknown
field to be an empty object in both cases.This is clearly a bug as extra data is being parsed which clearly should not have been.
This bug is clearly caused by the way the derive attributes generate deserializing logic.
It also happens on other formats (I actually encoutered this problem while implementing my own format), I chose serde_json to make the examples more readable.
The text was updated successfully, but these errors were encountered: