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
The map key conversion from string to number is a serde_json feature so this looks like a special case of #1183. I'll close in favor of that issue.
For a workaround it would be reasonable for a crate such as https://github.com/jonasbb/serde_with to provide the conversion from string keys to numeric keys. Please file a feature request over there if it isn't already supported.
#[derive(Deserialize)]pubstructB{#[serde(flatten, with = "???")]map:BTreeMap<u64,String>,}
The second call fails with
Error("invalid type: string \"1\", expected u64", line: 1, column: 20)'
.Surprisingly (to me) deserializing below struct will fail as well, so it seems it's just enough if the map is nested anywhere in the flattened struct.
The text was updated successfully, but these errors were encountered: