-
Notifications
You must be signed in to change notification settings - Fork 847
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
[codegen] Add PHPDoc types for expandable fields #860
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nitpick but approving
@@ -17,7 +17,7 @@ | |||
* @property \Stripe\StripeObject[] $fee_details | |||
* @property int $net | |||
* @property string $reporting_category | |||
* @property string|null $source | |||
* @property string|\Stripe\StripeObject|null $source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you special case that one? Should we try to be fully complete with all the possible types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, expandable polymorphic fields are not very well handled at the moment and are typed as StripeObject
instead of the actual list of possible types.
We have a workaround/hack to handle this in @return
type annotations, but it wasn't easy to reuse in this case. I'll try and fix later.
@@ -11,7 +11,7 @@ | |||
* @property int $balance | |||
* @property int $created | |||
* @property string|null $currency | |||
* @property string|null $default_source | |||
* @property string|\Stripe\StripeObject|null $default_source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as the other, should we try to be complete? Asking because we will need this for dotnet codegen anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET uses interfaces for polymorphic types, so it'll be more similar to what we're already doing for Typescript.
Released as 7.23.0. |
r? @remi-stripe
cc @stripe/api-libraries
Fixes #750.