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

Fix duplicate expand values issue #1745

Merged
merged 1 commit into from
Aug 14, 2019
Merged

Conversation

ob-stripe
Copy link
Contributor

r? @remi-stripe
cc @stripe/api-libraries

When using the ExpandX properties on a service class, expand values in the actual HTTP request would be duplicated if the same options class instance is reused for multiple requests. This is most notable the case with auto-pagination.

This fixes the issue by only adding expand values if they're not already present in the Expand list of the options class instance.

Copy link
Contributor

@remi-stripe remi-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 though I would have made a test where I pass ExpandXXXX and also XXXX in the AddExpand to confirm only one was put in the end.

@stripe-ci stripe-ci assigned ob-stripe and unassigned remi-stripe Aug 14, 2019
@ob-stripe ob-stripe merged commit f63135c into master Aug 14, 2019
@ob-stripe ob-stripe deleted the ob-fix-duplicate-expand branch August 14, 2019 22:34
@ob-stripe
Copy link
Contributor Author

Released as 27.25.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants