Skip to content

Make v2 search limit hoisting explicit - #2015

Merged
jar-stripe merged 5 commits into
masterfrom
jar/v2-search-limit-metadata
Nov 3, 2026
Merged

jar-stripe merged 5 commits into
masterfrom
jar/v2-search-limit-metadata

Conversation

@jar-stripe

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

Copy link
Copy Markdown
Contributor

Why?

StripeService#request has special handling for v2 search methods. This handling is invoked when a POST method has a path that starts with /v2 and ends with search, but that is also a valid pattern for v2 custom operations. Our code generator needs to be able to generate code that adequately distinguishes between the two types of methods.

What?

  • Move v2 search preparation into StripeService#request_v2_search, delegating to ordinary request exactly once; remove all path-based hoisting from request.
  • Convert typed params before copying/removing limit. Preserve caller params, request options, base address, usage, and transport behavior.
  • Strip any incoming query string in the v2 search helper, then append limit from params if present and remove it from the copied body. Pagination uses ordinary requests and keeps server-authored page URLs unchanged.
  • Cover typed/hash params, custom requests, absent limits, query stripping with and without a limit, immutability, and dispatch counts.

Validation: just test, just lint-check, and just typecheck pass. Focused service and pagination tests: 14 tests, 23 assertions.

See Also

Configuration

  • skip-changefile: This PR is not a user-facing change, so there's no changefile.

Committed-By-Agent: goose
Orbit-Session-Id: bf0045b8-bfc9-4e18-ae11-5f042ce9add7
Committed-By-Agent: goose
Orbit-Session-Id: bf0045b8-bfc9-4e18-ae11-5f042ce9add7
@jar-stripe
jar-stripe marked this pull request as ready for review November 2, 2026 16:41
@jar-stripe
jar-stripe requested a review from a team as a code owner November 2, 2026 16:41
@jar-stripe
jar-stripe requested review from mark-kogan-stripe and a balanced review from Copilot and removed request for a team November 2, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the change making v2 search limit handling explicit.

No open issues 🎉

What changed in this PR

Makes v2 search limit handling explicit so search requests can be distinguished from custom operations with similar URL paths.

Changes:

  • Moves limit preparation into request_v2_search, which delegates once to ordinary request.
  • Preserves caller parameters and existing query URLs while removing limits from search request bodies.
  • Adds coverage for typed and hash parameters, custom operations, option forwarding, immutability, and dispatch counts.
File Description
test/​stripe/​stripe_service_test.rb Tests explicit search preparation and unchanged custom-operation dispatch.
lib/​stripe/​stripe_service.rb Replaces path-based limit handling with an explicit v2 search helper.

Review effort: Balanced

Committed-By-Agent: goose
Orbit-Session-Id: bf0045b8-bfc9-4e18-ae11-5f042ce9add7
@jar-stripe
jar-stripe enabled auto-merge (squash) November 2, 2026 18:24
@jar-stripe
jar-stripe merged commit a672c2f into master Nov 3, 2026
18 checks passed
@jar-stripe
jar-stripe deleted the jar/v2-search-limit-metadata branch November 3, 2026 01:29
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