Repository navigation
Add API v2 Search support - #1989
Open
jar-stripe wants to merge 9 commits into
Open
jar-stripe wants to merge 9 commits into
jar-stripe wants to merge 9 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:52
jar-stripe
requested review from
zacchua-stripe
and
a balanced review from Copilot
and removed request for
a team and
Copilot
October 8, 2026 02:52
Committed-By-Agent: goose Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Typed request parameters currently fail, and pagination can use the wrong API requestor.
2 open findings
What changed in this PR
Adds API v2 Search result conversion and POST-based automatic pagination.
Changes:
- Registers
Stripe::V2::SearchResultObject. - Adds enumerable pagination preserving search filters.
- Moves Search
limitparameters into the query string.
| File | Description |
|---|---|
.hark/changes/2026-10-08_jar_v2-search-support.change.md |
Records the feature change. |
lib/stripe.rb |
Loads the new result class. |
lib/stripe/object_types.rb |
Registers its object type. |
lib/stripe/stripe_service.rb |
Handles v2 Search limits. |
lib/stripe/util.rb |
Converts and initializes search results. |
lib/stripe/v2_search_result_object.rb |
Implements pagination and enumeration. |
test/stripe/v2_search_result_object_test.rb |
Tests POST pagination across empty pages. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| params.delete(:limit) | ||
| params.delete("limit") | ||
|
|
||
| request_stripe_object( |
| end | ||
|
|
||
| def request(method:, path:, base_address:, params: {}, opts: {}) | ||
| if method == :post && |
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
v2.search_resultpages and paginates by sending the original request body with POST requests tonext_page_url. stripe-ruby needs a registered enumerable result object so generated v2 Search methods support normal object conversion and automatic iteration.What?
Stripe::V2::SearchResultObject.Enumerable.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.