Skip to content

Conversation

@mickjermsurawong-stripe
Copy link
Contributor

@mickjermsurawong-stripe mickjermsurawong-stripe commented Mar 29, 2019

Gen typed params (based on the groundwork in autogen-params branch)
Two first two commits are generated.

  • First contains the new param files to be added.
  • Second contains the modified model classes that now takes methods with typed params
    cc @stripe/api-libraries
    r? @remi-stripe
    cc @ob-stripe

@mickjermsurawong-stripe mickjermsurawong-stripe force-pushed the mickjermsurawong/sdk-autogen-java-non-master-spec-fb07de8_2 branch from 95ffa8b to 406974c Compare March 29, 2019 14:57
@mickjermsurawong-stripe mickjermsurawong-stripe force-pushed the mickjermsurawong/sdk-autogen-java-non-master-spec-fb07de8_2 branch from 406974c to 8f1311c Compare March 29, 2019 15:29
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.

Okay I looked at random files and they all look correct to me. I flagged minor things but no blocker from me anymore

*/
public Builder setProrate(Boolean prorate) {
this.prorate = prorate;
return this;
Copy link
Contributor

Choose a reason for hiding this comment

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

OOC how do we handle the case where it's not set/initialized versus when you explicitly set false? I want to make sure we don't have the issue we had with stripe-go for years.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup it will be set as null, because we use this Boolean object and not primitive type boolean.

@mickjermsurawong-stripe mickjermsurawong-stripe force-pushed the autogen-params branch 2 times, most recently from 85d1fbb to 5ef9487 Compare April 2, 2019 23:23
@mickjermsurawong-stripe mickjermsurawong-stripe force-pushed the mickjermsurawong/sdk-autogen-java-non-master-spec-fb07de8_2 branch 6 times, most recently from 9585f86 to 3688e7f Compare April 4, 2019 20:54
@mickjermsurawong-stripe
Copy link
Contributor Author

@ob-stripe this last commit here has generated code with EnumParam and EmptyParam.
This branch is based on autogen-param which is already based on integration-v9.
If you could help to do error prune pass on this please.

@ob-stripe
Copy link
Contributor

@mickjermsurawong-stripe Just ran Error Prone (not "Prune" though that could work too! 😛). The main issue is that this attribute in all enum classes:

@Getter private final String value;

is lacking the @Override annotation, e.g.:

/Users/ob/workspace/java/stripe-java/src/main/java/com/stripe/param/PaymentMethodCreateParams.java:485: warning: [MissingOverride] getValue implements method in EnumParam; expected @Override
    @Getter private final String value;
    ^
    (see https://errorprone.info/bugpattern/MissingOverride)
  Did you mean '@Override @Getter private final String value;'?

There are also a few other issues in tests, but let's fix the issue in generated code first and I'll re-run Error Prone after.

@mickjermsurawong-stripe
Copy link
Contributor Author

whoops haha thanks ob! yah ErrorPrune sounds a better name to me!

@mickjermsurawong-stripe
Copy link
Contributor Author

@remi-stripe I've addressed all the pending issues.
Do you have more thoughts on this?
I will also do my own spot check against API refs.
Do you suggest any particular params endpoints I should invest my time into?

@mickjermsurawong-stripe mickjermsurawong-stripe force-pushed the mickjermsurawong/sdk-autogen-java-non-master-spec-fb07de8_2 branch from 21e9b9a to 262b77d Compare April 8, 2019 15:35
@mickjermsurawong-stripe mickjermsurawong-stripe force-pushed the mickjermsurawong/sdk-autogen-java-non-master-spec-fb07de8_2 branch from a4bfb7d to 6cde630 Compare April 8, 2019 20:33
@mickjermsurawong-stripe mickjermsurawong-stripe changed the title [generated] source: spec3.sdk.yaml@non-master-spec-fb07de8 in mickjer… Generated for V9.0 [generated] source: spec3.sdk.yaml@non-master-spec-fb07de8 in mickjer… Apr 8, 2019
@mickjermsurawong-stripe
Copy link
Contributor Author

mickjermsurawong-stripe commented Apr 8, 2019

Going to self-approve this merging this to autogen-params
Having the details of the change PR fleshed out in sdk-autogen-java PR sdk-autogen-java/pull/58
LGTM

@mickjermsurawong-stripe mickjermsurawong-stripe merged commit 50036a2 into autogen-params Apr 8, 2019
mickjermsurawong-stripe added a commit that referenced this pull request Apr 8, 2019
…-fb07de8 in mickjer… (#711)

* test: typed params path query expand and limit

* test: typed params on methods previously had params as string constant

* test: typed params on polymoprhic of EMPTY and array

test: use new empty param

* test: typed params on inner object

* test: typed params by collection methods

* test: typed param fix to singular

* test: typed param create token with different instruments

test: Token with ObjectType enum

test: typed params create token

* test: typed params create charge

test: typed params charge

* generated: param

* generated: model

* generated: param

* [generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [ErrorProne fix: add @OverRide to enum get value][generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [Rename Number to card details][generated] source: spec3.sdk.yaml@non-master-spec-c5dbddd in mickjermsurawong/working-autogen

* [Sort setter methods][generated] source: spec3.sdk.yaml@non-master-spec-97a62f7 in gen-param-default

* test: remove getters from params

* test: create webhook with event enums

* test: typed param addAll/putAll

* [generated] source: spec3.sdk.yaml@non-master-spec-6e9fab7 in mickjermsurawong/default-gen-param
mickjermsurawong-stripe added a commit that referenced this pull request Apr 8, 2019
* test: typed param setup - fix ambiguous call with null casting

test: CardTest ambiguous call with typed param

* Basic primitives for typed params  (#679)

* extract common deserializer method

extract common logic

* implement ApiParamRequest

add api param request

* Add to base test lenient request params comparison for list/array int/long comparison

* use List<Object> instead of Object[] in untyped deserializer

* provide documentation to deserializer and api request param

* reorder import statments

* fix other imports in new files

* test: Standardization consider request param as map param

* rename and add more test (#718)

* Fix remaining ErrorProne warnings

* Verify deserialized boolean params to map (#722)

* verify boolean behavior

* add suppress warning

* Generated for V9.0 [generated] source: spec3.sdk.yaml@non-master-spec-fb07de8 in mickjer… (#711)

* test: typed params path query expand and limit

* test: typed params on methods previously had params as string constant

* test: typed params on polymoprhic of EMPTY and array

test: use new empty param

* test: typed params on inner object

* test: typed params by collection methods

* test: typed param fix to singular

* test: typed param create token with different instruments

test: Token with ObjectType enum

test: typed params create token

* test: typed params create charge

test: typed params charge

* generated: param

* generated: model

* generated: param

* [generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [ErrorProne fix: add @OverRide to enum get value][generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [Rename Number to card details][generated] source: spec3.sdk.yaml@non-master-spec-c5dbddd in mickjermsurawong/working-autogen

* [Sort setter methods][generated] source: spec3.sdk.yaml@non-master-spec-97a62f7 in gen-param-default

* test: remove getters from params

* test: create webhook with event enums

* test: typed param addAll/putAll

* [generated] source: spec3.sdk.yaml@non-master-spec-6e9fab7 in mickjermsurawong/default-gen-param
mickjermsurawong-stripe added a commit that referenced this pull request Apr 8, 2019
* test: typed param setup - fix ambiguous call with null casting

test: CardTest ambiguous call with typed param

* Basic primitives for typed params  (#679)

* extract common deserializer method

extract common logic

* implement ApiParamRequest

add api param request

* Add to base test lenient request params comparison for list/array int/long comparison

* use List<Object> instead of Object[] in untyped deserializer

* provide documentation to deserializer and api request param

* reorder import statments

* fix other imports in new files

* test: Standardization consider request param as map param

* rename and add more test (#718)

* Fix remaining ErrorProne warnings

* Verify deserialized boolean params to map (#722)

* verify boolean behavior

* add suppress warning

* Generated for V9.0 [generated] source: spec3.sdk.yaml@non-master-spec-fb07de8 in mickjer… (#711)

* test: typed params path query expand and limit

* test: typed params on methods previously had params as string constant

* test: typed params on polymoprhic of EMPTY and array

test: use new empty param

* test: typed params on inner object

* test: typed params by collection methods

* test: typed param fix to singular

* test: typed param create token with different instruments

test: Token with ObjectType enum

test: typed params create token

* test: typed params create charge

test: typed params charge

* generated: param

* generated: model

* generated: param

* [generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [ErrorProne fix: add @OverRide to enum get value][generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [Rename Number to card details][generated] source: spec3.sdk.yaml@non-master-spec-c5dbddd in mickjermsurawong/working-autogen

* [Sort setter methods][generated] source: spec3.sdk.yaml@non-master-spec-97a62f7 in gen-param-default

* test: remove getters from params

* test: create webhook with event enums

* test: typed param addAll/putAll

* [generated] source: spec3.sdk.yaml@non-master-spec-6e9fab7 in mickjermsurawong/default-gen-param
mickjermsurawong-stripe pushed a commit that referenced this pull request Apr 9, 2019
* Drop support for Java 1.7

* Upgrade dev dependencies (except JUnit)

* Upgrade to JUnit 5

* Use ErrorProne in builds

* Return unsafe deserialized event data object as Option (#723)

* return as option

* update doc

* Autogen params (#705)

* test: typed param setup - fix ambiguous call with null casting

test: CardTest ambiguous call with typed param

* Basic primitives for typed params  (#679)

* extract common deserializer method

extract common logic

* implement ApiParamRequest

add api param request

* Add to base test lenient request params comparison for list/array int/long comparison

* use List<Object> instead of Object[] in untyped deserializer

* provide documentation to deserializer and api request param

* reorder import statments

* fix other imports in new files

* test: Standardization consider request param as map param

* rename and add more test (#718)

* Fix remaining ErrorProne warnings

* Verify deserialized boolean params to map (#722)

* verify boolean behavior

* add suppress warning

* Generated for V9.0 [generated] source: spec3.sdk.yaml@non-master-spec-fb07de8 in mickjer… (#711)

* test: typed params path query expand and limit

* test: typed params on methods previously had params as string constant

* test: typed params on polymoprhic of EMPTY and array

test: use new empty param

* test: typed params on inner object

* test: typed params by collection methods

* test: typed param fix to singular

* test: typed param create token with different instruments

test: Token with ObjectType enum

test: typed params create token

* test: typed params create charge

test: typed params charge

* generated: param

* generated: model

* generated: param

* [generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [ErrorProne fix: add @OverRide to enum get value][generated] source: spec3.sdk.yaml@non-master-spec-d9e92b9 in mickjermsurawong/working-autogen

* [Rename Number to card details][generated] source: spec3.sdk.yaml@non-master-spec-c5dbddd in mickjermsurawong/working-autogen

* [Sort setter methods][generated] source: spec3.sdk.yaml@non-master-spec-97a62f7 in gen-param-default

* test: remove getters from params

* test: create webhook with event enums

* test: typed param addAll/putAll

* [generated] source: spec3.sdk.yaml@non-master-spec-6e9fab7 in mickjermsurawong/default-gen-param

* Update doc on previous attributes array representation (#726)

* update doc about array representation

* fix another typo

* Another dependency version bump

* Fix docs on getting stripe object from `EventDataObjectDeserializer` (#727)

* update docs on get object

* Add missing Javadoc

* Add non-autogen typed params Event/File/EphemeralKeys (#730)

* file create params with handling of file object

* create file with typed params

* list file with typed params

update import order on files

refactor file test

* add ephemeral key create params

* add event list params

* null check for typed parameters
@ob-stripe ob-stripe deleted the mickjermsurawong/sdk-autogen-java-non-master-spec-fb07de8_2 branch April 10, 2019 16:34
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.

4 participants