Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !7253

Minor enhancements to Java client generator

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged William Cheng requested to merge kumuluzee-enhance into master 4 years ago
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1
  • minor code format change
  • fix typo
  • undo changes to play default version (now set to Play 2.6)

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

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) @lwlee2608 (2019/10) @bkabrda (2020/01)

Compare
  • master (base)

and
  • latest version
    5d39b7fe
    1 commit, 2 years ago

1 file
+ 14
- 18

    Preferences

    File browser
    Compare changes
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
+ 14
- 18
  • View file @ 5d39b7fe

  • Edit in single-file editor

  • Open in Web IDE


@@ -22,7 +22,6 @@ import io.swagger.v3.oas.models.media.Schema;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.config.GlobalSettings;
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
import org.openapitools.codegen.languages.features.GzipFeatures;
import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures;
@@ -40,7 +39,6 @@ import java.util.regex.Pattern;
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
import static java.util.Collections.sort;
import static org.openapitools.codegen.utils.OnceLogger.once;
import static org.openapitools.codegen.utils.StringUtils.camelize;
public class JavaClientCodegen extends AbstractJavaCodegen
@@ -96,7 +94,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
// (mustache does not allow for boolean operators so we need this extra field)
protected boolean doNotUseRx = true;
protected boolean usePlayWS = false;
protected String playVersion = PLAY_25;
protected String playVersion = PLAY_26;
protected String microprofileFramework = MICROPROFILE_DEFAULT;
protected boolean asyncNative = false;
@@ -221,27 +219,27 @@ public class JavaClientCodegen extends AbstractJavaCodegen
super.processOpts();
// RxJava
if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)){
if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) {
LOGGER.warn("You specified all RxJava versions 1, 2 and 3 but they are mutually exclusive. Defaulting to v3.");
this.setUseRxJava3(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA3).toString()));
}else {
if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)){
} else {
if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)) {
LOGGER.warn("You specified both RxJava versions 1 and 2 but they are mutually exclusive. Defaulting to v2.");
this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString()));
}else if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA3)) {
} else if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA3)) {
LOGGER.warn("You specified both RxJava versions 1 and 3 but they are mutually exclusive. Defaulting to v3.");
this.setUseRxJava3(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA3).toString()));
}else if(additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)){
} else if (additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) {
LOGGER.warn("You specified both RxJava versions 2 and 3 but they are mutually exclusive. Defaulting to v3.");
this.setUseRxJava3(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA3).toString()));
}else{
if(additionalProperties.containsKey(USE_RX_JAVA)){
} else {
if (additionalProperties.containsKey(USE_RX_JAVA)) {
this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString()));
}
if(additionalProperties.containsKey(USE_RX_JAVA2)){
if (additionalProperties.containsKey(USE_RX_JAVA2)) {
this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString()));
}
if(additionalProperties.containsKey(USE_RX_JAVA3)){
if (additionalProperties.containsKey(USE_RX_JAVA3)) {
this.setUseRxJava3(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA3).toString()));
}
}
@@ -264,12 +262,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
// Microprofile framework
if (additionalProperties.containsKey(MICROPROFILE_FRAMEWORK)) {
this.setMicroprofileFramework(additionalProperties.get(MICROPROFILE_FRAMEWORK).toString());
if (!MICROPROFILE_KUMULUZEE.equals(microprofileFramework)) {
throw new RuntimeException("Ivalid microprofileFramework '{}'. Must be 'kumuluzee' or none.");
throw new RuntimeException("Invalid microprofileFramework '" + microprofileFramework + "'. Must be 'kumuluzee' or none.");
}
this.setMicroprofileFramework(additionalProperties.get(MICROPROFILE_FRAMEWORK).toString());
}
additionalProperties.put(MICROPROFILE_FRAMEWORK, microprofileFramework);
@@ -468,7 +464,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
supportingFiles.add(new SupportingFile("api_exception_mapper.mustache", apiExceptionFolder, "ApiExceptionMapper.java"));
serializationLibrary = "none";
if (microprofileFramework.equals(MICROPROFILE_KUMULUZEE)){
if (microprofileFramework.equals(MICROPROFILE_KUMULUZEE)) {
supportingFiles.add(new SupportingFile("kumuluzee.pom.mustache", "", "pom.xml"));
supportingFiles.add(new SupportingFile("kumuluzee.config.yaml.mustache", "src/main/resources", "config.yaml"));
supportingFiles.add(new SupportingFile("kumuluzee.beans.xml.mustache", "src/main/resources/META-INF", "beans.xml"));
@@ -846,7 +842,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
this.useRxJava2 = useRxJava2;
doNotUseRx = false;
}
public void setUseRxJava3(boolean useRxJava3) {
this.useRxJava3 = useRxJava3;
doNotUseRx = false;
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
2
CLA Signed tag: internal
2
CLA Signed tag: internal
    Assign labels
  • Manage project labels

Milestone
1.0.11
1.0.11
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: facebook/create-react-app!2700
Source branch: kumuluzee-enhance

Menu

Explore Projects Groups Snippets