From 14bebcd2f2bbfb94f4cbf3ae1c1b4b935426f83b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Sep 2021 11:06:18 +0800 Subject: [PATCH] string comparison bug fix, minor format change (#10446) --- .../codegen/languages/WsdlSchemaCodegen.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java index d6cd4e103abb..ac29e7caba77 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java @@ -24,11 +24,7 @@ import java.io.File; import java.text.Normalizer; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Arrays; +import java.util.*; public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig { public static final String PROJECT_NAME = "projectName"; @@ -138,7 +134,7 @@ public Map postProcessOperationsWithModels(Map o for (CodegenResponse response : op.responses) { if (response.isModel) { response.dataType = response.dataType.substring(0, 1).toUpperCase(Locale.getDefault()) - + response.dataType.substring(1); + + response.dataType.substring(1); } if (response.isArray) { @@ -187,7 +183,7 @@ public Map postProcessModels(Map objs) { Map mod = (Map) mo; CodegenModel model = (CodegenModel) mod.get("model"); Map modelVendorExtensions = model.getVendorExtensions(); - + for (CodegenProperty var : model.vars) { Map propertyVendorExtensions = var.getVendorExtensions(); @@ -218,7 +214,7 @@ public Map postProcessModels(Map objs) { } // specify appearing schema names in case of openapi array with oneOf elements - if (var.openApiType == "array" && var.items.dataType.startsWith("oneOf<")) { + if ("array".equals(var.openApiType) && var.items.dataType.startsWith("oneOf<")) { // get only comma separated names of schemas from oneOf String schemaNamesString = var.items.dataType.substring(6, var.items.dataType.length() - 1); @@ -248,7 +244,7 @@ public String generateOperationId(CodegenOperation op) { } if (pathElements[i].length() > 0) { newOperationid = newOperationid - + this.lowerCaseStringExceptFirstLetter(pathElements[i]); + + this.lowerCaseStringExceptFirstLetter(pathElements[i]); } }