-
Notifications
You must be signed in to change notification settings - Fork 1
release: 0.1.0 #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
release: 0.1.0 #26
Conversation
f37e51e to
3741dd5
Compare
3741dd5 to
2f3b93d
Compare
2f3b93d to
03408bf
Compare
03408bf to
c62aba0
Compare
c62aba0 to
c37e074
Compare
c37e074 to
776368e
Compare
776368e to
2a5ffb0
Compare
2a5ffb0 to
81a48a1
Compare
81a48a1 to
42baa95
Compare
42baa95 to
4619247
Compare
4619247 to
bad1ea2
Compare
bad1ea2 to
45c882b
Compare
45c882b to
7c61cd5
Compare
| optional :company_id, String, nil?: true | ||
|
|
||
| # @!attribute member_id | ||
| # The ID of the Member associated with the PaymentMethod | ||
| # The ID of the Member. Provide either this or company_id (not both). | ||
| # | ||
| # @return [String] | ||
| required :member_id, String | ||
| # @return [String, nil] | ||
| optional :member_id, String, nil?: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The change from required to optional for company_id and member_id lacks validation to ensure either one (but not both) is provided, allowing invalid API requests.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The PaymentMethodRetrieveParams and PaymentMethodListParams models now define company_id and member_id as optional, with documentation stating they are mutually exclusive. However, no validation logic was added to enforce this constraint. The underlying BaseModel does not support cross-field validation. This allows the SDK to accept parameter objects that are invalid in two ways: 1) with neither company_id nor member_id set, or 2) with both set. In both cases, the SDK will serialize the parameters without error, but the subsequent API call will fail with a validation error from the server. This is a regression from the previous behavior where member_id was required.
💡 Suggested Fix
Implement a custom validation method within the PaymentMethodRetrieveParams and PaymentMethodListParams models. This method should check that exactly one of company_id or member_id is present. Raise an ArgumentError if the condition is not met to provide immediate feedback to the developer.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: lib/whop_sdk/models/payment_method_retrieve_params.rb#L14-L20
Potential issue: The `PaymentMethodRetrieveParams` and `PaymentMethodListParams` models
now define `company_id` and `member_id` as `optional`, with documentation stating they
are mutually exclusive. However, no validation logic was added to enforce this
constraint. The underlying `BaseModel` does not support cross-field validation. This
allows the SDK to accept parameter objects that are invalid in two ways: 1) with neither
`company_id` nor `member_id` set, or 2) with both set. In both cases, the SDK will
serialize the parameters without error, but the subsequent API call will fail with a
validation error from the server. This is a regression from the previous behavior where
`member_id` was required.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8110442
Automated Release PR
0.1.0 (2026-01-02)
Full Changelog: v0.0.20...v0.1.0
Features
Bug Fixes
breakout of streams should be instantaneous (7503ef5)This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions