Closed dennsva closed 1 week ago
Yes, that is a known bug, that FlatMapDeserializer
does not consume data in some circumstances and it is difficult to fix it with current flatten architecture. The problem specifically in this method:
https://github.com/serde-rs/serde/blob/9e6158e9e6be4a9e599643a12539f2e9d9ab4506/serde/src/private/de.rs#L2759-L2775
To be precise, problems will be with any types that use deserialize_map
for deserialization (any maps and any #[serde(flatten)]
types), and will not be with types that use deserialize_struct
. So your issue is duplicate of #2200 because of that.
Thank you for the response!
This is probably related to the issues with combining
flatten
anddeny_unknown_fields
. However, a slightly different variant with only flatten and no enums:I would expect only "foo" to appear in the map:
Instead, I get this
Commenting out either the map or the struct Inner, it works as expected.
Versions: