-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Error on creating SubscriptionItemPriceDataRecurring #66
Comments
We cannot manually remove code from generated files as they will be overwritten next time the changes are reapplied from stripe. In any case, I think keeping these seperate is better as we can't guarantee that the 3 data structures will remain identical forever and may break in subtle (breaking) ways in the future. The only solution is to make sure you use use stripe::resources::generated::billing::subscription::PlanInterval;
let recurring: stripe::SubscriptionItemPriceDataRecurring = stripe::SubscriptionItemPriceDataRecurring {
- interval: stripe::PlanInterval::Month,
+ interval: PlanInterval::Month,
interval_count: Some(100),
}; |
@arlyon yes but the problem is another. can't import this module directly. is there any way to fix this or we have to change the resource to public ? |
Yes, sorry, my bad. I understand the problem now. The issue lies with rust and how it handles wildcard exports. The default behaviour is to ignore any clashing names which is why only the first is exported. The solution to this problem in nontrivial, and I wonder if these is a clippy lint that can warn about this in the future. I can imagine a whole host of bugs that could arise from this behavious (rather than opting for a compiler error) and I'm surprised this is the case. Let me have a look at this and get back to you. Thanks for the report (and patience!). |
I sorted this out by manually untangling the exports and reexporting the structs with relevant names. Will merge once CI passes. |
@arlyon great thanks |
Struct PlanInterval exist multiple places which is causing issue when creating the subscription with a inline price plan:
this Gives Error :
I tried removing the extra struct in file subscriptions.rs and subscription_item.rs and import on top it's working this way.
Let me know if there is better way. (Will submit the PR with this changes)
The text was updated successfully, but these errors were encountered: