Serde Default Doesn't Handle Explicit Null Value
Closed this issue · 0 comments
criminosis commented
Turns out my original PR missed one of the two cases 🤦♂️
called `Result::unwrap()` on an `Err` value: Error("invalid type: null, expected a string", line: 1, column: 76)
#[serde(default)]
doesn't handle when the value is explicitly set to null like "message": null
.
Without bringing in an additional dependency like serde_with this can be handled with a small additional deserializer.
I'll also add test cases like I should have in the first place to make sure this gets it this time @wolf4ood 👍