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
serde has a long-standing bug where any internal buffering, such as the use of flatten or different enum representations, causes some features to fail. The serde issue is serde-rs/serde#1183. The issue here is that deserializing integers from strings only works for map keys, but that is a serde_json specialty. There are other issues with the same cause #496 or #560.
You can fix it by overwriting the deserialize implementation, for example using an extra crate:
I'm honestly unsure whether this is a
serde-json
issue or aserde
issue so feel free to redirect me if this is the wrong place.But in the following code the addition of
#[serde(flatten)]
causes roundtrip deserialization to fail when it shouldn'tOutput:
Playground Link
Removing the
#[serde(flatten)]
attribute frominner
(as is done inOuter
) makes it work correctlyThe text was updated successfully, but these errors were encountered: