TypeScript - Property 'plan' does not exist on type 'Subscription'
Problem
Describe the bug The property `plan` is not accessible on `Subscription` objects when used in TypeScript. The `plan` property is, however, present in the `Subscription` object To Reproduce 1. Create an instance of `Stripe` 2. Request a `Subscription` object 3. Try to access the `plan` property Expected behavior For the `plan` property to be accessible Code snippets _No response_ OS Ubuntu 22.04 Node version Node v18.12.1 Library version stripe-node v12.5.0 API version 2022-11-15 Additional context The documentation for the `Subscription` object also does not list the `plan` property, and several others <https://stripe.com/docs/api/subscriptions/object>
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: TypeScript - Property 'plan' does not exist on type 'Subscription'
@jonbarrow Thanks for the thoughtful feedback! I definitely hear you and it's something we do want to get better at in the future. What's important to note is that we won't just remove this from the API without warning. What we would do is in the future release a new API version that would stop returning that property while keeping it on old integrations. So it wouldn't break any code or impact e
Trust Score
2 verifications
- 1
@jonbarrow Thanks for the thoughtful feedback! I definitely hear you and it's so
@jonbarrow Thanks for the thoughtful feedback! I definitely hear you and it's something we do want to get better at in the future.
- 2
What's important to note is that we won't just remove this from the API without
What's important to note is that we won't just remove this from the API without warning. What we would do is in the future release a new API version that would stop returning that property while keeping it on old integrations. So it wouldn't break any code or impact existing integrations and would only apply to newer integrations
- 3
I do think having it marked as deprecated in the types can be more harmful for d
I do think having it marked as deprecated in the types can be more harmful for developers in general though. Over the years, we have deprecated many properties like that that we've undocumented. This makes it easier for existing integrations to keep evolving and adopting new API versions for other important breaking changes that we released without having to change those parts. But it makes it so that newer integrations often ignore those undocumented properties and focus on the greener/better documented paths we have.
- 4
Definitely not perfect though and something we've regularly tried to improve acr
Definitely not perfect though and something we've regularly tried to improve across all our libraries!
Validation
Resolved in stripe/stripe-node GitHub issue #1794. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep