Skip to content

Add API v2 Search support - #2312

Open
jar-stripe wants to merge 8 commits into
masterfrom
jar/v2-search-runtime
Open

jar-stripe wants to merge 8 commits into
masterfrom
jar/v2-search-runtime

Conversation

@jar-stripe

@jar-stripe jar-stripe commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Why?

API v2 Search returns typed v2.search_result pages and paginates by sending retained request parameters with POST requests to next_page_url. stripe-java needs a v2 Search result model and pagination strategy so generated Search services deserialize and iterate correctly.

What?

  • Adds the generic API v2 StripeSearchResult<T> model.
  • Captures Search request parameters during response deserialization.
  • Generalizes v2 collection pagination to support POST with copied nested request fields.
  • Handles empty intermediate pages and adds a focused HTTP pagination fixture.

For the reviewer

v2 search requests look a lot like v1 search requests, except we use a POST instead of a GET and limit is lifted out of the body into the query params.

v2 search responses look a lot like v2 list responses except we have to remove limit from 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.

Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
@jar-stripe jar-stripe changed the title Add API v2 search pagination support Add API v2 Search support Oct 7, 2026
Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Comment thread src/main/java/com/stripe/model/v2/StripeSearchResult.java Fixed
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
jar-stripe marked this pull request as ready for review October 8, 2026 02:54
@jar-stripe
jar-stripe requested a review from a team as a code owner October 8, 2026 02:54
@jar-stripe
jar-stripe requested review from ramya-stripe and a balanced review from Copilot and removed request for a team October 8, 2026 02:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

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.

3 participants