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

Only enable Spring default interface for java8 #3022

Merged
merged 1 commit into from
Jul 7, 2019

Conversation

eriktim
Copy link
Contributor

@eriktim eriktim commented May 28, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Fixes #2984.
The documentation of the java8 option describes it can be used to generate default interfaces. I therefore took the approach not to generate default interfaces when you don't explicitly set the java8 option. To me this feels the most natural. Please let me know if you prefer to add an extra option for this.

cc @diyfr

@macjohnny
Copy link
Member

I would be in favor of an extra-option

@diyfr
Copy link
Contributor

diyfr commented May 29, 2019

It might be better if version 8.0 is the default and basic version now ?
@cbornet

@eriktim eriktim force-pushed the spring-interface-no-default branch from e8b5c01 to 079c243 Compare June 2, 2019 06:11
@eriktim
Copy link
Contributor Author

eriktim commented Jun 2, 2019

OK, I've changed the PR to add an additional option instead. It would be easy to reuse if java8 becomes the default.

@eriktim eriktim force-pushed the spring-interface-no-default branch from 079c243 to f4036c0 Compare June 5, 2019 17:42
@wing328
Copy link
Member

wing328 commented Jul 2, 2019

@eriktim can you please resolve the merge conflicts when you've time?

@wing328
Copy link
Member

wing328 commented Jul 2, 2019

cc @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04)

@eriktim eriktim force-pushed the spring-interface-no-default branch 2 times, most recently from 8237c67 to 7fc341a Compare July 2, 2019 18:46
@@ -48,6 +48,7 @@ sidebar_label: spring
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|singleContentTypes|Whether to select only one produces/consumes content-type by operation.| |false|
|skipDefaultInterface|Wether to generate default implementations for java8 interfaces| |false|
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Wether/Whether/

@@ -117,6 +119,7 @@ public SpringCodegen() {
cliOptions.add(CliOption.newBoolean(DELEGATE_PATTERN, "Whether to generate the server files using the delegate pattern", delegatePattern));
cliOptions.add(CliOption.newBoolean(SINGLE_CONTENT_TYPES, "Whether to select only one produces/consumes content-type by operation.", singleContentTypes));
updateJava8CliOptions();
cliOptions.add(CliOption.newBoolean(SKIP_DEFAULT_INTERFACE, "Wether to generate default implementations for java8 interfaces", skipDefaultInterface));
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Wether/Whether/

@eriktim eriktim force-pushed the spring-interface-no-default branch from 7fc341a to a8b91c1 Compare July 4, 2019 08:50
@wing328
Copy link
Member

wing328 commented Jul 6, 2019

Sorry please resolve the merge conflicts one more time. I'll hold on other Spring PRs for the time being.

@eriktim eriktim force-pushed the spring-interface-no-default branch 2 times, most recently from cb80484 to 196f33f Compare July 7, 2019 06:58
@eriktim
Copy link
Contributor Author

eriktim commented Jul 7, 2019

Done. Is something still holding this back or can it be merged?

@wing328
Copy link
Member

wing328 commented Jul 7, 2019

It can be merged.

@wing328 wing328 merged commit 366ca24 into OpenAPITools:master Jul 7, 2019
@wing328 wing328 added this to the 4.0.3 milestone Jul 7, 2019
@eriktim eriktim deleted the spring-interface-no-default branch July 7, 2019 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Java][Spring] Disable default methods for interfaces
5 participants