diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java index 4f3183b5584..e149a288c7b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java @@ -189,15 +189,15 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { @Override public String getSchemaType(Schema p) { - String swaggerType = super.getSchemaType(p); + String openAPIType = super.getSchemaType(p); String type = null; - if (typeMapping.containsKey(swaggerType)) { - type = typeMapping.get(swaggerType); + if (typeMapping.containsKey(openAPIType)) { + type = typeMapping.get(openAPIType); if (languageSpecificPrimitives.contains(type)) { return toModelName(type); } } else { - type = swaggerType; + type = openAPIType; } return toModelName(type); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index 259d2d1b605..12c44b9dc3f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -151,7 +151,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { "Whether to generate the Zsh completion script")); cliOptions.add(CliOption.newString(HOST_ENVIRONMENT_VARIABLE_NAME, "Name of environment variable where host can be defined " + - "(e.g. PETSTORE_HOST='http://petstore.swagger.io:8080')")); + "(e.g. PETSTORE_HOST='http://api.openapitools.org:8080')")); cliOptions.add(CliOption.newString(BASIC_AUTH_ENVIRONMENT_VARIABLE_NAME, "Name of environment variable where username and password " + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterCodegen.java index 8f9d57cd6a7..987997b0ee6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterCodegen.java @@ -186,21 +186,21 @@ public class JMeterCodegen extends DefaultCodegen implements CodegenConfig { } /** - * Optional - swagger type conversion. This is used to map swagger types in a `Schema` into + * Optional - OpenAPI type conversion. This is used to map OpenAPI types in a `Schema` into * either language specific types via `typeMapping` or into complex models if there is not a mapping. * * @return a string value of the type or complex model for this property */ @Override public String getSchemaType(Schema p) { - String swaggerType = super.getSchemaType(p); + String openAPIType = super.getSchemaType(p); String type = null; - if (typeMapping.containsKey(swaggerType)) { - type = typeMapping.get(swaggerType); + if (typeMapping.containsKey(openAPIType)) { + type = typeMapping.get(openAPIType); if (languageSpecificPrimitives.contains(type)) return toModelName(type); } else - type = swaggerType; + type = openAPIType; return toModelName(type); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index 5b2f1528023..07ed71eca93 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -54,10 +54,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String CORE_DATA = "coreData"; protected Set foundationClasses = new HashSet(); - protected String podName = "SwaggerClient"; + protected String podName = "OpenAPIClient"; protected String podVersion = "1.0.0"; protected String classPrefix = "SWG"; - protected String authorName = "Swagger"; + protected String authorName = "OpenAPI"; protected String authorEmail = "team@openapitools.org"; protected String license = DEFAULT_LICENSE; protected String gitRepoURL = "https://github.com/openapitools/openapi-generator"; @@ -191,10 +191,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { cliOptions.add(new CliOption(CLASS_PREFIX, "prefix for generated classes (convention: Abbreviation of pod name e.g. `HN` for `HackerNews`).`") .defaultValue("SWG")); cliOptions.add(new CliOption(POD_NAME, "cocoapods package name (convention: CameCase).") - .defaultValue("SwaggerClient")); + .defaultValue("OpenAPIClient")); cliOptions.add(new CliOption(CodegenConstants.POD_VERSION, "cocoapods package version.") .defaultValue("1.0.0")); - cliOptions.add(new CliOption(AUTHOR_NAME, "Name to use in the podspec file.").defaultValue("Swagger")); + cliOptions.add(new CliOption(AUTHOR_NAME, "Name to use in the podspec file.").defaultValue("OpenAPI")); cliOptions.add(new CliOption(AUTHOR_EMAIL, "Email to use in the podspec file.").defaultValue("team@openapitools.org")); cliOptions.add(new CliOption(GIT_REPO_URL, "URL for the git repo where this podspec should point to.") .defaultValue("https://github.com/openapitools/openapi-generator")); @@ -329,21 +329,21 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public String getSchemaType(Schema p) { - String swaggerType = super.getSchemaType(p); + String openAPIType = super.getSchemaType(p); String type = null; - if (swaggerType == null) { - swaggerType = ""; // set swagger type to empty string if null + if (openAPIType == null) { + openAPIType = ""; // set OpenAPI type to empty string if null } // TODO avoid using toLowerCase as typeMapping should be case-sensitive - if (typeMapping.containsKey(swaggerType.toLowerCase())) { - type = typeMapping.get(swaggerType.toLowerCase()); + if (typeMapping.containsKey(openAPIType.toLowerCase())) { + type = typeMapping.get(openAPIType.toLowerCase()); if (languageSpecificPrimitives.contains(type) && !foundationClasses.contains(type)) { return toModelNameWithoutReservedWordCheck(type); } } else { - type = swaggerType; + type = openAPIType; } return toModelNameWithoutReservedWordCheck(type); } @@ -391,22 +391,22 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { return getSchemaType(p) + "<" + innerTypeDeclaration + ">*"; } } else { - String swaggerType = getSchemaType(p); + String openAPIType = getSchemaType(p); // In this condition, type of p is objective-c primitive type, e.g. `NSSNumber', // return type of p with pointer, e.g. `NSNumber*' - if (languageSpecificPrimitives.contains(swaggerType) && - foundationClasses.contains(swaggerType)) { - return swaggerType + "*"; + if (languageSpecificPrimitives.contains(openAPIType) && + foundationClasses.contains(openAPIType)) { + return openAPIType + "*"; } // In this condition, type of p is c primitive type, e.g. `bool', // return type of p, e.g. `bool' - else if (languageSpecificPrimitives.contains(swaggerType)) { - return swaggerType; + else if (languageSpecificPrimitives.contains(openAPIType)) { + return openAPIType; } // In this condition, type of p is objective-c object type, e.g. `SWGPet', // return type of p with pointer, e.g. `SWGPet*' else { - return swaggerType + "*"; + return openAPIType + "*"; } } } @@ -658,7 +658,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { /** * Return the default value of the schema * - * @param p Swagger schema object + * @param p OpenAPI schema object * @return string presentation of the default value of the schema */ @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java index e3473e6ff4d..e7f0ecf1ef6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java @@ -170,17 +170,17 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf @Override public String getSchemaType(Schema p) { - String swaggerType = super.getSchemaType(p); + String openAPIType = super.getSchemaType(p); String type = null; - if (typeMapping.containsKey(swaggerType)) { - type = typeMapping.get(swaggerType); + if (typeMapping.containsKey(openAPIType)) { + type = typeMapping.get(openAPIType); if (languageSpecificPrimitives.contains(type)) { return type; } else if (instantiationTypes.containsKey(type)) { return type; } } else { - type = swaggerType; + type = openAPIType; } if (type == null) { return null; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java index a5f9ec33c8a..ed808c6459e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.languages; -import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; @@ -28,8 +27,6 @@ import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.PathItem.HttpMethod; import io.swagger.v3.oas.models.*; -import io.swagger.v3.oas.models.parameters.*; -import io.swagger.v3.core.util.Yaml; import java.io.File; import java.util.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java index 9bd9e92135a..c96ae855c12 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java @@ -30,9 +30,6 @@ import java.util.Set; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.features.BeanValidationFeatures; -import org.openapitools.codegen.languages.features.JbossFeature; -import org.openapitools.codegen.languages.features.SwaggerFeatures; import io.swagger.v3.oas.models.*; import io.swagger.v3.oas.models.media.*; @@ -181,12 +178,12 @@ public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCo @Override public String getSchemaType(Schema p) { - String swaggerType = super.getSchemaType(p); - if (isLanguagePrimitive(swaggerType) || isLanguageGenericType(swaggerType)) { - return swaggerType; + String openAPIType = super.getSchemaType(p); + if (isLanguagePrimitive(openAPIType) || isLanguageGenericType(openAPIType)) { + return openAPIType; } - applyLocalTypeMapping(swaggerType); - return swaggerType; + applyLocalTypeMapping(openAPIType); + return openAPIType; } private String applyLocalTypeMapping(String type) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java index edd699e9ac5..b7e3465b428 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.ruby; -import io.swagger.models.parameters.FormParameter; import io.swagger.v3.oas.models.Operation; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.RubyClientCodegen;