Skip to content

Reject non-integer Advanced Commerce offer period counts - #216

Open
Shubham-Padkonde wants to merge 2 commits into
apple:mainfrom
Shubham-Padkonde:fix/integer-period-count
Open

Shubham-Padkonde wants to merge 2 commits into
apple:mainfrom
Shubham-Padkonde:fix/integer-period-count

Conversation

@Shubham-Padkonde

@Shubham-Padkonde Shubham-Padkonde commented Oct 4, 2026 •

Copy link
Copy Markdown

AdvancedCommerceOffer(periodCount=1.5, ...), periodCount=float('nan'), and periodCount=True currently pass validation even though the API requires an integer number of periods. Range comparisons alone do not enforce that contract, and comparisons with NaN are both false.

Require an integer, excluding booleans, before checking the existing 1–12 range. Tests cover constructing the public model with invalid values and every valid period count. Six regression cases fail before the change.

Validation after merging current main: the full Python 3.12 suite passes (403 tests and 484 subtests), including the live OCSP check. Upstream's explicit None rejection and its error message are preserved alongside integer-only validation. git diff --check passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant