serde_with v2.3.2
Changed
-
Improve the error message when deserializing
OneOrMany
orPickFirst
fails.
It now includes the original error message for each of the individual variants.
This is possible by dropping untagged enums as the internal implementations, since they will likely never support this, as these old PRs show serde#2376 and serde#1544.The new errors look like:
OneOrMany could not deserialize any variant: One: invalid type: map, expected u32 Many: invalid type: map, expected a sequence
PickFirst could not deserialize any variant: First: invalid type: string "Abc", expected u32 Second: invalid digit found in string