wyyerd / stripe-rs

Rust API bindings for the Stripe HTTP API.
Apache License 2.0
224 stars 88 forks source link

Parse error when balance is negative #80

Closed phayes closed 5 years ago

phayes commented 5 years ago

When a customer has a negative value in their balance field, fetching the customer results in a parse-error. This is because balance is u64 but it should be i64.

I've created a PR against the stripe openapi specification to fix this: https://github.com/stripe/openapi/pull/50

phayes commented 5 years ago

It looks like the error is here:

                        } else if param_name.contains("count")
                            || param_name.contains("size")
                            || param_name.contains("quantity")
                        {
                            "u64"
                        } else {
                            "i64"
                        };

The error happens on the field account_balance, which contains the substring count.

phayes commented 5 years ago

A fix is here: https://github.com/wyyerd/stripe-rs/pull/81

ambaldwin commented 5 years ago

PR merged.