fix(account): PaymentMethod.credit_card_ends_with should be String, not i32#87
Merged
Merged
Conversation
…ot i32 The OpenAPI example for `PaymentMethod` shows `creditCardEndsWith` as a string, and real responses commonly include leading-zero card tails (e.g. `"0042"`) that lose information when typed as `i32` — or fail to deserialize entirely if the value contains non-numeric formatting. Strengthens `test_get_account_payment_methods` from a vacuous `account_id.is_some()` check to a realistic round-trip that includes a `paymentMethods` array with a leading-zero card tail and asserts the field comes through intact. Breaking change to a public field type. The previous typing would silently mis-handle real responses, so no production caller can have been relying on the numeric form. Refs #40 (spec deltas tracking) Closes #77
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PaymentMethod.credit_card_ends_withwas typedOption<i32>but the OpenAPI example shows it as a string. Real responses commonly include leading-zero card tails (e.g."0042") which ani32would mangle (drop the leading zero) or fail to deserialize.Changed to
Option<String>. Updated the previously vacuoustest_get_account_payment_methodsto mount a realistic shape including a leading-zero tail and assert it round-trips intact.Breaking change
Public field type changed. The previous typing silently mis-handled real responses, so no production caller can have been relying on it.
Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace— all pass;test_get_account_payment_methodsnow asserts the actual round-tripCloses #77
Refs #40 (spec deltas)