wyyerd / stripe-rs

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

WIP: Begin using well-typed ids in response bodies #31

Closed kestred closed 5 years ago

kestred commented 5 years ago

To anyone following the changes here, penny for your thoughts about using well-typed ids in more places (following a somewhat similar trend as switching from String to enum elsewhere).

Generally the id would be that this helps catch errors earlier when receiving client values (viaFromStr::from_str), and when passing values from a Stripe response to a stripe request, it makes it more difficult to accidentally pass a value to an incorrect API (by requiring the correct id type as part of e.g. Customer::get).

On the downsides, possibly increases friction when working with databases.

kestred commented 5 years ago

Planning to do this in a different (possibly more incremental) PR, so closing this one.