beam-community / stripity-stripe

An Elixir Library for Stripe
Other
965 stars 344 forks source link

OpenApi struct is undefined #804

Closed bkzhang closed 10 months ago

bkzhang commented 1 year ago

Hi I am using the latest open api build (since I need the new features) but several structs are undefined. So far I've noted that it happens for Stripe.Session.__struct__ and Stripe.Discount.__struct__

Example:

** (CompileError) lib/core/services/user/stripe_session.ex:328: Stripe.Session.__struct__/0 is undefined, cannot expand struct Stripe.Session. Make sure the struct name is correct. If the struct name exists and is correct but it still cannot be found, you likely have cyclic module usage in your code
    expanding struct: Stripe.Session.__struct__/0
    ...
yordis commented 1 year ago

Is this from main branch?

bkzhang commented 1 year ago

Is this from main branch?

Yes, I realized that the Stripe.Session is now Stripe.Checkout.Session but the the Stripe.Discount object is still missing

mindreader commented 1 year ago

I looked into Stripe.Discount. It is skipped because the openapi spec doesn't have all the things discount would need. You can hack around it but then it is still missing things like the delete route for discounts.

bkzhang commented 1 year ago

Thanks, I did make a temporary workaround in the meantime

maartenvanvliet commented 1 year ago

I found a way to also generate the Stripe.Discount structs, though it results in a whole bunch of structs being generated which is nice for documentation purposes but also a bit bloaty. I'll see if I can create a PR.

github-actions[bot] commented 11 months ago

This issue has been automatically marked as "stale:discard". If this issue still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment.

github-actions[bot] commented 10 months ago

Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!