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

More consistent type definitions #1107

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

richardm-stripe
Copy link
Contributor

@richardm-stripe richardm-stripe commented Jan 12, 2021

r? @stripe/api-library-reviewers

A change in our codegen infra revealed a few inconsistencies/bugs in the Typescript definitions. This PR resolves those.

  1. CustomerSource is now qualified as Stripe.CustomerSource inside Customers.d.ts, which is more consistent with similar references. This is a no-op.

  2. Extra method definitions have been removed from Refund.d.ts. This is a bug fix. The cause of this was that the openapi spec defines methods for both /v1/refunds/{refund} and /v1/charges/{charge}/refunds/{refund}. However, the actual Javascript code in refunds.js only supports making requests to the /v1/refunds/{refund} routes, so I have removed the extra type definitions because they are incorrect and do not describe valid uses of the library.

  3. The type definition of stripe.customers.updateSource without the params field has been removed. It doesn't make sense to call an "update" method without specifying params (although the API will accept it), and this is more consistent with what we do with other "update" methods. This is also more consistent with how we handle the multiple dispatch for updateSource in Java, which doesn't provide a paramsless signature.

Copy link
Contributor

@ctrudeau-stripe ctrudeau-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@richardm-stripe richardm-stripe merged commit db2f627 into master Jan 14, 2021
@richardm-stripe richardm-stripe deleted the richardm-typescript-consistency branch January 14, 2021 22:03
This was referenced Mar 10, 2021
This was referenced Mar 14, 2021
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

Successfully merging this pull request may close these issues.

2 participants