Closed gperinazzo closed 5 years ago
I've made a fix for this issue in https://github.com/wyyerd/stripe-rs/pull/93.
Thanks for submitting the issue.
Thanks for the quick fix! I was going to propose removing that condition, but wasn't sure if the changes in the resulting objects were acceptable (as those are breaking changes).
There may be a way to maintain the previous API by telling serde to use a custom deserialization function for those fields, but I didn't have the time to test it out.
This change was made in the "major" v0.11.0 release
The openapi codegen currently handles non-required booleans using
#[serde(default)]
. This works to set the value to false if the field is missing in the input json, but if the attribute is nullable deserialization will fail if it finds a null.The assumption seems to be documented in line 1392 of the codegen source
I've written a small example:
Which outputs:
I had this issue trying to receive a
product.created
event whereshippable
seems to be set to null.