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

invoices.retrieveUpcoming return type incorrect #1013

Closed
WillSquire opened this issue Sep 22, 2020 · 2 comments · Fixed by #1629
Closed

invoices.retrieveUpcoming return type incorrect #1013

WillSquire opened this issue Sep 22, 2020 · 2 comments · Fixed by #1629
Assignees
Labels
future type definition Marks issue related to outdated or incorrect TypeScript type definition

Comments

@WillSquire
Copy link

invoices.retrieveUpcoming returns Stripe.Invoice, but the upcoming invoice doesn't return an id. id should either be optional or this should be a seperate type.

@richardm-stripe
Copy link
Contributor

Hi @WillSquire, sorry for the slow response here.

We experimented with adding a separate type for "UpcomingInvoice", but unfortunately this is a little bit unwieldy. We don't want to change the type of id to optional, either, because in most cases id is not optional, and that would cause a lot of users to have to do an extra type refinement. I think the right thing to do would be to use the "Omit" utility type in the return value of the method (https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys), but unfortunately it will take a little bit of work to add the ability to express this in our code generation infrastructure. I'm labeling this as "future".

@kamil-stripe kamil-stripe added the type definition Marks issue related to outdated or incorrect TypeScript type definition label Apr 20, 2022
@kamil-stripe kamil-stripe self-assigned this Aug 4, 2022
@richardm-stripe
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future type definition Marks issue related to outdated or incorrect TypeScript type definition
Projects
None yet
3 participants