arlyon / async-stripe

Async (and blocking!) Rust bindings for the Stripe API
https://payments.rs
Apache License 2.0
414 stars 121 forks source link

Consider treating id types as completely opaque #529

Closed mzeitlin11 closed 2 months ago

mzeitlin11 commented 3 months ago

Is your feature request related to a problem? Please describe.

cc @arlyon, I'd like to propose removing the prefix-based validation of ids in the next branch. Beyond the added complexity and large number of issues (and since there is no documentation of them), it seems like a compatibility hazard given Stripe's statement here

Stripe considers the following changes to be backwards-compatible:
- Changing the length or format of opaque strings, such as object IDs, error messages, and other human-readable strings.
- This includes adding or removing fixed prefixes (such as ch_ on charge IDs).

This potential source of failed requests will be more problematic with miniserde since it won't even provide a useful error indicating the prefix issue.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response