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

Multiple API changes #918

Merged
merged 1 commit into from
Dec 20, 2019
Merged

Multiple API changes #918

merged 1 commit into from
Dec 20, 2019

Conversation

remi-stripe
Copy link
Contributor

Codegen for openapi 4ec3068

  • Adds livemode and metadata to Terminal Reader and Location
  • Adds ms as a valid locale on Checkout Session

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

* Adds `livemode` and `metadata` to Terminal `Reader` and `Location`
* Adds `ms` as a valid locale on Checkout `Session`
@@ -3392,7 +3389,7 @@ public Builder setType(Type type) {
}

/** Packaging options. */
public Builder setType(EmptyParam type) {
public Builder setType(String type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this about?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That one I'm not sure, I think it's because they changed the way string/enums work in their API. cc @ob-stripe

Copy link
Contributor

Choose a reason for hiding this comment

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

Internally, the type parameter was changed from a StringParam with a set of values to our more modern APIEnumParam abstraction with allow_all_strings_in_schema set to true to avoid a breaking change.

In the OpenAPI spec, this caused type to be updated from a string with two possible enum values to a polymorphic anyOf type: either a string with two possible enum values (i.e. the previous definition), or a simple string (due to allow_all_strings_in_schema: true).

So it's expected that we now have two overloads for type (one with the Type enum type and one with String). I can't figure out why we had an overload with EmptyParam before though, since that was not a valid value for this parameter.

This is technically a breaking change, but I think it's fine to release this as a minor since I'm fairly sure using EmptyParam would have caused the API request to fail anyway.

@richardm-stripe
Copy link
Contributor

Just a couple questions. The advertised changes seemed all in order

@remi-stripe remi-stripe assigned ob-stripe and unassigned remi-stripe Dec 19, 2019
@ob-stripe ob-stripe assigned remi-stripe and unassigned ob-stripe Dec 20, 2019
@remi-stripe remi-stripe merged commit a51ee2e into master Dec 20, 2019
@remi-stripe remi-stripe deleted the remi/codegen-4ec3068 branch December 20, 2019 14:09
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.

3 participants