Skip to content

Conversation

@mbroshi-stripe
Copy link
Contributor

@mbroshi-stripe mbroshi-stripe commented Nov 11, 2025

Why?

Stripe has updated how array parameters are handled in GET and DELETE methods to /v2 endpoints. Previously, the SDKs were serializing them with repeated parameter format (e.g., ?include=foo&include=bar) since that is was the API expected. While that format is still accepted, it is deprecated. Instead, we will serialize array parameters to use indexed format (e.g., ?include[0]=foo&include[1]=bar), which is the preferred method going forward. This aligns v2 behavior with v1 for consistency.

What?

  • Modified stripe/_encode.py to always use indexed array format for all API modes
  • Removed api_mode argument to _api_encode function and all references to it
  • Updated test expectations in tests/test_http_client.arraysAsRepeated to reflect new behavior

Changelog

  • Retrieve and List calls for /v2 endpoints now use indexed format (e.g., ?include[0]=foo&include[1]=bar) instead of repeated parameter format (e.g., ?include=foo&include=bar) when communicating with the Stripe API. This may break any unit tests that expect the latter behavior when setting up a mock server. Instead, they should now expect the former.

mbroshi-stripe and others added 3 commits November 10, 2025 20:32
Change array parameter serialization for v2 endpoints to use indexed
format (e.g., ?include[0]=foo&include[1]=bar) instead of the repeated
parameter format (e.g., ?include=foo&include=bar). This aligns v2
behavior with v1 for consistency.

Changes:
- Modified _encode.py _api_encode to always use indexed format
- Updated tests to expect indexed format for v2 arrays

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Committed-By-Agent: claude
@mbroshi-stripe mbroshi-stripe marked this pull request as ready for review November 11, 2025 17:01
@mbroshi-stripe mbroshi-stripe requested a review from a team as a code owner November 11, 2025 17:01
@mbroshi-stripe mbroshi-stripe requested review from jar-stripe and removed request for a team November 11, 2025 17:01
Copy link
Contributor

@jar-stripe jar-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG!

@mbroshi-stripe mbroshi-stripe enabled auto-merge (squash) November 17, 2025 17:51
@mbroshi-stripe mbroshi-stripe merged commit 1165208 into master Nov 17, 2025
19 checks passed
@mbroshi-stripe mbroshi-stripe deleted the mbroshi/update-v2-array-params branch November 17, 2025 17:55
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.

3 participants