Skip to content
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

Inaccurate typespecs for Stripe.Subscription.update/2 (item.id is missing) #857

Open
2 tasks done
anotherpit opened this issue Sep 17, 2024 · 2 comments
Open
2 tasks done

Comments

@anotherpit
Copy link

Existing Issue or Pull Request Verification

  • Confirmed, no existing Issues or Pull Requests found related to my submission.

Package Version

3.2.0

Are you using the latest version?

  • Yes, I verified the issue is still present in the latest version.

Steps to Reproduce

Stripe.Subscription.update(subscription_id, %{
  items: [
    %{
      id: params.item_id,
      price: params.item_price
    }
  ],
})
mix dialyzer

Expected Result

Dialyzer is happy as passing item ids to subscription update method is valid.

Actual Result

The function call will not succeed.

Stripe.Subscription.update(_subscription_id :: nil | binary(), %{:items => [%{:id => binary(), :price => _}, ...]}) ::
[...]

will never return since the 2nd arguments differ
from the success typing arguments:

[...]
 :items => [
    %{
      :billing_thresholds => binary() | map(),
      :metadata => map(),
      :plan => binary(),
      :price => binary(),
      :price_data => map(),
      :quantity => integer(),
      :tax_rates => binary() | [any()]
    }
  ],
[...]

Copy link

This issue has been automatically marked as "stale:discard". We are sorry that we haven't been able to prioritize it yet.
If this issue still relevant, please leave any comment if you have any new additional information that helps to solve this issue. We encourage you to create a pull request, if you can. We are happy to help you with that.

@anotherpit
Copy link
Author

This issue has been automatically marked as "stale:discard". We are sorry that we haven't been able to prioritize it yet. If this issue still relevant, please leave any comment if you have any new additional information that helps to solve this issue. We encourage you to create a pull request, if you can. We are happy to help you with that.

Still relevant

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

No branches or pull requests

1 participant