Repository navigation
Add API v2 Search support - #2312
Open
jar-stripe wants to merge 8 commits into
Open
jar-stripe wants to merge 8 commits into
jar-stripe wants to merge 8 commits into
Conversation
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
jar-stripe
marked this pull request as ready for review
October 8, 2026 02:54
jar-stripe
requested review from
ramya-stripe
and
a balanced review from Copilot
and removed request for
a team
October 8, 2026 02:54
There was a problem hiding this comment.
🟡 Changes recommended
Empty terminal continuation pages still cause automatic iteration to throw instead of ending normally.
1 open finding
What changed in this PR
Adds API v2 Search support to stripe-java through typed results and POST-based pagination.
Changes:
- Adds a generic search-result model that retains nested request parameters.
- Moves Search limits into URL query parameters and enables POST pagination.
- Adds an HTTP pagination fixture and release note.
| File | Description |
|---|---|
| src/test/java/com/stripe/functional/v2/StripeSearchResultTest.java | Tests POST body replay across empty intermediate pages. |
| src/main/java/com/stripe/net/LiveStripeResponseGetter.java | Captures Search request parameters. |
| src/main/java/com/stripe/net/ApiRequest.java | Moves Search limits from body to URL. |
| src/main/java/com/stripe/model/v2/StripeSearchResult.java | Adds typed results and retained pagination parameters. |
| src/main/java/com/stripe/model/v2/StripeCollection.java | Generalizes pagination and skips empty intermediate pages. |
| .hark/changes/2026-10-08_jar_v2-search-support.change.md | Documents the new support. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| @Override | ||
| public T next() { | ||
| if (!currentDataIterator.hasNext() && this.nextPageUrl != null) { | ||
| while (!currentDataIterator.hasNext() && this.nextPageUrl != null) { |
This branch has not been deployed
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.

Why?
API v2 Search returns typed
v2.search_resultpages and paginates by sending retained request parameters with POST requests tonext_page_url. stripe-java needs a v2 Search result model and pagination strategy so generated Search services deserialize and iterate correctly.What?
StripeSearchResult<T>model.For the reviewer
v2 search requests look a lot like v1 search requests, except we use a POST instead of a GET and
limitis lifted out of the body into the query params.v2 search responses look a lot like v2 list responses except we have to remove
limitfrom the POST request body.See Also
https://go/j/DEVSDK-3316
Configuration
skip-changefile: This PR is not a user-facing change, so there's no changefile.