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?

  • Removed private references to arraysAsRepeated in FormEncoder.java, and deprecated the public reference
  • Updated tests to expect indexed format for v2 arrays

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.
  • The arraysAsRepeated parameter was removed from the internal-use-only method FormEncoder#createQueryString

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 FormEncoder.java flattenParamsCollection 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 16:50
@mbroshi-stripe mbroshi-stripe requested a review from a team as a code owner November 11, 2025 16:50
@mbroshi-stripe mbroshi-stripe requested review from xavdid-stripe and removed request for a team November 11, 2025 16:50
Copy link
Member

@xavdid-stripe xavdid-stripe left a comment

Choose a reason for hiding this comment

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

Have a comment that probably warrants a fix, but approving to unblock you

@mbroshi-stripe mbroshi-stripe enabled auto-merge (squash) November 17, 2025 18:33
@ramya-stripe ramya-stripe merged commit 6a30e75 into master Nov 17, 2025
13 of 14 checks passed
@ramya-stripe ramya-stripe deleted the mbroshi/update-v2-array-params branch November 17, 2025 19:54
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.

4 participants