diff --git a/bin/utils/detect_tab_in_java_class.sh b/bin/utils/detect_tab_in_java_class.sh index 8d612acd2e0..21be867ff4e 100755 --- a/bin/utils/detect_tab_in_java_class.sh +++ b/bin/utils/detect_tab_in_java_class.sh @@ -1,10 +1,12 @@ #!/bin/bash # grep for \t in the generators -grep -RUIl $'\t$' modules/swagger-codegen/src/main/java/io/swagger/codegen/*.java +RESULT=`find modules/swagger-codegen/src/ -name "*.java" | xargs grep $'\t'` -if [ $? -ne 1 ]; then - echo "Generators (Java class files) contain tab '/t'. Please remove it and try again." +echo -e "$RESULT" + +if [ "$RESULT" != "" ]; then + echo "Java files contain tab '\\t'. Please remove it and try again." exit 1; fi diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index db0464ba7bd..43a3abce0a1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -34,49 +34,49 @@ public class CodegenParameter { */ public boolean required; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor17. - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor17. + */ public String maximum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor17 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor17 + */ public boolean exclusiveMaximum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor21 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor21 + */ public String minimum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor21 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor21 + */ public boolean exclusiveMinimum; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor26 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor26 + */ public Integer maxLength; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor29 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor29 + */ public Integer minLength; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor33 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor33 + */ public String pattern; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor42 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor42 + */ public Integer maxItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor45 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor45 + */ public Integer minItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor49 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor49 + */ public boolean uniqueItems; - /** - * See http://json-schema.org/latest/json-schema-validation.html#anchor14 - */ + /** + * See http://json-schema.org/latest/json-schema-validation.html#anchor14 + */ public Number multipleOf; public CodegenParameter copy() { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java index de6ebb715f2..b5e383a617b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java @@ -306,8 +306,8 @@ public class CodegenProperty implements Cloneable { @Override public CodegenProperty clone() { try { - CodegenProperty cp = (CodegenProperty) super.clone(); - if (this._enum != null) { + CodegenProperty cp = (CodegenProperty) super.clone(); + if (this._enum != null) { cp._enum = new ArrayList(this._enum); } if (this.allowableValues != null) { @@ -316,10 +316,10 @@ public class CodegenProperty implements Cloneable { if (this.items != null) { cp.items = this.items; } - if(this.vendorExtensions != null){ + if(this.vendorExtensions != null){ cp.vendorExtensions = new HashMap(this.vendorExtensions); } - return cp; + return cp; } catch (CloneNotSupportedException e) { throw new IllegalStateException(e); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java index 65896dc5933..8f46cd9f699 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java @@ -15,7 +15,7 @@ import config.ConfigParser; import static org.apache.commons.lang3.StringUtils.isNotEmpty; public class AuthParser { - + private static final Logger LOGGER = LoggerFactory.getLogger(AuthParser.class); public static List parse(String urlEncodedAuthStr) { @@ -25,7 +25,8 @@ public class AuthParser { for (String part : parts) { String[] kvPair = part.split(":"); if (kvPair.length == 2) { - auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header")); // FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ? + // FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ? + auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header")); } } } @@ -53,5 +54,4 @@ public class AuthParser { return null; } } - } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index e9259a4b3f4..f996879c07b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -614,24 +614,24 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } public void setPackageTitle(String packageTitle) { - this.packageTitle = packageTitle; - } + this.packageTitle = packageTitle; + } public void setPackageProductName(String packageProductName) { - this.packageProductName = packageProductName; - } + this.packageProductName = packageProductName; + } - public void setPackageDescription(String packageDescription) { - this.packageDescription = packageDescription; - } - + public void setPackageDescription(String packageDescription) { + this.packageDescription = packageDescription; + } + public void setPackageCompany(String packageCompany) { - this.packageCompany = packageCompany; - } + this.packageCompany = packageCompany; + } public void setPackageCopyright(String packageCopyright) { - this.packageCopyright = packageCopyright; - } + this.packageCopyright = packageCopyright; + } public void setSourceFolder(String sourceFolder) { this.sourceFolder = sourceFolder; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java index b83be9ebd01..1b753f8ebe0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -1,15 +1,25 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.*; -import io.swagger.codegen.languages.features.BeanValidationFeatures; -import io.swagger.models.Operation; -import io.swagger.models.Path; -import io.swagger.models.Swagger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.*; +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; +import io.swagger.codegen.CodegenResponse; +import io.swagger.codegen.CodegenType; +import io.swagger.codegen.languages.features.BeanValidationFeatures; +import io.swagger.codegen.languages.features.UseGenericResponseFeatures; +import io.swagger.models.Operation; +import io.swagger.models.Path; +import io.swagger.models.Swagger; public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { /** @@ -25,8 +35,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); - public AbstractJavaJAXRSServerCodegen() - { + public AbstractJavaJAXRSServerCodegen() { super(); sourceFolder = "src/gen/java"; @@ -46,7 +55,6 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(new CliOption("serverPort", "The port on which the server should be started")); - } @@ -55,8 +63,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen // =============== @Override - public CodegenType getTag() - { + public CodegenType getTag() { return CodegenType.SERVER; } @@ -84,7 +91,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen swagger.setBasePath(""); } - if(!this.additionalProperties.containsKey("serverPort")) { + if (!this.additionalProperties.containsKey("serverPort")) { final String host = swagger.getHost(); String port = "8080"; // Default value for a JEE Server if ( host != null ) { @@ -235,4 +242,5 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen this.useBeanValidation = useBeanValidation; } + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index b5bd88db1d7..103e0100d91 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -425,7 +425,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { @Override public Map postProcessModels(Map objMap) { - return super.postProcessModels(objMap); + return super.postProcessModels(objMap); } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java index 214b73e0e29..5edd70e2ca1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java @@ -11,19 +11,22 @@ import org.slf4j.LoggerFactory; import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.CodegenProperty; +import io.swagger.codegen.CodegenResponse; import io.swagger.codegen.CodegenType; import io.swagger.codegen.SupportingFile; import io.swagger.codegen.languages.features.BeanValidationFeatures; import io.swagger.codegen.languages.features.GzipTestFeatures; import io.swagger.codegen.languages.features.JaxbFeatures; import io.swagger.codegen.languages.features.LoggingTestFeatures; +import io.swagger.codegen.languages.features.UseGenericResponseFeatures; import io.swagger.models.Operation; public class JavaCXFClientCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures -{ - private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class); + implements BeanValidationFeatures, UseGenericResponseFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures { + +private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class); /** * Name of the sub-directory in "src/main/resource" where to find the @@ -34,6 +37,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen protected boolean useJaxbAnnotations = true; protected boolean useBeanValidation = false; + + protected boolean useGenericResponse = false; protected boolean useGzipFeatureForTests = false; @@ -75,7 +80,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests")); cliOptions.add(CliOption.newBoolean(USE_LOGGING_FEATURE_FOR_TESTS, "Use Logging Feature for tests")); - + cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response")); } @@ -93,6 +98,14 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen boolean useBeanValidationProp = convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION); this.setUseBeanValidation(useBeanValidationProp); } + + if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) { + this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE)); + } + + if (useGenericResponse) { + writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse); + } this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS)); this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS)); @@ -132,6 +145,28 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen model.imports.remove("ToStringSerializer"); } + @Override + @SuppressWarnings("unchecked") + public Map postProcessOperations(Map objs) { + objs = super.postProcessOperations(objs); + + Map operations = (Map) objs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation operation : ops) { + + if (operation.returnType == null) { + operation.returnType = "void"; + // set vendorExtensions.x-java-is-response-void to true as + // returnType is set to "void" + operation.vendorExtensions.put("x-java-is-response-void", true); + } + } + } + + return operations; + } + @Override public String getHelp() { @@ -155,4 +190,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen this.useLoggingFeatureForTests = useLoggingFeatureForTests; } + public void setUseGenericResponse(boolean useGenericResponse) { + this.useGenericResponse = useGenericResponse; + } + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java index 8c1b012ba62..4aa26394c6e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java @@ -17,10 +17,11 @@ import io.swagger.codegen.languages.features.CXFServerFeatures; import io.swagger.codegen.languages.features.GzipTestFeatures; import io.swagger.codegen.languages.features.JaxbFeatures; import io.swagger.codegen.languages.features.LoggingTestFeatures; +import io.swagger.codegen.languages.features.UseGenericResponseFeatures; import io.swagger.models.Operation; public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen - implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures + implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures, UseGenericResponseFeatures { private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFServerCodegen.class); @@ -58,6 +59,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen protected boolean generateNonSpringApplication = false; + protected boolean useGenericResponse = false; + public JavaCXFServerCodegen() { super(); @@ -111,6 +114,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen cliOptions.add(CliOption.newBoolean(USE_ANNOTATED_BASE_PATH, "Use @Path annotations for basePath")); cliOptions.add(CliOption.newBoolean(GENERATE_NON_SPRING_APPLICATION, "Generate non-Spring application")); + cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response")); + } @@ -127,6 +132,14 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen if (additionalProperties.containsKey(ADD_CONSUMES_PRODUCES_JSON)) { this.setAddConsumesProducesJson(convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON)); } + + if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) { + this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE)); + } + + if (useGenericResponse) { + writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse); + } if (additionalProperties.containsKey(GENERATE_SPRING_APPLICATION)) { this.setGenerateSpringApplication(convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION)); @@ -306,5 +319,9 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen public void setGenerateNonSpringApplication(boolean generateNonSpringApplication) { this.generateNonSpringApplication = generateNonSpringApplication; } + + public void setUseGenericResponse(boolean useGenericResponse) { + this.useGenericResponse = useGenericResponse; + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index 8c6236ba038..7a49a59900c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -176,6 +176,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen if ("feign".equals(getLibrary())) { additionalProperties.put("jackson", "true"); supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); + supportingFiles.add(new SupportingFile("EncodingUtils.mustache", invokerFolder, "EncodingUtils.java")); } else if ("okhttp-gson".equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { // the "okhttp-gson" library template requires "ApiCallback.mustache" for async call supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java")); @@ -247,14 +248,14 @@ public class JavaClientCodegen extends AbstractJavaCodegen @Override public Map postProcessOperations(Map objs) { super.postProcessOperations(objs); - if(usesAnyRetrofitLibrary()) { + if (usesAnyRetrofitLibrary()) { Map operations = (Map) objs.get("operations"); if (operations != null) { List ops = (List) operations.get("operation"); for (CodegenOperation operation : ops) { if (operation.hasConsumes == Boolean.TRUE) { - if ( isMultipartType(operation.consumes) ) { + if (isMultipartType(operation.consumes)) { operation.isMultipart = Boolean.TRUE; } else { @@ -269,6 +270,27 @@ public class JavaClientCodegen extends AbstractJavaCodegen } } } + + // camelize path variables for Feign client + if ("feign".equals(getLibrary())) { + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + String path = new String(op.path); + String[] items = path.split("/", -1); + String opsPath = ""; + int pathParamIndex = 0; + + for (int i = 0; i < items.length; ++i) { + if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {} + // camelize path variable + items[i] = "{" + camelize(items[i].substring(1, items[i].length()-1), true) + "}"; + } + } + op.path = StringUtils.join(items, "/"); + } + } + return objs; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java index 2044b80fc80..3efd6dcd101 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java @@ -9,6 +9,7 @@ import io.swagger.codegen.SupportingFile; import java.io.File; import java.util.Arrays; import java.util.HashMap; +import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -20,6 +21,7 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC protected String groupId = "io.swagger"; protected String artifactId = "swagger-scala-client"; protected String artifactVersion = "1.0.0"; + protected String clientName = "AsyncClient"; public ScalaClientCodegen() { super(); @@ -51,10 +53,13 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC additionalProperties.put("asyncHttpClient", asyncHttpClient); additionalProperties.put("authScheme", authScheme); additionalProperties.put("authPreemptive", authPreemptive); + additionalProperties.put("clientName", clientName); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); supportingFiles.add(new SupportingFile("apiInvoker.mustache", (sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), "ApiInvoker.scala")); + supportingFiles.add(new SupportingFile("client.mustache", + (sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), clientName + ".scala")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); // gradle settings @@ -75,8 +80,8 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC importMapping.remove("Set"); importMapping.remove("Map"); - importMapping.put("DateTime", "org.joda.time.DateTime"); - importMapping.put("ListBuffer", "scala.collection.mutable.ListBuffer"); + importMapping.put("Date", "java.util.Date"); + importMapping.put("ListBuffer", "scala.collections.mutable.ListBuffer"); typeMapping = new HashMap(); typeMapping.put("enum", "NSString"); @@ -90,7 +95,6 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC typeMapping.put("byte", "Byte"); typeMapping.put("short", "Short"); typeMapping.put("char", "Char"); - typeMapping.put("long", "Long"); typeMapping.put("double", "Double"); typeMapping.put("object", "Any"); typeMapping.put("file", "File"); @@ -98,6 +102,10 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC // mapped to String as a workaround typeMapping.put("binary", "String"); typeMapping.put("ByteArray", "String"); + typeMapping.put("date-time", "Date"); +// typeMapping.put("date", "Date"); +// typeMapping.put("Date", "Date"); + typeMapping.put("DateTime", "Date"); instantiationTypes.put("array", "ListBuffer"); instantiationTypes.put("map", "HashMap"); @@ -108,7 +116,6 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC @Override public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java index 4f40703d098..a05461b093e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java @@ -46,7 +46,6 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { protected boolean swiftUseApiNamespace; protected String[] responseAs = new String[0]; protected String sourceFolder = "Classes" + File.separator + "Swaggers"; - private static final Pattern PATH_PARAM_PATTERN = Pattern.compile("\\{[a-zA-Z_]+\\}"); @Override public CodegenType getTag() { @@ -454,40 +453,6 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { return codegenModel; } - @Override - public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map definitions, Swagger swagger) { - path = normalizePath(path); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - // issue 3914 - removed logic designed to remove any parameter of type HeaderParameter - return super.fromOperation(path, httpMethod, operation, definitions, swagger); - } - - private static String normalizePath(String path) { - StringBuilder builder = new StringBuilder(); - - int cursor = 0; - Matcher matcher = PATH_PARAM_PATTERN.matcher(path); - boolean found = matcher.find(); - while (found) { - String stringBeforeMatch = path.substring(cursor, matcher.start()); - builder.append(stringBeforeMatch); - - String group = matcher.group().substring(1, matcher.group().length() - 1); - group = camelize(group, true); - builder - .append("{") - .append(group) - .append("}"); - - cursor = matcher.end(); - found = matcher.find(); - } - - String stringAfterMatch = path.substring(cursor); - builder.append(stringAfterMatch); - - return builder.toString(); - } - public void setProjectName(String projectName) { this.projectName = projectName; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java index 18c6f72e9cb..8c042f1220b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java @@ -8,39 +8,39 @@ import io.swagger.models.properties.Property; public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCodegen { - @Override - public String getName() { - return "typescript-angular"; - } + @Override + public String getName() { + return "typescript-angular"; + } - @Override - public String getHelp() { - return "Generates a TypeScript AngularJS client library."; - } + @Override + public String getHelp() { + return "Generates a TypeScript AngularJS client library."; + } - @Override - public void processOpts() { - super.processOpts(); - supportingFiles.add(new SupportingFile("models.mustache", modelPackage().replace('.', File.separatorChar), "models.ts")); + @Override + public void processOpts() { + super.processOpts(); + supportingFiles.add(new SupportingFile("models.mustache", modelPackage().replace('.', File.separatorChar), "models.ts")); supportingFiles.add(new SupportingFile("apis.mustache", apiPackage().replace('.', File.separatorChar), "api.ts")); supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts")); supportingFiles.add(new SupportingFile("api.module.mustache", getIndexDirectory(), "api.module.ts")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); - } - - public TypeScriptAngularClientCodegen() { - super(); - outputFolder = "generated-code/typescript-angular"; - modelTemplateFiles.put("model.mustache", ".ts"); + } + + public TypeScriptAngularClientCodegen() { + super(); + outputFolder = "generated-code/typescript-angular"; + modelTemplateFiles.put("model.mustache", ".ts"); apiTemplateFiles.put("api.mustache", ".ts"); - embeddedTemplateDir = templateDir = "typescript-angular"; - apiPackage = "api"; + embeddedTemplateDir = templateDir = "typescript-angular"; + apiPackage = "api"; modelPackage = "model"; - } + } - @Override + @Override public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); if(isLanguagePrimitive(swaggerType) || isLanguageGenericType(swaggerType)) { @@ -49,18 +49,18 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode return addModelPrefix(swaggerType); } - @Override + @Override public void postProcessParameter(CodegenParameter parameter) { super.postProcessParameter(parameter); parameter.dataType = addModelPrefix(parameter.dataType); } - private String getIndexDirectory() { + private String getIndexDirectory() { String indexPackage = modelPackage.substring(0, Math.max(0, modelPackage.lastIndexOf('.'))); return indexPackage.replace('.', File.separatorChar); } - private String addModelPrefix(String swaggerType) { + private String addModelPrefix(String swaggerType) { String type = null; if (typeMapping.containsKey(swaggerType)) { type = typeMapping.get(swaggerType); @@ -74,7 +74,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode return type; } - private boolean isLanguagePrimitive(String type) { + private boolean isLanguagePrimitive(String type) { return languageSpecificPrimitives.contains(type); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/UseGenericResponseFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/UseGenericResponseFeatures.java new file mode 100644 index 00000000000..e4acbb9ca65 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/UseGenericResponseFeatures.java @@ -0,0 +1,9 @@ +package io.swagger.codegen.languages.features; + +public interface UseGenericResponseFeatures { + + // Language supports generating generic Jaxrs or native return types + public static final String USE_GENERIC_RESPONSE = "useGenericResponse"; + + public void setUseGenericResponse(boolean useGenericResponse); +} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/EncodingUtils.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/EncodingUtils.mustache new file mode 100644 index 00000000000..6f43e1c3c2a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/EncodingUtils.mustache @@ -0,0 +1,86 @@ +package {{invokerPackage}}; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** +* Utilities to support Swagger encoding formats in Feign. +*/ +public final class EncodingUtils { + + /** + * Private constructor. Do not construct this class. + */ + private EncodingUtils() {} + + /** + *

Encodes a collection of query parameters according to the Swagger + * collection format.

+ * + *

Of the various collection formats defined by Swagger ("csv", "tsv", + * etc), Feign only natively supports "multi". This utility generates the + * other format types so it will be properly processed by Feign.

+ * + *

Note, as part of reformatting, it URL encodes the parameters as + * well.

+ * @param parameters The collection object to be formatted. This object will + * not be changed. + * @param collectionFormat The Swagger collection format (eg, "csv", "tsv", + * "pipes"). See the + * + * Swagger Spec for more details. + * @return An object that will be correctly formatted by Feign. + */ + public static Object encodeCollection(Collection parameters, + String collectionFormat) { + if (parameters == null) { + return parameters; + } + List stringValues = new ArrayList<>(parameters.size()); + for (Object parameter : parameters) { + // ignore null values (same behavior as Feign) + if (parameter != null) { + stringValues.add(encode(parameter)); + } + } + // Feign natively handles single-element lists and the "multi" format. + if (stringValues.size() < 2 || "multi".equals(collectionFormat)) { + return stringValues; + } + // Otherwise return a formatted String + String[] stringArray = stringValues.toArray(new String[0]); + switch (collectionFormat) { + case "csv": + default: + return StringUtil.join(stringArray, ","); + case "ssv": + return StringUtil.join(stringArray, " "); + case "tsv": + return StringUtil.join(stringArray, "\t"); + case "pipes": + return StringUtil.join(stringArray, "|"); + } + } + + /** + * URL encode a single query parameter. + * @param parameter The query parameter to encode. This object will not be + * changed. + * @return The URL encoded string representation of the parameter. If the + * parameter is null, returns null. + */ + public static String encode(Object parameter) { + if (parameter == null) { + return null; + } + try { + return URLEncoder.encode(parameter.toString(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache index 6aadf2305d1..67a772a8772 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache @@ -1,6 +1,7 @@ package {{package}}; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.EncodingUtils; {{#legacyDates}} import {{invokerPackage}}.ParamExpander; {{/legacyDates}} @@ -71,7 +72,7 @@ public interface {{classname}} extends ApiClient.Api { "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}}, {{/hasMore}}{{/headerParams}} }) - {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap Map queryParams); + {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -80,7 +81,12 @@ public interface {{classname}} extends ApiClient.Api { public static class {{operationIdCamelCase}}QueryParams extends HashMap { {{#queryParams}} public {{operationIdCamelCase}}QueryParams {{paramName}}(final {{{dataType}}} value) { - put("{{baseName}}", value); + {{#collectionFormat}} + put("{{baseName}}", EncodingUtils.encodeCollection(value, "{{collectionFormat}}")); + {{/collectionFormat}} + {{^collectionFormat}} + put("{{baseName}}", EncodingUtils.encode(value)); + {{/collectionFormat}} return this; } {{/queryParams}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache index d823f258557..c7d253ad685 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache @@ -246,6 +246,18 @@ ${junit-version} test + + com.squareup.okhttp3 + mockwebserver + 3.6.0 + test + + + org.assertj + assertj-core + 1.7.1 + test + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache index 50f510e7c48..da5543473a4 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 {{#java8}} 1.8 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache index 05c0e7dbe3a..b7fbdb15fe4 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 1.7 1.7 diff --git a/modules/swagger-codegen/src/main/resources/Java/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/pom.mustache index e26feaf5d0a..72ec7559c06 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pom.mustache @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 {{#java8}} 1.8 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache index ea21a5635c1..d216ed02538 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache @@ -31,7 +31,7 @@ public class {{classname}}ServiceImpl implements {{classname}} { public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { // TODO: Implement... - {{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}} + {{#useGenericResponse}}return Response.ok().entity("magic!").build();{{/useGenericResponse}}{{^useGenericResponse}}{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}{{/useGenericResponse}} } {{/operation}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache index 85de81431b6..1746a84649c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache @@ -26,12 +26,16 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum } @Override +{{#jackson}} @JsonValue +{{/jackson}} public String toString() { return String.valueOf(value); } +{{#jackson}} @JsonCreator +{{/jackson}} public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(text)) { @@ -40,4 +44,5 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum } return null; } + } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache index c8f7a56938a..8e6066c8c84 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache @@ -1 +1,4 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +}}{{^useGenericResponse}}{{! +}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{! +}}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache index 8c8c377ee7f..8e2790095b1 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache @@ -104,11 +104,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/modules/swagger-codegen/src/main/resources/android/pom.mustache b/modules/swagger-codegen/src/main/resources/android/pom.mustache index 758e9d62d07..355163a0455 100644 --- a/modules/swagger-codegen/src/main/resources/android/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/pom.mustache @@ -98,10 +98,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache index d48d031860e..87d830e3e6a 100644 --- a/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache +++ b/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache @@ -23,3 +23,4 @@ class {{clientName}}(config: SwaggerConfig) extends Closeable { client.close() } } + diff --git a/modules/swagger-codegen/src/main/resources/codegen/pom.mustache b/modules/swagger-codegen/src/main/resources/codegen/pom.mustache index 30f1b14872c..11e4a76e337 100644 --- a/modules/swagger-codegen/src/main/resources/codegen/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/codegen/pom.mustache @@ -78,10 +78,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache index 8d9f9bf344e..2ecdbadc8b0 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache @@ -22,5 +22,5 @@ copy packages\Fody.1.29.2\Fody.dll bin\Fody.dll copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll {{/generatePropertyChanged}} -%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml +%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml diff --git a/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache index 5593bfdd94f..4a2fa5f58a3 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache @@ -7,7 +7,7 @@ wget -nc https://nuget.org/nuget.exe mozroots --import --sync echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" -rm src/IO.Swagger.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null +rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null echo "[INFO] install NUnit runners via NuGet" wget -nc https://nuget.org/nuget.exe diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache index c3dd3effe7d..5c8c5ec07b4 100644 --- a/modules/swagger-codegen/src/main/resources/scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache @@ -1,10 +1,11 @@ {{>licenseInfo}} package {{package}} +import java.text.SimpleDateFormat + {{#imports}}import {{import}} {{/imports}} -import {{invokerPackage}}.ApiInvoker -import {{invokerPackage}}.ApiException +import {{invokerPackage}}.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -16,13 +17,42 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + {{#operations}} class {{classname}}(val defBasePath: String = "{{{basePath}}}", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new {{classname}}AsyncHelper(client, config) {{#operation}} /** @@ -32,97 +62,82 @@ class {{classname}}(val defBasePath: String = "{{{basePath}}}", {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ def {{operationId}}({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Option[{{returnType}}]{{/returnType}} = { - // create path and map variables - val path = "{{{path}}}".replaceAll("\\{format\\}", "json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",apiInvoker.escape({{paramName}})){{/pathParams}} - - val contentTypes = List({{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}"application/json"{{/consumes}}) - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - {{#allParams}} - {{#required}} - {{^isPrimitiveType}} - if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") - - {{/isPrimitiveType}} - {{#isString}} - if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") - - {{/isString}} - {{/required}} - {{/allParams}} - {{#queryParams}} - {{#required}} - queryParams += "{{baseName}}" -> {{paramName}}.toString - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => queryParams += "{{baseName}}" -> paramVal.toString) - {{/required}} - {{/queryParams}} - - {{#headerParams}} - {{#required}} - headerParams += "{{baseName}}" -> {{paramName}} - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => headerParams += "{{baseName}}" -> paramVal) - {{/required}} - {{/headerParams}} - - var postBody: AnyRef = {{#bodyParam}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}.map(paramVal => paramVal){{/required}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}} - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - {{#formParams}} - {{#notFile}} - {{#required}} - mp.field("{{baseName}}", {{paramName}}.toString, MediaType.MULTIPART_FORM_DATA_TYPE) - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => mp.field("{{baseName}}", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - {{/required}} - {{/notFile}} - {{#isFile}} - {{#required}} - mp.field("{{baseName}}", file.getName) - mp.bodyPart(new FileDataBodyPart("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE)) - {{/required}} - {{^required}} - file.map(fileVal => mp.field("{{baseName}}", fileVal.getName)) - {{paramName}}.map(paramVal => mp.bodyPart(new FileDataBodyPart("{{baseName}}", paramVal, MediaType.MULTIPART_FORM_DATA_TYPE))) - {{/required}} - {{/isFile}} - {{/formParams}} - postBody = mp - } else { - {{#formParams}} - {{#notFile}} - {{#required}} - formParams += "{{baseName}}" -> {{paramName}}.toString - {{/required}} - {{^required}} - {{paramName}}.map(paramVal => formParams += "{{baseName}}" -> paramVal.toString) - {{/required}} - {{/notFile}} - {{/formParams}} - } - - try { - apiInvoker.invokeApi(basePath, path, "{{httpMethod}}", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - {{#returnType}} Some(apiInvoker.deserialize(s, "{{returnContainer}}", classOf[{{returnBaseType}}]).asInstanceOf[{{returnType}}]) - {{/returnType}} - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + val await = Try(Await.result({{operationId}}Async({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } } + /** + * {{summary}} asynchronously + * {{notes}} +{{#allParams}} * @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} * @return Future({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}) + */ + def {{operationId}}Async({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}} = { + helper.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + } + + {{/operation}} } + +class {{classname}}AsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + +{{#operation}} + def {{operationId}}({{#allParams}}{{^required}}{{paramName}}: Option[{{dataType}}] = {{#defaultValue}}Some({{defaultValue}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{#hasMore}},{{/hasMore}} + {{/required}}{{#required}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, + {{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{dataType}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = { + // create path and map variables + val path = (addFmt("{{path}}"){{#pathParams}} + replaceAll ("\\{" + "{{baseName}}" + "\\}",{{paramName}}.toString){{/pathParams}}) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + {{#allParams}} + {{#required}} + {{^isPrimitiveType}} + if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") + {{/isPrimitiveType}} + {{#isString}} + if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") + + {{/isString}} + {{/required}} + {{/allParams}} + {{#queryParams}} + {{^required}} + {{paramName}} match { + case Some(param) => queryParams += "{{baseName}}" -> param.toString + case _ => queryParams + } + {{/required}} + {{#required}} + queryParams += "{{baseName}}" -> {{paramName}}.toString + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{^required}} + {{paramName}} match { + case Some(param) => headerParams += "{{baseName}}" -> param.toString + case _ => headerParams + } + {{/required}} + {{#required}} + headerParams += "{{baseName}}" -> {{paramName}}.toString + {{/required}} + {{/headerParams}} + + val resFuture = client.submit("{{httpMethod}}", path, queryParams.toMap, headerParams.toMap, {{#bodyParam}}writer.write({{paramName}}){{/bodyParam}}{{^bodyParam}}"{{emptyBodyParam}}"{{/bodyParam}}) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + +{{/operation}} + +} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache index 88faa3610b2..e124eb0a5c7 100644 --- a/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache @@ -104,6 +104,12 @@ ext { jackson_version = "2.4.2" junit_version = "4.8.1" scala_test_version = "2.2.4" + swagger_async_httpclient_version = "0.3.5" +} + +repositories { + mavenLocal() + mavenCentral() } dependencies { @@ -117,4 +123,5 @@ dependencies { testCompile "junit:junit:$junit_version" compile "joda-time:joda-time:$jodatime_version" compile "org.joda:joda-convert:$joda_version" + compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version" } diff --git a/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache index 6a198acb832..24ee01b6fd5 100644 --- a/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/build.sbt.mustache @@ -1,33 +1,34 @@ -lazy val root = (project in file(".")). - settings( - version := "{{artifactVersion}}", - name := "{{artifactId}}", - organization := "{{groupId}}", - scalaVersion := "2.11.8", +version := "{{artifactVersion}}" - libraryDependencies ++= Seq( - "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", - "com.sun.jersey" % "jersey-core" % "1.19", - "com.sun.jersey" % "jersey-client" % "1.19", - "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", - "org.jfarcand" % "jersey-ahc-client" % "1.0.5", - "io.swagger" % "swagger-core" % "1.5.8", - "joda-time" % "joda-time" % "2.2", - "org.joda" % "joda-convert" % "1.2", - "org.scalatest" %% "scalatest" % "2.2.4" % "test", - "junit" % "junit" % "4.8.1" % "test" - ), +name := "{{artifactId}}" - resolvers ++= Seq( - Resolver.jcenterRepo, - Resolver.mavenLocal - ), +organization := "{{groupId}}" - scalacOptions := Seq( - "-unchecked", - "-deprecation", - "-feature" - ), +scalaVersion := "2.11.8" + +libraryDependencies ++= Seq( + "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", + "com.sun.jersey" % "jersey-core" % "1.19", + "com.sun.jersey" % "jersey-client" % "1.19", + "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", + "org.jfarcand" % "jersey-ahc-client" % "1.0.5", + "io.swagger" % "swagger-core" % "1.5.8", + "joda-time" % "joda-time" % "2.2", + "org.joda" % "joda-convert" % "1.2", + "org.scalatest" %% "scalatest" % "2.2.4" % "test", + "junit" % "junit" % "4.8.1" % "test", + "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5" +) + +resolvers ++= Seq( + Resolver.mavenLocal +) + +scalacOptions := Seq( + "-unchecked", + "-deprecation", + "-feature" +) + +publishArtifact in (Compile, packageDoc) := false - publishArtifact in (Compile, packageDoc) := false - ) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scala/client.mustache b/modules/swagger-codegen/src/main/resources/scala/client.mustache new file mode 100644 index 00000000000..8098b73c6bb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scala/client.mustache @@ -0,0 +1,22 @@ +package {{invokerPackage}} + +{{#imports}}import {{import}} +{{/imports}} +import {{apiPackage}}._ + +import com.wordnik.swagger.client._ + +import java.io.Closeable + +class {{clientName}}(config: SwaggerConfig) extends Closeable { + val locator = config.locator + val name = config.name + + private[this] val client = transportClient + + protected def transportClient: TransportClient = new RestClient(config) + + def close() { + client.close() + } +} diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index f0292f5789d..d459d29a975 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -103,10 +103,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 @@ -209,6 +209,11 @@ joda-convert ${joda-version} + + com.wordnik.swagger + swagger-async-httpclient_2.10 + ${swagger-async-httpclient-version} + 2.10.4 @@ -223,6 +228,7 @@ 4.8.1 3.1.5 2.2.4 + 0.3.5 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/swift3/_param.mustache b/modules/swagger-codegen/src/main/resources/swift3/_param.mustache index 6d2de20a655..5caacbc6005 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/_param.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/_param.mustache @@ -1 +1 @@ -"{{baseName}}": {{paramName}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}} \ No newline at end of file +"{{baseName}}": {{paramName}}{{^isEnum}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{/isEnum}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index bce8b51bb40..46e03f00338 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -279,7 +279,7 @@ export enum {{classname}}ApiKeys { } export class {{classname}} { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -326,6 +326,14 @@ export class {{classname}} { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: {{classname}}ApiKeys, value: string) { this.authentications[{{classname}}ApiKeys[key]].apiKey = value; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java index 6b9c3a3c5b1..ff69e4b36bf 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/InlineModelResolverTest.java @@ -1,6 +1,5 @@ package io.swagger.codegen; - import io.swagger.models.*; import io.swagger.models.parameters.BodyParameter; import io.swagger.models.parameters.Parameter; @@ -161,7 +160,7 @@ public class InlineModelResolverTest { .name("name") .property("street", new StringProperty()) .property("city", new StringProperty()) - .property("apartment", new StringProperty()))); + .property("apartment", new StringProperty()))); new InlineModelResolver().flatten(swagger); @@ -206,7 +205,7 @@ public class InlineModelResolverTest { Response response = responses.get("200"); assertNotNull(response); Property schema = response.getSchema(); - assertTrue(schema instanceof RefProperty); + assertTrue(schema instanceof RefProperty); assertEquals(1, schema.getVendorExtensions().size()); assertEquals("ext-prop", schema.getVendorExtensions().get("x-ext")); @@ -222,7 +221,7 @@ public class InlineModelResolverTest { Swagger swagger = new Swagger(); String responseTitle = "GetBarResponse"; - swagger.path("/foo/bar", new Path() + swagger.path("/foo/bar", new Path() .get(new Operation() .response(200, new Response() .description("it works!") @@ -336,8 +335,8 @@ public class InlineModelResolverTest { ModelImpl addressModelItem = new ModelImpl(); String addressModelName = "DetailedAddress"; - addressModelItem.setTitle(addressModelName); - swagger.path("/hello", new Path() + addressModelItem.setTitle(addressModelName); + swagger.path("/hello", new Path() .get(new Operation() .parameter(new BodyParameter() .name("body") @@ -436,12 +435,12 @@ public class InlineModelResolverTest { public void resolveInlineArrayResponse() throws Exception { Swagger swagger = new Swagger(); - ArrayProperty schema = new ArrayProperty() - .items(new ObjectProperty() - .property("name", new StringProperty()) - .vendorExtension("x-ext", "ext-items")) - .vendorExtension("x-ext", "ext-prop"); - swagger.path("/foo/baz", new Path() + ArrayProperty schema = new ArrayProperty() + .items(new ObjectProperty() + .property("name", new StringProperty()) + .vendorExtension("x-ext", "ext-items")) + .vendorExtension("x-ext", "ext-prop"); + swagger.path("/foo/baz", new Path() .get(new Operation() .response(200, new Response() .vendorExtension("x-foo", "bar") @@ -487,15 +486,14 @@ public class InlineModelResolverTest { Swagger swagger = new Swagger(); swagger.path("/foo/baz", new Path() - .get(new Operation() - .response(200, new Response() - .vendorExtension("x-foo", "bar") - .description("it works!") - .schema(new ArrayProperty() - .items( - new ObjectProperty() - .title("FooBar") - .property("name", new StringProperty())))))); + .get(new Operation() + .response(200, new Response() + .vendorExtension("x-foo", "bar") + .description("it works!") + .schema(new ArrayProperty() + .items(new ObjectProperty() + .title("FooBar") + .property("name", new StringProperty())))))); new InlineModelResolver().flatten(swagger); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java index 6f6ed93084f..d48a2ccddea 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFClientOptionsTest.java @@ -4,6 +4,7 @@ import io.swagger.codegen.AbstractOptionsTest; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.languages.JavaCXFClientCodegen; import io.swagger.codegen.options.JavaCXFClientOptionsProvider; +import io.swagger.codegen.options.JavaCXFServerOptionsProvider; import io.swagger.codegen.options.OptionsProvider; import mockit.Expectations; import mockit.Tested; @@ -59,6 +60,9 @@ public class JaxrsCXFClientOptionsTest extends AbstractOptionsTest { clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_BEANVALIDATION)); times = 1; + clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE)); + times = 1; + clientCodegen.setUseLoggingFeatureForTests( Boolean.valueOf(JavaCXFClientOptionsProvider.USE_LOGGING_FEATURE_FOR_TESTS)); times = 1; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java index ef3de3a8900..aad1b0344e9 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxrsCXFServerOptionsTest.java @@ -80,6 +80,8 @@ public class JaxrsCXFServerOptionsTest extends AbstractOptionsTest { clientCodegen.setUseBeanValidationFeature( Boolean.valueOf(JavaCXFServerOptionsProvider.USE_BEANVALIDATION_FEATURE)); times = 1; + clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFServerOptionsProvider.USE_GENERIC_RESPONSE)); + times = 1; clientCodegen.setGenerateSpringBootApplication( Boolean.valueOf(JavaCXFServerOptionsProvider.GENERATE_SPRING_BOOT_APPLICATION)); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java index 2dceedacf93..e761f2ec088 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaClientCodegenTest.java @@ -10,70 +10,68 @@ import org.testng.Assert; import org.testng.annotations.Test; public class JavaClientCodegenTest { - - private static final String VENDOR_MIME_TYPE = "application/vnd.company.v1+json"; - private static final String XML_MIME_TYPE = "application/xml"; - private static final String JSON_MIME_TYPE = "application/json"; - private static final String TEXT_MIME_TYPE = "text/plain"; - @Test - public void testJsonMime() { - Assert.assertTrue(JavaClientCodegen.isJsonMimeType(JSON_MIME_TYPE)); - Assert.assertFalse(JavaClientCodegen.isJsonMimeType(XML_MIME_TYPE)); - Assert.assertFalse(JavaClientCodegen.isJsonMimeType(TEXT_MIME_TYPE)); - - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany+json")); - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.v1+json")); - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeA.version1+json")); - Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeB.version2+json")); - Assert.assertFalse(JavaClientCodegen.isJsonVendorMimeType("application/v.json")); - - } - - @Test - public void testContentTypePrioritization() { - Map jsonMimeType = new HashMap<>(); - jsonMimeType.put(JavaClientCodegen.MEDIA_TYPE, JSON_MIME_TYPE); + private static final String VENDOR_MIME_TYPE = "application/vnd.company.v1+json"; + private static final String XML_MIME_TYPE = "application/xml"; + private static final String JSON_MIME_TYPE = "application/json"; + private static final String TEXT_MIME_TYPE = "text/plain"; - Map xmlMimeType = new HashMap<>(); - xmlMimeType.put(JavaClientCodegen.MEDIA_TYPE, XML_MIME_TYPE); + @Test + public void testJsonMime() { + Assert.assertTrue(JavaClientCodegen.isJsonMimeType(JSON_MIME_TYPE)); + Assert.assertFalse(JavaClientCodegen.isJsonMimeType(XML_MIME_TYPE)); + Assert.assertFalse(JavaClientCodegen.isJsonMimeType(TEXT_MIME_TYPE)); - Map vendorMimeType = new HashMap<>(); - vendorMimeType.put(JavaClientCodegen.MEDIA_TYPE, VENDOR_MIME_TYPE); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany+json")); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.v1+json")); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeA.version1+json")); + Assert.assertTrue(JavaClientCodegen.isJsonVendorMimeType("application/vnd.mycompany.resourceTypeB.version2+json")); + Assert.assertFalse(JavaClientCodegen.isJsonVendorMimeType("application/v.json")); - Map textMimeType = new HashMap<>(); - textMimeType.put(JavaClientCodegen.MEDIA_TYPE, TEXT_MIME_TYPE); + } - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes( - Collections.>emptyList()), Collections.emptyList()); + @Test + public void testContentTypePrioritization() { + Map jsonMimeType = new HashMap<>(); + jsonMimeType.put(JavaClientCodegen.MEDIA_TYPE, JSON_MIME_TYPE); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType)), Arrays.asList(xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType)), Arrays.asList(jsonMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(vendorMimeType)), Arrays.asList(vendorMimeType)); + Map xmlMimeType = new HashMap<>(); + xmlMimeType.put(JavaClientCodegen.MEDIA_TYPE, XML_MIME_TYPE); - - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, jsonMimeType)), - Arrays.asList(jsonMimeType, xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, xmlMimeType)), - Arrays.asList(jsonMimeType, xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, vendorMimeType)), - Arrays.asList(vendorMimeType, jsonMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(textMimeType, xmlMimeType)), - Arrays.asList(textMimeType, xmlMimeType)); - Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, textMimeType)), - Arrays.asList(xmlMimeType, textMimeType)); - - System.out.println(JavaClientCodegen.prioritizeContentTypes(Arrays.asList( - xmlMimeType,textMimeType, jsonMimeType, vendorMimeType))); - - List> priContentTypes = JavaClientCodegen.prioritizeContentTypes(Arrays.asList( - xmlMimeType, textMimeType, jsonMimeType, vendorMimeType)); - Assert.assertEquals(priContentTypes, Arrays.asList(vendorMimeType, jsonMimeType, xmlMimeType, textMimeType)); - - for ( int i = 0; i < 3; i++ ) - Assert.assertNotNull(priContentTypes.get(i).get("hasMore")); - Assert.assertNull(priContentTypes.get(3).get("hasMore")); - - } - + Map vendorMimeType = new HashMap<>(); + vendorMimeType.put(JavaClientCodegen.MEDIA_TYPE, VENDOR_MIME_TYPE); + + Map textMimeType = new HashMap<>(); + textMimeType.put(JavaClientCodegen.MEDIA_TYPE, TEXT_MIME_TYPE); + + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes( + Collections.>emptyList()), Collections.emptyList()); + + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType)), Arrays.asList(xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType)), Arrays.asList(jsonMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(vendorMimeType)), Arrays.asList(vendorMimeType)); + + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, jsonMimeType)), + Arrays.asList(jsonMimeType, xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, xmlMimeType)), + Arrays.asList(jsonMimeType, xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, vendorMimeType)), + Arrays.asList(vendorMimeType, jsonMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(textMimeType, xmlMimeType)), + Arrays.asList(textMimeType, xmlMimeType)); + Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, textMimeType)), + Arrays.asList(xmlMimeType, textMimeType)); + + System.out.println(JavaClientCodegen.prioritizeContentTypes(Arrays.asList( + xmlMimeType,textMimeType, jsonMimeType, vendorMimeType))); + + List> priContentTypes = JavaClientCodegen.prioritizeContentTypes(Arrays.asList( + xmlMimeType, textMimeType, jsonMimeType, vendorMimeType)); + Assert.assertEquals(priContentTypes, Arrays.asList(vendorMimeType, jsonMimeType, xmlMimeType, textMimeType)); + + for ( int i = 0; i < 3; i++ ) + Assert.assertNotNull(priContentTypes.get(i).get("hasMore")); + + Assert.assertNull(priContentTypes.get(3).get("hasMore")); + } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java index 2633702d112..5c415e84a1f 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AspNetCoreServerOptionsProvider.java @@ -10,7 +10,7 @@ public class AspNetCoreServerOptionsProvider implements OptionsProvider { public static final String PACKAGE_NAME_VALUE = "swagger_server_aspnetcore"; public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String SOURCE_FOLDER_VALUE = "src_aspnetcore"; - + @Override public String getLanguage() { return "aspnetcore"; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java index afafd6ecf2f..d042e212da4 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFClientOptionsProvider.java @@ -16,6 +16,8 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider { public static final String USE_LOGGING_FEATURE_FOR_TESTS = "true"; + public static final String USE_GENERIC_RESPONSE = "true"; + @Override public boolean isServer() { @@ -36,6 +38,7 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider { .putAll(parentOptions); builder.put(JavaCXFClientCodegen.USE_BEANVALIDATION, JavaCXFClientOptionsProvider.USE_BEANVALIDATION); + builder.put(JavaCXFClientCodegen.USE_GENERIC_RESPONSE, JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE); builder.put(JavaCXFClientCodegen.USE_JAXB_ANNOTATIONS, USE_JAXB_ANNOTATIONS); builder.put(JavaCXFClientCodegen.USE_GZIP_FEATURE_FOR_TESTS, USE_GZIP_FEATURE_FOR_TESTS); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java index f7cad3d6ccf..b343cdacb70 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaCXFServerOptionsProvider.java @@ -31,6 +31,8 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider { public static final String USE_BEANVALIDATION_FEATURE = "true"; + public static final String USE_GENERIC_RESPONSE = "true"; + public static final String USE_SPRING_ANNOTATION_CONFIG = "true"; public static final String GENERATE_SPRING_BOOT_APPLICATION = "true"; @@ -82,6 +84,7 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider { builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE, USE_LOGGING_FEATURE); builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE_FOR_TESTS, USE_LOGGING_FEATURE_FOR_TESTS); builder.put(JavaCXFServerCodegen.USE_BEANVALIDATION_FEATURE, USE_BEANVALIDATION_FEATURE); + builder.put(JavaCXFServerCodegen.USE_GENERIC_RESPONSE, USE_GENERIC_RESPONSE); builder.put(JavaCXFServerCodegen.GENERATE_SPRING_BOOT_APPLICATION, GENERATE_SPRING_BOOT_APPLICATION); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java index 95e08c6b362..57b9023b077 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/scala/ScalaModelTest.java @@ -66,10 +66,10 @@ public class ScalaModelTest { Assert.assertEquals(property3.baseName, "createdAt"); Assert.assertEquals(property3.getter, "getCreatedAt"); Assert.assertEquals(property3.setter, "setCreatedAt"); - Assert.assertEquals(property3.datatype, "DateTime"); + Assert.assertEquals(property3.datatype, "Date"); Assert.assertEquals(property3.name, "createdAt"); Assert.assertEquals(property3.defaultValue, "null"); - Assert.assertEquals(property3.baseType, "DateTime"); + Assert.assertEquals(property3.baseType, "Date"); Assert.assertFalse(property3.hasMore); Assert.assertFalse(property3.required); Assert.assertTrue(property3.isNotContainer); diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 8efbc716a0e..4d21a912a52 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -324,7 +324,7 @@ paths: $ref: '#/definitions/Order' '400': description: Invalid Order - '/store/order/{orderId}': + '/store/order/{order_id}': get: tags: - store @@ -335,7 +335,7 @@ paths: - application/xml - application/json parameters: - - name: orderId + - name: order_id in: path description: ID of pet that needs to be fetched required: true @@ -362,7 +362,7 @@ paths: - application/xml - application/json parameters: - - name: orderId + - name: order_id in: path description: ID of the order that needs to be deleted required: true diff --git a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache index 07e857e75df..96df77be8e9 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache @@ -27,6 +27,7 @@ import java.io.InputStream; {{^supportJava6}} import java.nio.file.Files; +import java.nio.file.StandardCopyOption; {{/supportJava6}} {{#supportJava6}} import org.apache.commons.io.FileUtils; @@ -581,7 +582,7 @@ public class ApiClient { try { File file = prepareDownloadFile(response); {{^supportJava6}} - Files.copy(response.readEntity(InputStream.class), file.toPath()); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); {{/supportJava6}} {{#supportJava6}} // Java6 falls back to commons.io for file copying diff --git a/pom.xml b/pom.xml index 2c5a5ec152e..2f244cfaf62 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ maven-compiler-plugin - 3.5.1 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/akka-scala/pom.xml b/samples/client/petstore/akka-scala/pom.xml index 0715ac9c4f6..38d1f45025b 100644 --- a/samples/client/petstore/akka-scala/pom.xml +++ b/samples/client/petstore/akka-scala/pom.xml @@ -104,11 +104,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index 5ba936a5701..75ef31f534d 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -98,10 +98,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala index f9f2e5d6216..7c4afb20e09 100644 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala +++ b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala @@ -25,3 +25,4 @@ class SwaggerClient(config: SwaggerConfig) extends Closeable { client.close() } } + diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index dd1aa609375..146c4b25ed1 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -412,7 +412,7 @@ case $state in deleteOrder) local -a _op_arguments _op_arguments=( - "orderId=:[PATH] ID of the order that needs to be deleted" + "order_id=:[PATH] ID of the order that needs to be deleted" ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; @@ -425,7 +425,7 @@ case $state in getOrderById) local -a _op_arguments _op_arguments=( - "orderId=:[PATH] ID of pet that needs to be fetched" + "order_id=:[PATH] ID of pet that needs to be fetched" ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index c6c5c807582..49f3c81ba16 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -103,8 +103,8 @@ operation_parameters_minimum_occurences["updatePetWithForm:::status"]=0 operation_parameters_minimum_occurences["uploadFile:::petId"]=1 operation_parameters_minimum_occurences["uploadFile:::additionalMetadata"]=0 operation_parameters_minimum_occurences["uploadFile:::file"]=0 -operation_parameters_minimum_occurences["deleteOrder:::orderId"]=1 -operation_parameters_minimum_occurences["getOrderById:::orderId"]=1 +operation_parameters_minimum_occurences["deleteOrder:::order_id"]=1 +operation_parameters_minimum_occurences["getOrderById:::order_id"]=1 operation_parameters_minimum_occurences["placeOrder:::body"]=1 operation_parameters_minimum_occurences["createUser:::body"]=1 operation_parameters_minimum_occurences["createUsersWithArrayInput:::body"]=1 @@ -160,8 +160,8 @@ operation_parameters_maximum_occurences["updatePetWithForm:::status"]=0 operation_parameters_maximum_occurences["uploadFile:::petId"]=0 operation_parameters_maximum_occurences["uploadFile:::additionalMetadata"]=0 operation_parameters_maximum_occurences["uploadFile:::file"]=0 -operation_parameters_maximum_occurences["deleteOrder:::orderId"]=0 -operation_parameters_maximum_occurences["getOrderById:::orderId"]=0 +operation_parameters_maximum_occurences["deleteOrder:::order_id"]=0 +operation_parameters_maximum_occurences["getOrderById:::order_id"]=0 operation_parameters_maximum_occurences["placeOrder:::body"]=0 operation_parameters_maximum_occurences["createUser:::body"]=0 operation_parameters_maximum_occurences["createUsersWithArrayInput:::body"]=0 @@ -214,8 +214,8 @@ operation_parameters_collection_type["updatePetWithForm:::status"]="" operation_parameters_collection_type["uploadFile:::petId"]="" operation_parameters_collection_type["uploadFile:::additionalMetadata"]="" operation_parameters_collection_type["uploadFile:::file"]="" -operation_parameters_collection_type["deleteOrder:::orderId"]="" -operation_parameters_collection_type["getOrderById:::orderId"]="" +operation_parameters_collection_type["deleteOrder:::order_id"]="" +operation_parameters_collection_type["getOrderById:::order_id"]="" operation_parameters_collection_type["placeOrder:::body"]="" operation_parameters_collection_type["createUser:::body"]="" operation_parameters_collection_type["createUsersWithArrayInput:::body"]= @@ -1434,7 +1434,7 @@ print_deleteOrder_help() { echo -e "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" | fold -sw 80 echo -e "" echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)" - echo -e " * $(tput setaf 2)orderId$(tput sgr0) $(tput setaf 4)[String]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of the order that needs to be deleted $(tput setaf 3)Specify as: orderId=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * $(tput setaf 2)order_id$(tput sgr0) $(tput setaf 4)[String]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of the order that needs to be deleted $(tput setaf 3)Specify as: order_id=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)" case 400 in @@ -1524,7 +1524,7 @@ print_getOrderById_help() { echo -e "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions" | fold -sw 80 echo -e "" echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)" - echo -e " * $(tput setaf 2)orderId$(tput sgr0) $(tput setaf 4)[Integer]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of pet that needs to be fetched $(tput setaf 3)Specify as: orderId=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * $(tput setaf 2)order_id$(tput sgr0) $(tput setaf 4)[Integer]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of pet that needs to be fetched $(tput setaf 3)Specify as: order_id=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)" case 200 in @@ -2586,14 +2586,14 @@ call_uploadFile() { # ############################################################################## call_deleteOrder() { - local path_parameter_names=(orderId) + local path_parameter_names=(order_id) local query_parameter_names=() if [[ $force = false ]]; then - validate_request_parameters "/v2/store/order/{orderId}" path_parameter_names query_parameter_names + validate_request_parameters "/v2/store/order/{order_id}" path_parameter_names query_parameter_names fi - local path=$(build_request_path "/v2/store/order/{orderId}" path_parameter_names query_parameter_names) + local path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names) local method="DELETE" local headers_curl=$(header_arguments_to_curl) if [[ -n $header_accept ]]; then @@ -2648,14 +2648,14 @@ call_getInventory() { # ############################################################################## call_getOrderById() { - local path_parameter_names=(orderId) + local path_parameter_names=(order_id) local query_parameter_names=() if [[ $force = false ]]; then - validate_request_parameters "/v2/store/order/{orderId}" path_parameter_names query_parameter_names + validate_request_parameters "/v2/store/order/{order_id}" path_parameter_names query_parameter_names fi - local path=$(build_request_path "/v2/store/order/{orderId}" path_parameter_names query_parameter_names) + local path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names) local method="GET" local headers_curl=$(header_arguments_to_curl) if [[ -n $header_accept ]]; then diff --git a/samples/client/petstore/bash/petstore-cli.bash-completion b/samples/client/petstore/bash/petstore-cli.bash-completion index a4c2fd3d580..e6b4c37801c 100644 --- a/samples/client/petstore/bash/petstore-cli.bash-completion +++ b/samples/client/petstore/bash/petstore-cli.bash-completion @@ -108,9 +108,9 @@ _petstore-cli() operation_parameters["updatePet"]="" operation_parameters["updatePetWithForm"]="petId= " operation_parameters["uploadFile"]="petId= " - operation_parameters["deleteOrder"]="orderId= " + operation_parameters["deleteOrder"]="order_id= " operation_parameters["getInventory"]="" - operation_parameters["getOrderById"]="orderId= " + operation_parameters["getOrderById"]="order_id= " operation_parameters["placeOrder"]="" operation_parameters["createUser"]="" operation_parameters["createUsersWithArrayInput"]="" diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/README.md b/samples/client/petstore/csharp/SwaggerClient.v5/README.md index cb19e7d8714..d56551bfcbc 100644 --- a/samples/client/petstore/csharp/SwaggerClient.v5/README.md +++ b/samples/client/petstore/csharp/SwaggerClient.v5/README.md @@ -84,9 +84,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md b/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md index 74094e501bc..bf2fdb1ed6d 100644 --- a/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md +++ b/samples/client/petstore/csharp/SwaggerClient.v5/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs index a44e000b6cc..18dccb27f2f 100644 --- a/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Api/StoreApi.cs @@ -241,7 +241,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "./store/order/{orderId}"; + var localVarPath = "./store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -263,7 +263,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -376,7 +376,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "./store/order/{orderId}"; + var localVarPath = "./store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -398,7 +398,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 05057fb7f2a..c82e8fb71fb 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -105,9 +105,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md index 74094e501bc..bf2fdb1ed6d 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs index 809f16f7239..32d01eded1c 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs @@ -325,7 +325,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -347,7 +347,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -393,7 +393,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -415,7 +415,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -595,7 +595,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -617,7 +617,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -664,7 +664,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -686,7 +686,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index 05057fb7f2a..c82e8fb71fb 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -105,9 +105,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md index 74094e501bc..bf2fdb1ed6d 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs index 809f16f7239..32d01eded1c 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs @@ -325,7 +325,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -347,7 +347,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -393,7 +393,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -415,7 +415,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -595,7 +595,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -617,7 +617,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -664,7 +664,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "/store/order/{orderId}"; + var localVarPath = "/store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -686,7 +686,7 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index d87ca2a4e3f..ad8220ac7b2 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -33,9 +33,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/client/petstore/go/go-petstore/docs/StoreApi.md index 6488e6a1702..af51c30d30b 100644 --- a/samples/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/client/petstore/go/go-petstore/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index 0e1d1a79391..ca90d190d8a 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -48,8 +48,8 @@ func (a StoreApi) DeleteOrder(orderId string) (*APIResponse, error) { var localVarHttpMethod = strings.ToUpper("Delete") // create path and map variables - localVarPath := a.Configuration.BasePath + "/store/order/{orderId}" - localVarPath = strings.Replace(localVarPath, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath := a.Configuration.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -170,8 +170,8 @@ func (a StoreApi) GetOrderById(orderId int64) (*Order, *APIResponse, error) { var localVarHttpMethod = strings.ToUpper("Get") // create path and map variables - localVarPath := a.Configuration.BasePath + "/store/order/{orderId}" - localVarPath = strings.Replace(localVarPath, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath := a.Configuration.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 73a08a6c53c..d21f1775565 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -230,6 +230,18 @@ ${junit-version} test + + com.squareup.okhttp3 + mockwebserver + 3.6.0 + test + + + org.assertj + assertj-core + 1.7.1 + test + 1.7 diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/EncodingUtils.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/EncodingUtils.java new file mode 100644 index 00000000000..c474fc62187 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/EncodingUtils.java @@ -0,0 +1,86 @@ +package io.swagger.client; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** +* Utilities to support Swagger encoding formats in Feign. +*/ +public final class EncodingUtils { + + /** + * Private constructor. Do not construct this class. + */ + private EncodingUtils() {} + + /** + *

Encodes a collection of query parameters according to the Swagger + * collection format.

+ * + *

Of the various collection formats defined by Swagger ("csv", "tsv", + * etc), Feign only natively supports "multi". This utility generates the + * other format types so it will be properly processed by Feign.

+ * + *

Note, as part of reformatting, it URL encodes the parameters as + * well.

+ * @param parameters The collection object to be formatted. This object will + * not be changed. + * @param collectionFormat The Swagger collection format (eg, "csv", "tsv", + * "pipes"). See the + * + * Swagger Spec for more details. + * @return An object that will be correctly formatted by Feign. + */ + public static Object encodeCollection(Collection parameters, + String collectionFormat) { + if (parameters == null) { + return parameters; + } + List stringValues = new ArrayList<>(parameters.size()); + for (Object parameter : parameters) { + // ignore null values (same behavior as Feign) + if (parameter != null) { + stringValues.add(encode(parameter)); + } + } + // Feign natively handles single-element lists and the "multi" format. + if (stringValues.size() < 2 || "multi".equals(collectionFormat)) { + return stringValues; + } + // Otherwise return a formatted String + String[] stringArray = stringValues.toArray(new String[0]); + switch (collectionFormat) { + case "csv": + default: + return StringUtil.join(stringArray, ","); + case "ssv": + return StringUtil.join(stringArray, " "); + case "tsv": + return StringUtil.join(stringArray, "\t"); + case "pipes": + return StringUtil.join(stringArray, "|"); + } + } + + /** + * URL encode a single query parameter. + * @param parameter The query parameter to encode. This object will not be + * changed. + * @return The URL encoded string representation of the parameter. If the + * parameter is null, returns null. + */ + public static String encode(Object parameter) { + if (parameter == null) { + return null; + } + try { + return URLEncoder.encode(parameter.toString(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } +} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java index 1c035b3fe38..04b4b05e6bc 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import java.math.BigDecimal; import io.swagger.client.model.Client; @@ -106,7 +107,7 @@ public interface FakeApi extends ApiClient.Api { "enum_header_string: {enumHeaderString}" }) - void testEnumParameters(@Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap Map queryParams); + void testEnumParameters(@Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -114,15 +115,15 @@ public interface FakeApi extends ApiClient.Api { */ public static class TestEnumParametersQueryParams extends HashMap { public TestEnumParametersQueryParams enumQueryStringArray(final List value) { - put("enum_query_string_array", value); + put("enum_query_string_array", EncodingUtils.encodeCollection(value, "csv")); return this; } public TestEnumParametersQueryParams enumQueryString(final String value) { - put("enum_query_string", value); + put("enum_query_string", EncodingUtils.encode(value)); return this; } public TestEnumParametersQueryParams enumQueryInteger(final Integer value) { - put("enum_query_integer", value); + put("enum_query_integer", EncodingUtils.encode(value)); return this; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index 48987c67f38..5a6813c6198 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import java.io.File; import io.swagger.client.model.ModelApiResponse; @@ -75,7 +76,7 @@ public interface PetApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - List findPetsByStatus(@QueryMap Map queryParams); + List findPetsByStatus(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -83,7 +84,7 @@ public interface PetApi extends ApiClient.Api { */ public static class FindPetsByStatusQueryParams extends HashMap { public FindPetsByStatusQueryParams status(final List value) { - put("status", value); + put("status", EncodingUtils.encodeCollection(value, "csv")); return this; } } @@ -121,7 +122,7 @@ public interface PetApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - List findPetsByTags(@QueryMap Map queryParams); + List findPetsByTags(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -129,7 +130,7 @@ public interface PetApi extends ApiClient.Api { */ public static class FindPetsByTagsQueryParams extends HashMap { public FindPetsByTagsQueryParams tags(final List value) { - put("tags", value); + put("tags", EncodingUtils.encodeCollection(value, "csv")); return this; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index 9e1ecddbece..1ad8111d3d6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import io.swagger.client.model.Order; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index c271b9deda8..e85fca41f8b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; import io.swagger.client.model.User; @@ -110,7 +111,7 @@ public interface UserApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - String loginUser(@QueryMap Map queryParams); + String loginUser(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -118,11 +119,11 @@ public interface UserApi extends ApiClient.Api { */ public static class LoginUserQueryParams extends HashMap { public LoginUserQueryParams username(final String value) { - put("username", value); + put("username", EncodingUtils.encode(value)); return this; } public LoginUserQueryParams password(final String value) { - put("password", value); + put("password", EncodingUtils.encode(value)); return this; } } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java index 4a65cc4d176..c27524de1f6 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java @@ -13,17 +13,25 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; import org.junit.*; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.*; public class PetApiTest { - private ApiClient apiClient; - private PetApi api; + ApiClient apiClient; + PetApi api; + MockWebServer localServer; + ApiClient localClient; @Before public void setup() { apiClient = new ApiClient(); api = apiClient.buildClient(PetApi.class); + localServer = new MockWebServer(); + localClient = new ApiClient(); } @Test @@ -211,6 +219,20 @@ public class PetApiTest { assertTrue(pet1.hashCode() == pet1.hashCode()); } + @Test + public void testCSVDelimitedArray() throws Exception { + localServer.enqueue(new MockResponse().setBody("[{\"id\":5,\"name\":\"rocky\"}]")); + localServer.start(); + PetApi api = localClient.setBasePath(localServer.url("/").toString()).buildClient(PetApi.class); + PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams() + .tags(Arrays.asList("friendly","energetic")); + List pets = api.findPetsByTags(queryParams); + assertNotNull(pets); + RecordedRequest request = localServer.takeRequest(); + assertThat(request.getPath()).contains("tags=friendly,energetic"); + localServer.shutdown(); + } + private Pet createRandomPet() { Pet pet = new Pet(); pet.setId(TestUtils.nextId()); diff --git a/samples/client/petstore/java/jersey1/docs/StoreApi.md b/samples/client/petstore/java/jersey1/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey1/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey1/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 4b77db8722b..7a87297cdab 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java index 48d7c58de7b..db18bcb589f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java @@ -63,8 +63,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -140,8 +140,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index 8e4c6a8ba78..60a3a0cd530 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java index d0a1e843743..22be0ebb027 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,8 +49,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -126,8 +126,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index ac527b7d825..1f8805518bc 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 1.8 1.8 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java index d0a1e843743..22be0ebb027 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,8 +49,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -126,8 +126,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2/docs/StoreApi.md b/samples/client/petstore/java/jersey2/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/jersey2/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index e8edd381216..1c7426558a5 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java index d0a1e843743..22be0ebb027 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,8 +49,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -126,8 +126,8 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index 0168569326f..366044b374b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -516,12 +516,13 @@ public class ApiClient { * application/json * application/json; charset=UTF8 * APPLICATION/JSON - * + * application/vnd.company+json * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { - return mime != null && mime.matches("(?i)application\\/json(;.*)?"); + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && mime.matches(jsonMime); } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java index 0b9fc0c48c1..0b1d4c12323 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java @@ -66,8 +66,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -304,8 +304,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md index a2547a1483e..e6dc635e517 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java index 0b9fc0c48c1..0b1d4c12323 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java @@ -66,8 +66,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -304,8 +304,8 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index aaa9654d87a..069c8bb3ed2 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 1.7 1.7 diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java index 7dba9b5d855..f705411a0df 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java @@ -22,9 +22,9 @@ public interface StoreApi { * @return Void */ - @DELETE("/store/order/{orderId}") + @DELETE("/store/order/{order_id}") Void deleteOrder( - @retrofit.http.Path("orderId") String orderId + @retrofit.http.Path("order_id") String orderId ); /** @@ -34,9 +34,9 @@ public interface StoreApi { * @param cb callback method */ - @DELETE("/store/order/{orderId}") + @DELETE("/store/order/{order_id}") void deleteOrder( - @retrofit.http.Path("orderId") String orderId, Callback cb + @retrofit.http.Path("order_id") String orderId, Callback cb ); /** * Returns pet inventories by status @@ -67,9 +67,9 @@ public interface StoreApi { * @return Order */ - @GET("/store/order/{orderId}") + @GET("/store/order/{order_id}") Order getOrderById( - @retrofit.http.Path("orderId") Long orderId + @retrofit.http.Path("order_id") Long orderId ); /** @@ -79,9 +79,9 @@ public interface StoreApi { * @param cb callback method */ - @GET("/store/order/{orderId}") + @GET("/store/order/{order_id}") void getOrderById( - @retrofit.http.Path("orderId") Long orderId, Callback cb + @retrofit.http.Path("order_id") Long orderId, Callback cb ); /** * Place an order for a pet diff --git a/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md b/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java index 94877ed3890..3cfefc29b9d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java @@ -26,9 +26,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") F.Promise> deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -46,9 +46,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") F.Promise> getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/java/retrofit2/docs/StoreApi.md b/samples/client/petstore/java/retrofit2/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java index 16b57ea3c90..3be2674aa76 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java @@ -24,9 +24,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") Call deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -44,9 +44,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") Call getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java index a937daca7cc..c2dc749a331 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java @@ -24,9 +24,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") Observable deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -44,9 +44,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") Observable getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md b/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md index 509e8c9147b..6b53c6a5661 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java index a937daca7cc..c2dc749a331 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java @@ -24,9 +24,9 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{orderId}") + @DELETE("store/order/{order_id}") Observable deleteOrder( - @retrofit2.http.Path("orderId") String orderId + @retrofit2.http.Path("order_id") String orderId ); /** @@ -44,9 +44,9 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{orderId}") + @GET("store/order/{order_id}") Observable getOrderById( - @retrofit2.http.Path("orderId") Long orderId + @retrofit2.http.Path("order_id") Long orderId ); /** diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 46cc87abbf3..5c927af0e7c 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -83,9 +83,9 @@ Class | Method | HTTP request | Description *SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/javascript-promise/docs/Fake_classname_tags123Api.md b/samples/client/petstore/javascript-promise/docs/Fake_classname_tags123Api.md index e7774321bc6..6ba27ee832f 100644 --- a/samples/client/petstore/javascript-promise/docs/Fake_classname_tags123Api.md +++ b/samples/client/petstore/javascript-promise/docs/Fake_classname_tags123Api.md @@ -1,6 +1,6 @@ # SwaggerPetstore.Fake_classname_tags123Api -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/javascript-promise/docs/StoreApi.md b/samples/client/petstore/javascript-promise/docs/StoreApi.md index a7ec557dcef..402c198e817 100644 --- a/samples/client/petstore/javascript-promise/docs/StoreApi.md +++ b/samples/client/petstore/javascript-promise/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index 633c7595157..d0bcad66ae7 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -62,7 +62,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -79,7 +79,7 @@ var returnType = null; return this.apiClient.callApi( - '/store/order/{orderId}', 'DELETE', + '/store/order/{order_id}', 'DELETE', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); @@ -160,7 +160,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -177,7 +177,7 @@ var returnType = Order; return this.apiClient.callApi( - '/store/order/{orderId}', 'GET', + '/store/order/{order_id}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 09150086285..3d8ca3acf66 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -86,9 +86,9 @@ Class | Method | HTTP request | Description *SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/javascript/docs/Fake_classname_tags123Api.md b/samples/client/petstore/javascript/docs/Fake_classname_tags123Api.md index ea36b8ef48f..017483b51a6 100644 --- a/samples/client/petstore/javascript/docs/Fake_classname_tags123Api.md +++ b/samples/client/petstore/javascript/docs/Fake_classname_tags123Api.md @@ -1,6 +1,6 @@ # SwaggerPetstore.Fake_classname_tags123Api -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/javascript/docs/StoreApi.md b/samples/client/petstore/javascript/docs/StoreApi.md index e1fa1a4fd50..0ef25bf703d 100644 --- a/samples/client/petstore/javascript/docs/StoreApi.md +++ b/samples/client/petstore/javascript/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index cd9c405ae2f..616966bc437 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -69,7 +69,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -86,7 +86,7 @@ var returnType = null; return this.apiClient.callApi( - '/store/order/{orderId}', 'DELETE', + '/store/order/{order_id}', 'DELETE', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); @@ -158,7 +158,7 @@ var pathParams = { - 'orderId': orderId + 'order_id': orderId }; var queryParams = { }; @@ -175,7 +175,7 @@ var returnType = Order; return this.apiClient.callApi( - '/store/order/{orderId}', 'GET', + '/store/order/{order_id}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); diff --git a/samples/client/petstore/jaxrs-cxf/LICENSE b/samples/client/petstore/jaxrs-cxf/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/samples/client/petstore/jaxrs-cxf/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java new file mode 100644 index 00000000000..e904e888547 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java @@ -0,0 +1,45 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.LocalDate; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; + +@Path("/") +@Api(value = "/", description = "") +public interface FakeApi { + + @PATCH + @Path("/fake") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test \"client\" model", tags={ }) + public Client testClientModel(Client body); + + @POST + @Path("/fake") + @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ }) + public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "_double") Double _double, @Multipart(value = "patternWithoutDelimiter") String patternWithoutDelimiter, @Multipart(value = "_byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "_float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "paramCallback", required = false) String paramCallback); + + @GET + @Path("/fake") + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @ApiOperation(value = "To test enum parameters", tags={ }) + public void testEnumParameters(@Multipart(value = "enumFormStringArray", required = false) List enumFormStringArray, @Multipart(value = "enumFormString", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array")List enumQueryStringArray, @QueryParam("enum_query_string")String enumQueryString, @QueryParam("enum_query_integer")Integer enumQueryInteger, @Multipart(value = "enumQueryDouble", required = false) Double enumQueryDouble); +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java index 4ff1aa826dc..73c002077a3 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java @@ -1,8 +1,8 @@ package io.swagger.api; -import io.swagger.model.Pet; -import io.swagger.model.ModelApiResponse; import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; import java.io.InputStream; import java.io.OutputStream; @@ -15,11 +15,10 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; @Path("/") @Api(value = "/", description = "") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) public interface PetApi { @POST @@ -27,52 +26,51 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Add a new pet to the store", tags={ }) - public void addPet(Pet body); + public void addPet(Pet body); @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Deletes a pet", tags={ }) - public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", tags={ }) - public List findPetsByStatus(@QueryParam("status")List status); + public List> findPetsByStatus(@QueryParam("status")List status); @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ }) - public List findPetsByTags(@QueryParam("tags")List tags); + public List> findPetsByTags(@QueryParam("tags")List tags); @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find pet by ID", tags={ }) - public Pet getPetById(@PathParam("petId") Long petId); + public Pet getPetById(@PathParam("petId") Long petId); @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Update an existing pet", tags={ }) - public void updatePet(Pet body); + public void updatePet(Pet body); @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updates a pet in the store with form data", tags={ }) - public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @ApiOperation(value = "uploads an image", tags={ }) - public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, - @Multipart(value = "file" , required = false) Attachment fileDetail); + public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); } diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index dca146745e8..c162a456b28 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -13,35 +13,34 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; @Path("/") @Api(value = "/", description = "") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) public interface StoreApi { @DELETE @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete purchase order by ID", tags={ }) - public void deleteOrder(@PathParam("orderId") String orderId); + public void deleteOrder(@PathParam("orderId") String orderId); @GET @Path("/store/inventory") @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ }) - public Map getInventory(); + public Map> getInventory(); @GET @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", tags={ }) - public Order getOrderById(@PathParam("orderId") Long orderId); + public Order getOrderById(@PathParam("orderId") Long orderId); @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", tags={ }) - public Order placeOrder(Order body); + public Order placeOrder(Order body); } diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java index e3e77a12361..91dd35454ed 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java @@ -13,59 +13,58 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.jaxrs.PATCH; @Path("/") @Api(value = "/", description = "") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) public interface UserApi { @POST @Path("/user") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Create user", tags={ }) - public void createUser(User body); + public void createUser(User body); @POST @Path("/user/createWithArray") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ }) - public void createUsersWithArrayInput(List body); + public void createUsersWithArrayInput(List body); @POST @Path("/user/createWithList") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ }) - public void createUsersWithListInput(List body); + public void createUsersWithListInput(List body); @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete user", tags={ }) - public void deleteUser(@PathParam("username") String username); + public void deleteUser(@PathParam("username") String username); @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Get user by user name", tags={ }) - public User getUserByName(@PathParam("username") String username); + public User getUserByName(@PathParam("username") String username); @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs user into the system", tags={ }) - public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password); + public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password); @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs out current logged in user session", tags={ }) - public void logoutUser(); + public void logoutUser(); @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", tags={ }) - public void updateUser(@PathParam("username") String username, User body); + public void updateUser(@PathParam("username") String username, User body); } diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..1f8f92829fa --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -0,0 +1,90 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class AdditionalPropertiesClass { + + @ApiModelProperty(example = "null", value = "") + private Map mapProperty = new HashMap(); + @ApiModelProperty(example = "null", value = "") + private Map> mapOfMapProperty = new HashMap>(); + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java new file mode 100644 index 00000000000..1b910d07fd8 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java @@ -0,0 +1,77 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Animal { + + @ApiModelProperty(example = "null", required = true, value = "") + private String className = null; + @ApiModelProperty(example = "null", value = "") + private String color = "red"; + + /** + * Get className + * @return className + **/ + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java new file mode 100644 index 00000000000..3605a9f929d --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java @@ -0,0 +1,40 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class AnimalFarm extends ArrayList { + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnimalFarm {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..0c503dd7905 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,65 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ArrayOfArrayOfNumberOnly { + + @ApiModelProperty(example = "null", value = "") + private List> arrayArrayNumber = new ArrayList>(); + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..d9715d924e0 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -0,0 +1,65 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ArrayOfNumberOnly { + + @ApiModelProperty(example = "null", value = "") + private List arrayNumber = new ArrayList(); + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java new file mode 100644 index 00000000000..10d33ff8d46 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java @@ -0,0 +1,115 @@ +package io.swagger.model; + +import io.swagger.model.ReadOnlyFirst; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ArrayTest { + + @ApiModelProperty(example = "null", value = "") + private List arrayOfString = new ArrayList(); + @ApiModelProperty(example = "null", value = "") + private List> arrayArrayOfInteger = new ArrayList>(); + @ApiModelProperty(example = "null", value = "") + private List> arrayArrayOfModel = new ArrayList>(); + + /** + * Get arrayOfString + * @return arrayOfString + **/ + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java new file mode 100644 index 00000000000..bedd5be84d1 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java @@ -0,0 +1,157 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Capitalization { + + @ApiModelProperty(example = "null", value = "") + private String smallCamel = null; + @ApiModelProperty(example = "null", value = "") + private String capitalCamel = null; + @ApiModelProperty(example = "null", value = "") + private String smallSnake = null; + @ApiModelProperty(example = "null", value = "") + private String capitalSnake = null; + @ApiModelProperty(example = "null", value = "") + private String scAETHFlowPoints = null; + @ApiModelProperty(example = "null", value = "Name of the pet ") + private String ATT_NAME = null; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java new file mode 100644 index 00000000000..d5a34f8cf60 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java @@ -0,0 +1,58 @@ +package io.swagger.model; + +import io.swagger.model.Animal; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Cat extends Animal { + + @ApiModelProperty(example = "null", value = "") + private Boolean declawed = null; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java index 591a6e22a69..152a402a980 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A category for a pet") public class Category { @ApiModelProperty(example = "null", value = "") @@ -26,9 +24,16 @@ public class Category { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Category id(Long id) { + this.id = id; + return this; + } + /** * Get name * @return name @@ -36,10 +41,17 @@ public class Category { public String getName() { return name; } + public void setName(String name) { this.name = name; } + public Category name(String name) { + this.name = name; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..19a210a6280 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java @@ -0,0 +1,59 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing model with \"_class\" property") +public class ClassModel { + + @ApiModelProperty(example = "null", value = "") + private String propertyClass = null; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java new file mode 100644 index 00000000000..13f726f169a --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java @@ -0,0 +1,57 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Client { + + @ApiModelProperty(example = "null", value = "") + private String client = null; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java new file mode 100644 index 00000000000..79d192044b9 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java @@ -0,0 +1,58 @@ +package io.swagger.model; + +import io.swagger.model.Animal; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class Dog extends Animal { + + @ApiModelProperty(example = "null", value = "") + private String breed = null; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java new file mode 100644 index 00000000000..abd5edd8a11 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java @@ -0,0 +1,150 @@ +package io.swagger.model; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class EnumArrays { + + +@XmlType(name="JustSymbolEnum") +@XmlEnum(String.class) +public enum JustSymbolEnum { + +@XmlEnumValue(">=") GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), @XmlEnumValue("$") DOLLAR(String.valueOf("$")); + + + private String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static JustSymbolEnum fromValue(String v) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private JustSymbolEnum justSymbol = null; + +@XmlType(name="ArrayEnumEnum") +@XmlEnum(String.class) +public enum ArrayEnumEnum { + +@XmlEnumValue("fish") FISH(String.valueOf("fish")), @XmlEnumValue("crab") CRAB(String.valueOf("crab")); + + + private String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ArrayEnumEnum fromValue(String v) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private List arrayEnum = new ArrayList(); + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java new file mode 100644 index 00000000000..291878a42cd --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java @@ -0,0 +1,37 @@ +package io.swagger.model; + + + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java new file mode 100644 index 00000000000..9bf0ed480d9 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java @@ -0,0 +1,217 @@ +package io.swagger.model; + +import io.swagger.model.OuterEnum; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class EnumTest { + + +@XmlType(name="EnumStringEnum") +@XmlEnum(String.class) +public enum EnumStringEnum { + +@XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower")), @XmlEnumValue("") EMPTY(String.valueOf("")); + + + private String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringEnum fromValue(String v) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private EnumStringEnum enumString = null; + +@XmlType(name="EnumIntegerEnum") +@XmlEnum(Integer.class) +public enum EnumIntegerEnum { + +@XmlEnumValue("1") NUMBER_1(Integer.valueOf(1)), @XmlEnumValue("-1") NUMBER_MINUS_1(Integer.valueOf(-1)); + + + private Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumIntegerEnum fromValue(String v) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private EnumIntegerEnum enumInteger = null; + +@XmlType(name="EnumNumberEnum") +@XmlEnum(Double.class) +public enum EnumNumberEnum { + +@XmlEnumValue("1.1") NUMBER_1_DOT_1(Double.valueOf(1.1)), @XmlEnumValue("-1.2") NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + private Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumNumberEnum fromValue(String v) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private EnumNumberEnum enumNumber = null; + @ApiModelProperty(example = "null", value = "") + private OuterEnum outerEnum = null; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java new file mode 100644 index 00000000000..7aaa680ee74 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -0,0 +1,310 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.UUID; +import org.joda.time.LocalDate; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class FormatTest { + + @ApiModelProperty(example = "null", value = "") + private Integer integer = null; + @ApiModelProperty(example = "null", value = "") + private Integer int32 = null; + @ApiModelProperty(example = "null", value = "") + private Long int64 = null; + @ApiModelProperty(example = "null", required = true, value = "") + private BigDecimal number = null; + @ApiModelProperty(example = "null", value = "") + private Float _float = null; + @ApiModelProperty(example = "null", value = "") + private Double _double = null; + @ApiModelProperty(example = "null", value = "") + private String string = null; + @ApiModelProperty(example = "null", required = true, value = "") + private byte[] _byte = null; + @ApiModelProperty(example = "null", value = "") + private byte[] binary = null; + @ApiModelProperty(example = "null", required = true, value = "") + private LocalDate date = null; + @ApiModelProperty(example = "null", value = "") + private javax.xml.datatype.XMLGregorianCalendar dateTime = null; + @ApiModelProperty(example = "null", value = "") + private UUID uuid = null; + @ApiModelProperty(example = "null", required = true, value = "") + private String password = null; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get string + * @return string + **/ + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public byte[] getBinary() { + return binary; + } + + public void setBinary(byte[] binary) { + this.binary = binary; + } + + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public javax.xml.datatype.XMLGregorianCalendar getDateTime() { + return dateTime; + } + + public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..5217ab51d00 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -0,0 +1,61 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class HasOnlyReadOnly { + + @ApiModelProperty(example = "null", value = "") + private String bar = null; + @ApiModelProperty(example = "null", value = "") + private String foo = null; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java new file mode 100644 index 00000000000..c4a96d6e0cf --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java @@ -0,0 +1,123 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class MapTest { + + @ApiModelProperty(example = "null", value = "") + private Map> mapMapOfString = new HashMap>(); + +@XmlType(name="InnerEnum") +@XmlEnum(String.class) +public enum InnerEnum { + +@XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower")); + + + private String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static InnerEnum fromValue(String v) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + @ApiModelProperty(example = "null", value = "") + private Map mapOfEnumString = new HashMap(); + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..be9766ed322 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,107 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class MixedPropertiesAndAdditionalPropertiesClass { + + @ApiModelProperty(example = "null", value = "") + private UUID uuid = null; + @ApiModelProperty(example = "null", value = "") + private javax.xml.datatype.XMLGregorianCalendar dateTime = null; + @ApiModelProperty(example = "null", value = "") + private Map map = new HashMap(); + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public javax.xml.datatype.XMLGregorianCalendar getDateTime() { + return dateTime; + } + + public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java new file mode 100644 index 00000000000..05fd797834c --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java @@ -0,0 +1,79 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing model name starting with number") +public class Model200Response { + + @ApiModelProperty(example = "null", value = "") + private Integer name = null; + @ApiModelProperty(example = "null", value = "") + private String propertyClass = null; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java index f3c6f56cfc4..c223c815449 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { @ApiModelProperty(example = "null", value = "") @@ -28,9 +26,16 @@ public class ModelApiResponse { public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + /** * Get type * @return type @@ -38,9 +43,16 @@ public class ModelApiResponse { public String getType() { return type; } + public void setType(String type) { this.type = type; } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + /** * Get message * @return message @@ -48,10 +60,17 @@ public class ModelApiResponse { public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java new file mode 100644 index 00000000000..92945ebdff6 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java @@ -0,0 +1,59 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing reserved words") +public class ModelReturn { + + @ApiModelProperty(example = "null", value = "") + private Integer _return = null; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java new file mode 100644 index 00000000000..874d6cf18bc --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java @@ -0,0 +1,103 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +@ApiModel(description="Model for testing model name same as property name") +public class Name { + + @ApiModelProperty(example = "null", required = true, value = "") + private Integer name = null; + @ApiModelProperty(example = "null", value = "") + private Integer snakeCase = null; + @ApiModelProperty(example = "null", value = "") + private String property = null; + @ApiModelProperty(example = "null", value = "") + private Integer _123Number = null; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123Number + * @return _123Number + **/ + public Integer get123Number() { + return _123Number; + } + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java new file mode 100644 index 00000000000..12b98f1cfa7 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java @@ -0,0 +1,58 @@ +package io.swagger.model; + +import java.math.BigDecimal; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class NumberOnly { + + @ApiModelProperty(example = "null", value = "") + private BigDecimal justNumber = null; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java index af6f5e0e38e..121f73715b4 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="An order for a pets from the pet store") public class Order { @ApiModelProperty(example = "null", value = "") @@ -27,7 +25,7 @@ public class Order { @XmlEnum(String.class) public enum StatusEnum { - @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); +@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); private String value; @@ -67,9 +65,16 @@ public enum StatusEnum { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Order id(Long id) { + this.id = id; + return this; + } + /** * Get petId * @return petId @@ -77,9 +82,16 @@ public enum StatusEnum { public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + /** * Get quantity * @return quantity @@ -87,9 +99,16 @@ public enum StatusEnum { public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + /** * Get shipDate * @return shipDate @@ -97,9 +116,16 @@ public enum StatusEnum { public javax.xml.datatype.XMLGregorianCalendar getShipDate() { return shipDate; } + public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) { this.shipDate = shipDate; } + + public Order shipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) { + this.shipDate = shipDate; + return this; + } + /** * Order Status * @return status @@ -107,9 +133,16 @@ public enum StatusEnum { public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + /** * Get complete * @return complete @@ -117,10 +150,17 @@ public enum StatusEnum { public Boolean getComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..29a009eabdd --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,37 @@ +package io.swagger.model; + + + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java index 0cfc0a30ee0..5bca8a1291a 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; @@ -15,7 +14,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A pet for sale in the pet store") public class Pet { @ApiModelProperty(example = "null", value = "") @@ -33,7 +31,7 @@ public class Pet { @XmlEnum(String.class) public enum StatusEnum { - @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); +@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); private String value; @@ -71,9 +69,16 @@ public enum StatusEnum { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Pet id(Long id) { + this.id = id; + return this; + } + /** * Get category * @return category @@ -81,9 +86,16 @@ public enum StatusEnum { public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } + + public Pet category(Category category) { + this.category = category; + return this; + } + /** * Get name * @return name @@ -91,9 +103,16 @@ public enum StatusEnum { public String getName() { return name; } + public void setName(String name) { this.name = name; } + + public Pet name(String name) { + this.name = name; + return this; + } + /** * Get photoUrls * @return photoUrls @@ -101,9 +120,21 @@ public enum StatusEnum { public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + /** * Get tags * @return tags @@ -111,9 +142,21 @@ public enum StatusEnum { public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + /** * pet status in the store * @return status @@ -121,10 +164,17 @@ public enum StatusEnum { public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..f4baea453a2 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -0,0 +1,69 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class ReadOnlyFirst { + + @ApiModelProperty(example = "null", value = "") + private String bar = null; + @ApiModelProperty(example = "null", value = "") + private String baz = null; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java new file mode 100644 index 00000000000..afff9e4087e --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java @@ -0,0 +1,57 @@ +package io.swagger.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; + +public class SpecialModelName { + + @ApiModelProperty(example = "null", value = "") + private Long specialPropertyName = null; + + /** + * Get specialPropertyName + * @return specialPropertyName + **/ + public Long getSpecialPropertyName() { + return specialPropertyName; + } + + public void setSpecialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + } + + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java index 4eb99ad2fc1..fec9ab8820c 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A tag for a pet") public class Tag { @ApiModelProperty(example = "null", value = "") @@ -26,9 +24,16 @@ public class Tag { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public Tag id(Long id) { + this.id = id; + return this; + } + /** * Get name * @return name @@ -36,10 +41,17 @@ public class Tag { public String getName() { return name; } + public void setName(String name) { this.name = name; } + public Tag name(String name) { + this.name = name; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java index 005d9aa8c74..0b650614861 100644 --- a/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java +++ b/samples/client/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java @@ -1,6 +1,5 @@ package io.swagger.model; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; @@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; -@ApiModel(description="A User who is purchasing from the pet store") public class User { @ApiModelProperty(example = "null", value = "") @@ -38,9 +36,16 @@ public class User { public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + public User id(Long id) { + this.id = id; + return this; + } + /** * Get username * @return username @@ -48,9 +53,16 @@ public class User { public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } + + public User username(String username) { + this.username = username; + return this; + } + /** * Get firstName * @return firstName @@ -58,9 +70,16 @@ public class User { public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + /** * Get lastName * @return lastName @@ -68,9 +87,16 @@ public class User { public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + /** * Get email * @return email @@ -78,9 +104,16 @@ public class User { public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + + public User email(String email) { + this.email = email; + return this; + } + /** * Get password * @return password @@ -88,9 +121,16 @@ public class User { public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + public User password(String password) { + this.password = password; + return this; + } + /** * Get phone * @return phone @@ -98,9 +138,16 @@ public class User { public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } + + public User phone(String phone) { + this.phone = phone; + return this; + } + /** * User Status * @return userStatus @@ -108,10 +155,17 @@ public class User { public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java new file mode 100644 index 00000000000..5e8dae654a4 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java @@ -0,0 +1,146 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.LocalDate; +import org.junit.Test; +import org.junit.Before; +import static org.junit.Assert.*; + +import javax.ws.rs.core.Response; +import org.apache.cxf.jaxrs.client.JAXRSClientFactory; +import org.apache.cxf.jaxrs.client.ClientConfiguration; +import org.apache.cxf.jaxrs.client.WebClient; + + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + + +/** + * API tests for FakeApi + */ +public class FakeApiTest { + + + private FakeApi api; + + @Before + public void setup() { + JacksonJsonProvider provider = new JacksonJsonProvider(); + List providers = new ArrayList(); + providers.add(provider); + + api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", FakeApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); + + ClientConfiguration config = WebClient.getConfig(client); + } + + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() { + Client body = null; + //Client response = api.testClientModel(body); + //assertNotNull(response); + // TODO: test validations + + + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() { + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + byte[] binary = null; + LocalDate date = null; + javax.xml.datatype.XMLGregorianCalendar dateTime = null; + String password = null; + String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + + + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() { + List enumFormStringArray = null; + String enumFormString = null; + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + //api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + // TODO: test validations + + + } + +} diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java index 9d4a9de9901..8aefa0bc820 100644 --- a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -25,9 +25,9 @@ package io.swagger.api; -import io.swagger.model.Pet; -import io.swagger.model.ModelApiResponse; import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -80,9 +80,11 @@ public class PetApiTest { @Test public void addPetTest() { Pet body = null; - // response = api.addPet(body); - //assertNotNull(response); + //api.addPet(body); + // TODO: test validations + + } /** @@ -97,9 +99,11 @@ public class PetApiTest { public void deletePetTest() { Long petId = null; String apiKey = null; - // response = api.deletePet(petId, apiKey); - //assertNotNull(response); + //api.deletePet(petId, apiKey); + // TODO: test validations + + } /** @@ -113,9 +117,11 @@ public class PetApiTest { @Test public void findPetsByStatusTest() { List status = null; - //List response = api.findPetsByStatus(status); + //List> response = api.findPetsByStatus(status); //assertNotNull(response); // TODO: test validations + + } /** @@ -129,9 +135,11 @@ public class PetApiTest { @Test public void findPetsByTagsTest() { List tags = null; - //List response = api.findPetsByTags(tags); + //List> response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations + + } /** @@ -145,9 +153,11 @@ public class PetApiTest { @Test public void getPetByIdTest() { Long petId = null; - //Pet response = api.getPetById(petId); + //Pet response = api.getPetById(petId); //assertNotNull(response); // TODO: test validations + + } /** @@ -161,9 +171,11 @@ public class PetApiTest { @Test public void updatePetTest() { Pet body = null; - // response = api.updatePet(body); - //assertNotNull(response); + //api.updatePet(body); + // TODO: test validations + + } /** @@ -179,9 +191,11 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - // response = api.updatePetWithForm(petId, name, status); - //assertNotNull(response); + //api.updatePetWithForm(petId, name, status); + // TODO: test validations + + } /** @@ -196,10 +210,12 @@ public class PetApiTest { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); //assertNotNull(response); // TODO: test validations + + } } diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java index 81053a82b29..3f88aeb8e9d 100644 --- a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -78,9 +78,11 @@ public class StoreApiTest { @Test public void deleteOrderTest() { String orderId = null; - // response = api.deleteOrder(orderId); - //assertNotNull(response); + //api.deleteOrder(orderId); + // TODO: test validations + + } /** @@ -93,9 +95,11 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - //Map response = api.getInventory(); + //Map> response = api.getInventory(); //assertNotNull(response); // TODO: test validations + + } /** @@ -109,9 +113,11 @@ public class StoreApiTest { @Test public void getOrderByIdTest() { Long orderId = null; - //Order response = api.getOrderById(orderId); + //Order response = api.getOrderById(orderId); //assertNotNull(response); // TODO: test validations + + } /** @@ -125,9 +131,11 @@ public class StoreApiTest { @Test public void placeOrderTest() { Order body = null; - //Order response = api.placeOrder(body); + //Order response = api.placeOrder(body); //assertNotNull(response); // TODO: test validations + + } } diff --git a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java index 126c7018935..ba69520279d 100644 --- a/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/client/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -78,9 +78,11 @@ public class UserApiTest { @Test public void createUserTest() { User body = null; - // response = api.createUser(body); - //assertNotNull(response); + //api.createUser(body); + // TODO: test validations + + } /** @@ -94,9 +96,11 @@ public class UserApiTest { @Test public void createUsersWithArrayInputTest() { List body = null; - // response = api.createUsersWithArrayInput(body); - //assertNotNull(response); + //api.createUsersWithArrayInput(body); + // TODO: test validations + + } /** @@ -110,9 +114,11 @@ public class UserApiTest { @Test public void createUsersWithListInputTest() { List body = null; - // response = api.createUsersWithListInput(body); - //assertNotNull(response); + //api.createUsersWithListInput(body); + // TODO: test validations + + } /** @@ -126,9 +132,11 @@ public class UserApiTest { @Test public void deleteUserTest() { String username = null; - // response = api.deleteUser(username); - //assertNotNull(response); + //api.deleteUser(username); + // TODO: test validations + + } /** @@ -142,9 +150,11 @@ public class UserApiTest { @Test public void getUserByNameTest() { String username = null; - //User response = api.getUserByName(username); + //User response = api.getUserByName(username); //assertNotNull(response); // TODO: test validations + + } /** @@ -159,9 +169,11 @@ public class UserApiTest { public void loginUserTest() { String username = null; String password = null; - //String response = api.loginUser(username, password); + //String response = api.loginUser(username, password); //assertNotNull(response); // TODO: test validations + + } /** @@ -174,9 +186,11 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - // response = api.logoutUser(); - //assertNotNull(response); + //api.logoutUser(); + // TODO: test validations + + } /** @@ -191,9 +205,11 @@ public class UserApiTest { public void updateUserTest() { String username = null; User body = null; - // response = api.updateUser(username, body); - //assertNotNull(response); + //api.updateUser(username, body); + // TODO: test validations + + } } diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index e6d71407fba..fb4df034e77 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -351,9 +351,9 @@ Class | Method | HTTP request | Description *PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user *UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index 0bbdaf511f4..6d699816186 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -9,9 +9,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm index 87589c7a7ec..a7972ed21ab 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -82,7 +82,7 @@ sub delete_order { } # parse inputs - my $_resource_path = '/store/order/{orderId}'; + my $_resource_path = '/store/order/{order_id}'; my $_method = 'DELETE'; my $query_params = {}; @@ -98,7 +98,7 @@ sub delete_order { # path params if ( exists $args{'order_id'}) { - my $_base_variable = "{" . "orderId" . "}"; + my $_base_variable = "{" . "order_id" . "}"; my $_base_value = $self->{api_client}->to_path_value($args{'order_id'}); $_resource_path =~ s/$_base_variable/$_base_value/g; } @@ -194,7 +194,7 @@ sub get_order_by_id { } # parse inputs - my $_resource_path = '/store/order/{orderId}'; + my $_resource_path = '/store/order/{order_id}'; my $_method = 'GET'; my $query_params = {}; @@ -210,7 +210,7 @@ sub get_order_by_id { # path params if ( exists $args{'order_id'}) { - my $_base_variable = "{" . "orderId" . "}"; + my $_base_variable = "{" . "order_id" . "}"; my $_base_value = $self->{api_client}->to_path_value($args{'order_id'}); $_resource_path =~ s/$_base_variable/$_base_value/g; } diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 79c0207aa8d..1b2dc553326 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -87,9 +87,9 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index 8c0930563fb..d959d6141d0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index e3d7e466722..bfa8fd71583 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -118,7 +118,7 @@ class StoreApi throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder'); } // parse inputs - $resourcePath = "/store/order/{orderId}"; + $resourcePath = "/store/order/{order_id}"; $httpBody = ''; $queryParams = []; $headerParams = []; @@ -132,7 +132,7 @@ class StoreApi // path params if ($order_id !== null) { $resourcePath = str_replace( - "{" . "orderId" . "}", + "{" . "order_id" . "}", $this->apiClient->getSerializer()->toPathValue($order_id), $resourcePath ); @@ -153,7 +153,7 @@ class StoreApi $httpBody, $headerParams, null, - '/store/order/{orderId}' + '/store/order/{order_id}' ); return [null, $statusCode, $httpHeader]; @@ -276,7 +276,7 @@ class StoreApi } // parse inputs - $resourcePath = "/store/order/{orderId}"; + $resourcePath = "/store/order/{order_id}"; $httpBody = ''; $queryParams = []; $headerParams = []; @@ -290,7 +290,7 @@ class StoreApi // path params if ($order_id !== null) { $resourcePath = str_replace( - "{" . "orderId" . "}", + "{" . "order_id" . "}", $this->apiClient->getSerializer()->toPathValue($order_id), $resourcePath ); @@ -311,7 +311,7 @@ class StoreApi $httpBody, $headerParams, '\Swagger\Client\Model\Order', - '/store/order/{orderId}' + '/store/order/{order_id}' ); return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader]; diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index f44e831d952..9dabb07c8d6 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -81,9 +81,9 @@ Class | Method | HTTP request | Description *PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user *UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md index b78b51bb596..5b766d0cfda 100644 --- a/samples/client/petstore/python/docs/StoreApi.md +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/python/petstore_api/apis/store_api.py b/samples/client/petstore/python/petstore_api/apis/store_api.py index 9985d32c60e..44751e4a2b7 100644 --- a/samples/client/petstore/python/petstore_api/apis/store_api.py +++ b/samples/client/petstore/python/petstore_api/apis/store_api.py @@ -105,7 +105,7 @@ class StoreApi(object): path_params = {} if 'order_id' in params: - path_params['orderId'] = params['order_id'] + path_params['order_id'] = params['order_id'] query_params = {} @@ -122,7 +122,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api('/store/order/{orderId}', 'DELETE', + return self.api_client.call_api('/store/order/{order_id}', 'DELETE', path_params, query_params, header_params, @@ -305,7 +305,7 @@ class StoreApi(object): path_params = {} if 'order_id' in params: - path_params['orderId'] = params['order_id'] + path_params['order_id'] = params['order_id'] query_params = {} @@ -322,7 +322,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api('/store/order/{orderId}', 'GET', + return self.api_client.call_api('/store/order/{order_id}', 'GET', path_params, query_params, header_params, diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 2aafdbee7b4..658d3ecda5a 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -87,9 +87,9 @@ Class | Method | HTTP request | Description *Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID *Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user *Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 389f8337da1..aa7eaf03bf2 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 6b8978f1b9e..9826b6ee5e5 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" if order_id.nil? # resource path - local_var_path = "/store/order/{orderId}".sub('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{order_id}".sub('{' + 'order_id' + '}', order_id.to_s) # query parameters query_params = {} @@ -146,7 +146,7 @@ module Petstore end # resource path - local_var_path = "/store/order/{orderId}".sub('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{order_id}".sub('{' + 'order_id' + '}', order_id.to_s) # query parameters query_params = {} diff --git a/samples/client/petstore/scala/build.gradle b/samples/client/petstore/scala/build.gradle index 979db7783c4..707c4f9e988 100644 --- a/samples/client/petstore/scala/build.gradle +++ b/samples/client/petstore/scala/build.gradle @@ -104,6 +104,12 @@ ext { jackson_version = "2.4.2" junit_version = "4.8.1" scala_test_version = "2.2.4" + swagger_async_httpclient_version = "0.3.5" +} + +repositories { + mavenLocal() + mavenCentral() } dependencies { @@ -117,4 +123,5 @@ dependencies { testCompile "junit:junit:$junit_version" compile "joda-time:joda-time:$jodatime_version" compile "org.joda:joda-convert:$joda_version" + compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version" } diff --git a/samples/client/petstore/scala/build.sbt b/samples/client/petstore/scala/build.sbt index 063b2b0d490..bececaf181b 100644 --- a/samples/client/petstore/scala/build.sbt +++ b/samples/client/petstore/scala/build.sbt @@ -1,33 +1,34 @@ -lazy val root = (project in file(".")). - settings( - version := "1.0.0", - name := "swagger-scala-client", - organization := "io.swagger", - scalaVersion := "2.11.8", +version := "1.0.0" - libraryDependencies ++= Seq( - "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", - "com.sun.jersey" % "jersey-core" % "1.19", - "com.sun.jersey" % "jersey-client" % "1.19", - "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", - "org.jfarcand" % "jersey-ahc-client" % "1.0.5", - "io.swagger" % "swagger-core" % "1.5.8", - "joda-time" % "joda-time" % "2.2", - "org.joda" % "joda-convert" % "1.2", - "org.scalatest" %% "scalatest" % "2.2.4" % "test", - "junit" % "junit" % "4.8.1" % "test" - ), +name := "swagger-scala-client" - resolvers ++= Seq( - Resolver.jcenterRepo, - Resolver.mavenLocal - ), +organization := "io.swagger" - scalacOptions := Seq( - "-unchecked", - "-deprecation", - "-feature" - ), +scalaVersion := "2.11.8" + +libraryDependencies ++= Seq( + "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", + "com.sun.jersey" % "jersey-core" % "1.19", + "com.sun.jersey" % "jersey-client" % "1.19", + "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", + "org.jfarcand" % "jersey-ahc-client" % "1.0.5", + "io.swagger" % "swagger-core" % "1.5.8", + "joda-time" % "joda-time" % "2.2", + "org.joda" % "joda-convert" % "1.2", + "org.scalatest" %% "scalatest" % "2.2.4" % "test", + "junit" % "junit" % "4.8.1" % "test", + "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5" +) + +resolvers ++= Seq( + Resolver.mavenLocal +) + +scalacOptions := Seq( + "-unchecked", + "-deprecation", + "-feature" +) + +publishArtifact in (Compile, packageDoc) := false - publishArtifact in (Compile, packageDoc) := false - ) \ No newline at end of file diff --git a/samples/client/petstore/scala/pom.xml b/samples/client/petstore/scala/pom.xml index e61ecd8f0f9..02c83f264df 100644 --- a/samples/client/petstore/scala/pom.xml +++ b/samples/client/petstore/scala/pom.xml @@ -103,10 +103,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.6.1 - 1.6 - 1.6 + 1.7 + 1.7 @@ -209,6 +209,11 @@ joda-convert ${joda-version} + + com.wordnik.swagger + swagger-async-httpclient_2.10 + ${swagger-async-httpclient-version} + 2.10.4 @@ -223,6 +228,7 @@ 4.8.1 3.1.5 2.2.4 + 0.3.5 UTF-8 diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/AsyncClient.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/AsyncClient.scala new file mode 100644 index 00000000000..c518277f577 --- /dev/null +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/AsyncClient.scala @@ -0,0 +1,20 @@ +package io.swagger.client + +import io.swagger.client.api._ + +import com.wordnik.swagger.client._ + +import java.io.Closeable + +class AsyncClient(config: SwaggerConfig) extends Closeable { + val locator = config.locator + val name = config.name + + private[this] val client = transportClient + + protected def transportClient: TransportClient = new RestClient(config) + + def close() { + client.close() + } +} diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala index 3bcadab73c9..2941fd914f4 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala @@ -12,11 +12,12 @@ package io.swagger.client.api +import java.text.SimpleDateFormat + import io.swagger.client.model.ApiResponse import java.io.File import io.swagger.client.model.Pet -import io.swagger.client.ApiInvoker -import io.swagger.client.ApiException +import io.swagger.client.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -28,12 +29,41 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new PetApiAsyncHelper(client, config) /** * Add a new pet to the store @@ -42,39 +72,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def addPet(body: Pet) = { - // create path and map variables - val path = "/pet".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json", "application/xml") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(addPetAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Add a new pet to the store asynchronously + * + * @param body Pet object that needs to be added to the store + * @return Future(void) + */ + def addPetAsync(body: Pet) = { + helper.addPet(body) + } + + /** * Deletes a pet * @@ -83,38 +99,26 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def deletePet(petId: Long, apiKey: Option[String] = None) = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - apiKey.map(paramVal => headerParams += "api_key" -> paramVal) - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(deletePetAsync(petId, apiKey), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Deletes a pet asynchronously + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return Future(void) + */ + def deletePetAsync(petId: Long, apiKey: Option[String] = None) = { + helper.deletePet(petId, apiKey) + } + + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -122,41 +126,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return List[Pet] */ def findPetsByStatus(status: List[String]): Option[List[Pet]] = { - // create path and map variables - val path = "/pet/findByStatus".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") - - queryParams += "status" -> status.toString - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(findPetsByStatusAsync(status), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Finds Pets by status asynchronously + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return Future(List[Pet]) + */ + def findPetsByStatusAsync(status: List[String]): Future[List[Pet]] = { + helper.findPetsByStatus(status) + } + + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -164,41 +152,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return List[Pet] */ def findPetsByTags(tags: List[String]): Option[List[Pet]] = { - // create path and map variables - val path = "/pet/findByTags".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") - - queryParams += "tags" -> tags.toString - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(findPetsByTagsAsync(tags), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Finds Pets by tags asynchronously + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return Future(List[Pet]) + */ + def findPetsByTagsAsync(tags: List[String]): Future[List[Pet]] = { + helper.findPetsByTags(tags) + } + + /** * Find pet by ID * Returns a single pet @@ -206,38 +178,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return Pet */ def getPetById(petId: Long): Option[Pet] = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getPetByIdAsync(petId), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[Pet]).asInstanceOf[Pet]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Find pet by ID asynchronously + * Returns a single pet + * @param petId ID of pet to return + * @return Future(Pet) + */ + def getPetByIdAsync(petId: Long): Future[Pet] = { + helper.getPetById(petId) + } + + /** * Update an existing pet * @@ -245,39 +204,25 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def updatePet(body: Pet) = { - // create path and map variables - val path = "/pet".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json", "application/xml") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(updatePetAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Update an existing pet asynchronously + * + * @param body Pet object that needs to be added to the store + * @return Future(void) + */ + def updatePetAsync(body: Pet) = { + helper.updatePet(body) + } + + /** * Updates a pet in the store with form data * @@ -287,41 +232,27 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None) = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("application/x-www-form-urlencoded") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - name.map(paramVal => mp.field("name", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - status.map(paramVal => mp.field("status", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - postBody = mp - } else { - name.map(paramVal => formParams += "name" -> paramVal.toString) - status.map(paramVal => formParams += "status" -> paramVal.toString) + val await = Try(Await.result(updatePetWithFormAsync(petId, name, status), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Updates a pet in the store with form data asynchronously + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Future(void) + */ + def updatePetWithFormAsync(petId: Long, name: Option[String] = None, status: Option[String] = None) = { + helper.updatePetWithForm(petId, name, status) + } + + /** * uploads an image * @@ -331,40 +262,172 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return ApiResponse */ def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): Option[ApiResponse] = { - // create path and map variables - val path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - val contentTypes = List("multipart/form-data") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - additionalMetadata.map(paramVal => mp.field("additionalMetadata", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - file.map(fileVal => mp.field("file", fileVal.getName)) - file.map(paramVal => mp.bodyPart(new FileDataBodyPart("file", paramVal, MediaType.MULTIPART_FORM_DATA_TYPE))) - postBody = mp - } else { - additionalMetadata.map(paramVal => formParams += "additionalMetadata" -> paramVal.toString) + val await = Try(Await.result(uploadFileAsync(petId, additionalMetadata, file), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[ApiResponse]).asInstanceOf[ApiResponse]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + } + + /** + * uploads an image asynchronously + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return Future(ApiResponse) + */ + def uploadFileAsync(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): Future[ApiResponse] = { + helper.uploadFile(petId, additionalMetadata, file) + } + + +} + +class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + + def addPet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) } } + def deletePet(petId: Long, + apiKey: Option[String] = None + )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet/{petId}") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + apiKey match { + case Some(param) => headerParams += "api_key" -> param.toString + case _ => headerParams + } + + val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def findPetsByStatus(status: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { + // create path and map variables + val path = (addFmt("/pet/findByStatus")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") + queryParams += "status" -> status.toString + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def findPetsByTags(tags: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { + // create path and map variables + val path = (addFmt("/pet/findByTags")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") + queryParams += "tags" -> tags.toString + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def getPetById(petId: Long)(implicit reader: ClientResponseReader[Pet]): Future[Pet] = { + // create path and map variables + val path = (addFmt("/pet/{petId}") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def updatePet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet") + + val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def updatePetWithForm(petId: Long, + name: Option[String] = None, + status: Option[String] = None + )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/pet/{petId}") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def uploadFile(petId: Long, + additionalMetadata: Option[String] = None, + file: Option[File] = None + )(implicit reader: ClientResponseReader[ApiResponse]): Future[ApiResponse] = { + // create path and map variables + val path = (addFmt("/pet/{petId}/uploadImage") + replaceAll ("\\{" + "petId" + "\\}",petId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + } diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala index 3f72757f9eb..cb2ebf47255 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala @@ -12,9 +12,10 @@ package io.swagger.client.api +import java.text.SimpleDateFormat + import io.swagger.client.model.Order -import io.swagger.client.ApiInvoker -import io.swagger.client.ApiException +import io.swagger.client.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -26,12 +27,41 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new StoreApiAsyncHelper(client, config) /** * Delete purchase order by ID @@ -40,77 +70,49 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def deleteOrder(orderId: String) = { - // create path and map variables - val path = "/store/order/{orderId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (orderId == null) throw new Exception("Missing required parameter 'orderId' when calling StoreApi->deleteOrder") - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(deleteOrderAsync(orderId), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Delete purchase order by ID asynchronously + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return Future(void) + */ + def deleteOrderAsync(orderId: String) = { + helper.deleteOrder(orderId) + } + + /** * Returns pet inventories by status * Returns a map of status codes to quantities * @return Map[String, Integer] */ def getInventory(): Option[Map[String, Integer]] = { - // create path and map variables - val path = "/store/inventory".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getInventoryAsync(), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "map", classOf[Integer]).asInstanceOf[Map[String, Integer]]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Returns pet inventories by status asynchronously + * Returns a map of status codes to quantities + * @return Future(Map[String, Integer]) + */ + def getInventoryAsync(): Future[Map[String, Integer]] = { + helper.getInventory() + } + + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -118,38 +120,25 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return Order */ def getOrderById(orderId: Long): Option[Order] = { - // create path and map variables - val path = "/store/order/{orderId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getOrderByIdAsync(orderId), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Find purchase order by ID asynchronously + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Future(Order) + */ + def getOrderByIdAsync(orderId: Long): Future[Order] = { + helper.getOrderById(orderId) + } + + /** * Place an order for a pet * @@ -157,38 +146,93 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return Order */ def placeOrder(body: Order): Option[Order] = { - // create path and map variables - val path = "/store/order".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(placeOrderAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + } + + /** + * Place an order for a pet asynchronously + * + * @param body order placed for purchasing the pet + * @return Future(Order) + */ + def placeOrderAsync(body: Order): Future[Order] = { + helper.placeOrder(body) + } + + +} + +class StoreApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + + def deleteOrder(orderId: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/store/order/{orderId}") + replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (orderId == null) throw new Exception("Missing required parameter 'orderId' when calling StoreApi->deleteOrder") + + + val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) } } + def getInventory()(implicit reader: ClientResponseReader[Map[String, Integer]]): Future[Map[String, Integer]] = { + // create path and map variables + val path = (addFmt("/store/inventory")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def getOrderById(orderId: Long)(implicit reader: ClientResponseReader[Order]): Future[Order] = { + // create path and map variables + val path = (addFmt("/store/order/{orderId}") + replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def placeOrder(body: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = { + // create path and map variables + val path = (addFmt("/store/order")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + } diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala index df039c1f7cc..7893cc26677 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala @@ -12,9 +12,10 @@ package io.swagger.client.api +import java.text.SimpleDateFormat + import io.swagger.client.model.User -import io.swagger.client.ApiInvoker -import io.swagger.client.ApiException +import io.swagger.client.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -26,12 +27,41 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new UserApiAsyncHelper(client, config) /** * Create user @@ -40,39 +70,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def createUser(body: User) = { - // create path and map variables - val path = "/user".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(createUserAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Create user asynchronously + * This can only be done by the logged in user. + * @param body Created user object + * @return Future(void) + */ + def createUserAsync(body: User) = { + helper.createUser(body) + } + + /** * Creates list of users with given input array * @@ -80,39 +96,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def createUsersWithArrayInput(body: List[User]) = { - // create path and map variables - val path = "/user/createWithArray".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(createUsersWithArrayInputAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Creates list of users with given input array asynchronously + * + * @param body List of user object + * @return Future(void) + */ + def createUsersWithArrayInputAsync(body: List[User]) = { + helper.createUsersWithArrayInput(body) + } + + /** * Creates list of users with given input array * @@ -120,39 +122,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def createUsersWithListInput(body: List[User]) = { - // create path and map variables - val path = "/user/createWithList".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput") - - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(createUsersWithListInputAsync(body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Creates list of users with given input array asynchronously + * + * @param body List of user object + * @return Future(void) + */ + def createUsersWithListInputAsync(body: List[User]) = { + helper.createUsersWithListInput(body) + } + + /** * Delete user * This can only be done by the logged in user. @@ -160,39 +148,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def deleteUser(username: String) = { - // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->deleteUser") - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(deleteUserAsync(username), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Delete user asynchronously + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return Future(void) + */ + def deleteUserAsync(username: String) = { + helper.deleteUser(username) + } + + /** * Get user by user name * @@ -200,40 +174,25 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return User */ def getUserByName(username: String): Option[User] = { - // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->getUserByName") - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(getUserByNameAsync(username), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[User]).asInstanceOf[User]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Get user by user name asynchronously + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return Future(User) + */ + def getUserByNameAsync(username: String): Future[User] = { + helper.getUserByName(username) + } + + /** * Logs user into the system * @@ -242,81 +201,50 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return String */ def loginUser(username: String, password: String): Option[String] = { - // create path and map variables - val path = "/user/login".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->loginUser") - - if (password == null) throw new Exception("Missing required parameter 'password' when calling UserApi->loginUser") - - queryParams += "username" -> username.toString - queryParams += "password" -> password.toString - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(loginUserAsync(username, password), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(apiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String]) - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Logs user into the system asynchronously + * + * @param username The user name for login + * @param password The password for login in clear text + * @return Future(String) + */ + def loginUserAsync(username: String, password: String): Future[String] = { + helper.loginUser(username, password) + } + + /** * Logs out current logged in user session * * @return void */ def logoutUser() = { - // create path and map variables - val path = "/user/logout".replaceAll("\\{format\\}", "json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - var postBody: AnyRef = null - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { + val await = Try(Await.result(logoutUserAsync(), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None } - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } } + /** + * Logs out current logged in user session asynchronously + * + * @return Future(void) + */ + def logoutUserAsync() = { + helper.logoutUser() + } + + /** * Updated user * This can only be done by the logged in user. @@ -325,39 +253,170 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @return void */ def updateUser(username: String, body: User) = { + val await = Try(Await.result(updateUserAsync(username, body), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None + } + + } + + /** + * Updated user asynchronously + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return Future(void) + */ + def updateUserAsync(username: String, body: User) = { + helper.updateUser(username, body) + } + + +} + +class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { + + def createUser(body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) + val path = (addFmt("/user")) - val contentTypes = List("application/json") - val contentType = contentTypes(0) + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] + if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def createUsersWithArrayInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/createWithArray")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def createUsersWithListInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/createWithList")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput") + + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def deleteUser(username: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/{username}") + replaceAll ("\\{" + "username" + "\\}",username.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->deleteUser") + + + val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def getUserByName(username: String)(implicit reader: ClientResponseReader[User]): Future[User] = { + // create path and map variables + val path = (addFmt("/user/{username}") + replaceAll ("\\{" + "username" + "\\}",username.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->getUserByName") + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def loginUser(username: String, + password: String)(implicit reader: ClientResponseReader[String]): Future[String] = { + // create path and map variables + val path = (addFmt("/user/login")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->loginUser") + + if (password == null) throw new Exception("Missing required parameter 'password' when calling UserApi->loginUser") + + queryParams += "username" -> username.toString + queryParams += "password" -> password.toString + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def logoutUser()(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/logout")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] + + + val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) + } + } + + def updateUser(username: String, + body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/user/{username}") + replaceAll ("\\{" + "username" + "\\}",username.toString)) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->updateUser") if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->updateUser") - - - var postBody: AnyRef = body - - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - postBody = mp - } else { - } - - try { - apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + resFuture flatMap { resp => + process(reader.read(resp)) } } + } diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala index a88c0ec23d9..84691796eaf 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala @@ -12,13 +12,13 @@ package io.swagger.client.model -import org.joda.time.DateTime +import java.util.Date case class Order ( id: Option[Long], petId: Option[Long], quantity: Option[Integer], - shipDate: Option[DateTime], + shipDate: Option[Date], /* Order Status */ status: Option[String], complete: Option[Boolean] diff --git a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala index 62ee880e300..7618d7b48b2 100644 --- a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala @@ -1,7 +1,8 @@ import io.swagger.client._ import io.swagger.client.api._ import io.swagger.client.model._ - +import org.joda.time.DateTime + import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest._ @@ -9,6 +10,7 @@ import org.scalatest._ import scala.collection.mutable.{ ListBuffer, HashMap } import scala.collection.JavaConverters._ import scala.beans.BeanProperty +import java.util.Date @RunWith(classOf[JUnitRunner]) class StoreApiTest extends FlatSpec with Matchers { @@ -18,7 +20,7 @@ class StoreApiTest extends FlatSpec with Matchers { api.apiInvoker.defaultHeaders += "api_key" -> "special-key" it should "place and fetch an order" in { - val now = new org.joda.time.DateTime + val now = new Date() val order = Order( petId = Some(10), id = Some(1000), @@ -31,18 +33,17 @@ class StoreApiTest extends FlatSpec with Matchers { api.getOrderById(1000) match { case Some(order) => { - order.id should be(Some(1000)) - order.petId should be(Some(10)) - order.quantity should be(Some(101)) - // use `getMillis` to compare across timezones - order.shipDate.get.getMillis.equals(now.getMillis) should be(true) + order.id.get should be(1000) + order.petId.get should be(10) + order.quantity.get should be(101) + order.shipDate.get.getTime().equals(now.getTime()) should be(true) } case None => fail("didn't find order created") } } it should "delete an order" in { - val now = new org.joda.time.DateTime + val now = new Date() val order = Order( id = Some(1001), petId = Some(10), diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 49d2bf5263f..dbe5b5a379e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -249,7 +249,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.encodeToJSON()?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 0b394d213d1..91734ecbb02 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -25,7 +25,7 @@ open class StoreAPI: APIBase { /** Delete purchase order by ID - - DELETE /store/order/{orderId} + - DELETE /store/order/{order_id} - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - parameter orderId: (path) ID of the order that needs to be deleted @@ -33,8 +33,8 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -99,7 +99,7 @@ open class StoreAPI: APIBase { /** Find purchase order by ID - - GET /store/order/{orderId} + - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= 123456789 @@ -137,8 +137,8 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index 6b9a28731c7..e154f2cb91c 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -7,78 +7,78 @@ objects = { /* Begin PBXBuildFile section */ - 0C000B886A8014E5D567C1D9D65DD74A /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAF332E1A7441FB724BBDE4A2D5FCDC /* Pet.swift */; }; - 0CF86BADF47E0DFB69F2D4AAE8CAA5ED /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = C779250D7B6267BBEC8FA6A297E951FD /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 0EAB00E2A951259911DB3D86AED93169 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D623BDE9C79D43A58D9951169D5DCE8 /* EnumTest.swift */; }; + 08C43F202E7FC3E8F2730CCB9FBD7998 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68F1532A628EE993828CBA58896E7077 /* Animal.swift */; }; + 0BD2D76CD41573EC2B53977627E0D5BB /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D747F63B54800CA25A7BD82901C9E5B8 /* EnumTest.swift */; }; + 101544113D88337D6D76FC4B35796A04 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCEBCA85782D727141183DF7298544 /* Model200Response.swift */; }; 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */; }; - 110288FCF6186BE86A317D67FFB45EA4 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA68C5328B3080DB6504E903EE8FC138 /* OuterEnum.swift */; }; - 1423DAD26BD241806D915F77200D86CA /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943AD326EA457918AA6124DF2D2A8AE5 /* ArrayTest.swift */; }; + 14173079C167B121B3165D371B1025B0 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04BB42169F4AA842BDAF3AE759B5499 /* NumberOnly.swift */; }; + 1627426CA13781AE27C0FC0C98F6A88D /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961587EA83091B2F9AEE38309E8FEAD2 /* Category.swift */; }; 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1E51978A44E02D6C9FD452962FA314C2 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFDD5568A22EED27D7570975E4B81B6B /* AnimalFarm.swift */; }; - 215B55F77DCF17AF5EE73A1FA39A348F /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E566ACDC2E2B9BD209C52F6FC3F038 /* Category.swift */; }; - 259DBF125A08D2CC6263AFD6914309A1 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26F0BD741D5BE8D7ECA2569B96E3F60C /* ApiResponse.swift */; }; + 218599F3A5EF5064545F1C63CD2014ED /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDCA21B6B5A92CAC0C8614897A7A350 /* EnumArrays.swift */; }; + 250F58C891252EFD0C30E681503B370A /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49F65158ED08BBC80BE7E0B1AD07E53 /* Dog.swift */; }; 2940D84FC5A76050A9281E6E49A8BDFC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; - 2EE505BF09DDA06E95B6466C42C4F713 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A776729DD3FE9677991E54DE267FD577 /* StoreAPI.swift */; }; 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 361E2A66B95CFFFF9636F2560925C94B /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E742DEDE04FF6FAEC9F376ED9E6AE2C /* AdditionalPropertiesClass.swift */; }; + 349A70A41286448022F4219D4FDE0678 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */; }; + 39F639E647EE2C7BBBE1D600D5460A09 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECAB007B9E3FC36BC739A9EB818EA824 /* ArrayOfArrayOfNumberOnly.swift */; }; + 3A93D7E1111888C47B0138AE97A5012A /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB81005AEC77102285A1E6264F64BD01 /* EnumClass.swift */; }; + 3E2E6328563E0FA71FE88D30BC1736D7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65A325E17ACAC88392A15A2D3729E85 /* Order.swift */; }; + 40B3F80E1C272838FA43C7C60D600B13 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1BA9FDB9AA069E50EB9BC9BE5E2595 /* Capitalization.swift */; }; 424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5185A19D002CC10E4948066B5D07F283 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF4F0123552CEF7C9700A7F1DA9C2C73 /* Models.swift */; }; - 526C6BD10D7792467A73505EB0F5234C /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB59A7DB4A9B911E525ECC513D74D00D /* Fake_classname_tags123API.swift */; }; + 4A61D9C5338D311C1F3ECAD10586E02E /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54D3D1BF2F7AAD8DDA8AA9000EEF7E24 /* AlamofireImplementations.swift */; }; + 5337DF6516B114157BDCD4F0957801D0 /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6A8D9AA50FF8C8619543654B4CB9CBA /* FakeclassnametagsAPI.swift */; }; 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */; }; - 54D158EDB36A7B92F7D90B56A40AC6A9 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46ADFA647DB262579870CDE7A7A9B130 /* PetAPI.swift */; }; - 5532A389A0DDD00958CDACACD84AB89B /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1CA3CB3CA69090E8097D77974F95F4E /* User.swift */; }; - 5DF731758112F165BD9A8A8278BCDA26 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03A35854A2FF642B3B732D763DB0D0BD /* Tag.swift */; }; 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */; }; 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */; }; - 6479245096A6BCFF431559465E910769 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; - 675A47E176F499215ECCB89414950A40 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7827148096A3B614608E8642496DB653 /* AlamofireImplementations.swift */; }; - 68926300DAEAB352890C0FA7466299B2 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3E1EA7F03A8F7699B4A38A0059B6DB6 /* Animal.swift */; }; - 6CF9F73E6F33FFEFA16AD2A2B0038268 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B96675384F47A8DB92E2D3370733CC1 /* EnumClass.swift */; }; - 6D142A4259297C2C18AE1A239E1F8BD4 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE24724902D07CDE0116B09FAFD21D57 /* Dog.swift */; }; - 75FE7D9EF20002465C295A5919B17FC2 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 674818A79F12C550C32D5B20F9F2904C /* EnumArrays.swift */; }; - 78962A6680E10E4D5D4E6AB3CB7436C5 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB3C91F15E6A6CE25AA56BB132BD2282 /* FormatTest.swift */; }; - 7A80FA0C32FA8BCCECCA86267952CB2A /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B98974498DE6D6290EEA35B2A9E347BB /* ArrayOfArrayOfNumberOnly.swift */; }; + 6450DC9EC00124441CAB9D8535690EB4 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120C94C2E4BEDE65D04B4EE9C32A0038 /* Pet.swift */; }; + 67FA28ADA5C61404EAEB8EE36F647FDC /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = B97601D373B1D5711E447E10A0CC4F6D /* FakeAPI.swift */; }; + 682AD79495052A0A6050DA92FCA57A19 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8390BF121CB383DD1401F46C5AA233 /* List.swift */; }; + 684364DEE25D2AF06EFE39858D990BF1 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 819E062D7F61C17490818E0BCFFFDF0E /* UserAPI.swift */; }; + 7105B2BD1B0604B931E000F16375A335 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB2BB4A2799CABCEDB8D0D5B8781EDB2 /* AdditionalPropertiesClass.swift */; }; + 743033B7F8964EC3AC0C727285876396 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB022FF8397B96FAA2B677A324A90FD9 /* SpecialModelName.swift */; }; + 7AE18812CE9232702AF58A4AB11A3D4A /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491EDD44EFDD92A201B53563DDDE4A9E /* Models.swift */; }; 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */; }; - 7B6574F5BE82011621382001E602733A /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A0F510D3CD5F6FE074AA8A702B78FD4 /* APIHelper.swift */; }; + 7B6B385930B1AE86207EB383F0E9EE2B /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 365A8DF94D36E821363A42428BCD1031 /* ArrayTest.swift */; }; + 7D554A5466BFF077A46F15FA5A3F3F6E /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE53D3942CFE21651116525035B81D7C /* OuterEnum.swift */; }; 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */; }; - 7F2C9B3201AE0B9BD925611F816B78D2 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D74E3639B8306BCE21EAC827F2D0F06 /* Model200Response.swift */; }; - 872661BC16DCBAF99952C820ED6173C1 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A6FD821125243353793A74C26AF6AB2 /* ArrayOfNumberOnly.swift */; }; - 87B80AADC7CA6556DF4560C015F03A48 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46C5EA7F33E59F5A0BAC7ED154EF5189 /* FakeAPI.swift */; }; + 860196CD1483F19757C7C30460CD7CA4 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3125CE1AA4B5F8E028508109C83F5F1 /* ReadOnlyFirst.swift */; }; + 88D936AADB6658A0BC97E6CEC17499F7 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDBE3A46B042180DAB5CBC2DD404F0E /* Tag.swift */; }; 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; - 8EBE12562F03B03ECED283954845976D /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A79C16689E69DE8EF122B5638FFC47D /* List.swift */; }; + 8AE1AE495DB124BB4E2D7059474CE42B /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0098C1592E8430B748726E544912A1 /* Name.swift */; }; 906B042F9112F8CACC1B3DE516C50BF7 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 92CE3FFCB9DEC0A83CC7F8E542BFCEE3 /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAFDF0366C6686A7B947426AF20A128 /* FakeclassnametagsAPI.swift */; }; - 92E8FE2F3FB67E0AF71B48BDC17BCC4C /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE8B2057191DB8F5E2AE31FB27135B6C /* MapTest.swift */; }; - 99FFDEFE82CEC70F6E1F1BF315145457 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9EB90FD68C4C823BA7428D94E80A7B3 /* Return.swift */; }; - 9A82B11744625507F3311B082A67D840 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CFD31C609D01246A22B3FA2FFB24D83 /* Extensions.swift */; }; + 91CD595D13E4C78B57CBDC20C0C13209 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 697336DF4BC71FC961062DEDC74B10D7 /* Cat.swift */; }; + 934A78EEFA3B86BFFEEFE8D4A6112260 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EA20E9A1C84F318CA3FD2F021E9906F /* User.swift */; }; + 9573F1161F43C18D877073A50900A80D /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04806F8C04EBBB3224C7A474458422DA /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 97E6DEC487E46176D3BA79ECEF5204C5 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E754BEE325D40D820E16CA799169C237 /* Extensions.swift */; }; + 9998431EE4A288A2E6DF7BAB4A930DD8 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D630602D10F3D2A85CEE76F189275B /* ApiResponse.swift */; }; + 9C1A054E67A88CC59D61E008F71E887E /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4A9A07645EB155AC1BF4D6ECBB6156 /* APIHelper.swift */; }; 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */; }; A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */; }; - A2CB4433D3F4970A687BA730779AF577 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7D5B61AC90BA0704509CAE6D0F2685B /* ClassModel.swift */; }; + A8C7A08EC7E9FECA42EB7121E72B35E9 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC5715863B484EC717E95EEDDA94C35 /* FormatTest.swift */; }; A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */; }; + ADC74AA8A82AFCC5B67BC92D4F4DB4EB /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA89D6AA95A0BF0E5A0AC9A07DB5F3C /* Return.swift */; }; AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */; }; - AFD0458924C288212D4EF81D4DF958C3 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACBCE80BA837EB73E5A6E45B40F004B8 /* UserAPI.swift */; }; + AF3CFFEF5A1F0B1D4D1055AA2CF0D1AB /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735DF6DCB8DF1DB5486F629DF186F1A6 /* ClassModel.swift */; }; + B477B88CCF55DFD09CCEEF6BD1FF3D2A /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986BD40E95F02B6ADAB839A173A1B161 /* AnimalFarm.swift */; }; B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */; }; BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */; }; BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */; }; - C184FE739831FDDCD3E7973BA870F774 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B517EAE75FC00740AEAA0C504C4B2C6 /* Order.swift */; }; + C310B9190A08C4953C5165F339619A5B /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76B2B26ECFA85A2712236F2685A93E58 /* MapTest.swift */; }; CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; }; - CF2EE9BA90408C832F894412D9724944 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = A20AD60386D12E72B2313A4ED186F1FE /* ReadOnlyFirst.swift */; }; + CCF54C34B39F632B57B1979B0EE6E11D /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D96ACDBF867C25CD7FE0FB6C1002941 /* Client.swift */; }; + CF2FA6B16F54FBF111D56D9D57A5C51A /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD32E3264114454DF22A00E18D083302 /* ArrayOfNumberOnly.swift */; }; + CFEF569B1FF3C7619EA8A735E2720D75 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E2037B5CB54CBF7D9D6620AAC6EF60 /* APIs.swift */; }; D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; - D6C5DAB5C879495F61515922F51D1AFA /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882D08B71AAD3418842BE142C533D36B /* Cat.swift */; }; - E13D5D981B849603B4766AE6CA742DEE /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 139DB709435F037DC55BE45FDFF8D13D /* Name.swift */; }; + D92051A8C9E0A9D7972301C931875DE7 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 817F7932C125759CB8757941957FB522 /* HasOnlyReadOnly.swift */; }; + DD556A602A0205DC3BDFD3D9D4D042AA /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAA905B5713059C9E66DC79FB432E1AC /* StoreAPI.swift */; }; E74D29AD603F3CDFE7789CC03E3290A5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; - EED6858187428DC889DF482284501555 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DA5C1095D6C6A40025C2D36EE2C810E /* SpecialModelName.swift */; }; EF7F4564E588BA78CC981DF4C8432234 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; - F3D336817F51F5281B557F40385371D0 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = F607471BF9870E491AA86EFB89E5ACF9 /* HasOnlyReadOnly.swift */; }; + F2CBCAA937A42298653726276FDC7318 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBE0A88D5F232C4A9581929FAEF85D /* PetAPI.swift */; }; F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; - F6FE65D070EAB1502F8CD7407F985251 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FE6ECDC7B7878E609AEE401961BF14E /* Client.swift */; }; F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; }; - FCAB896E0CBF6AE9387CFAC7BC6FB6B0 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71DB61F02CAB93E7ED7B2ECA67F3CF6C /* NumberOnly.swift */; }; - FF2151E98423EA965AA32B9BC80B5DC9 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37E5B1C1BA4FC86C3AD6DD6412AD5C3F /* APIs.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -108,84 +108,87 @@ /* Begin PBXFileReference section */ 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - 03A35854A2FF642B3B732D763DB0D0BD /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + 04806F8C04EBBB3224C7A474458422DA /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 0B517EAE75FC00740AEAA0C504C4B2C6 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - 0FE6ECDC7B7878E609AEE401961BF14E /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - 139DB709435F037DC55BE45FDFF8D13D /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 120C94C2E4BEDE65D04B4EE9C32A0038 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; 13A0A663B36A229C69D5274A83E93F88 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + 21BBE0A88D5F232C4A9581929FAEF85D /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - 26F0BD741D5BE8D7ECA2569B96E3F60C /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - 2A0F510D3CD5F6FE074AA8A702B78FD4 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 2B96675384F47A8DB92E2D3370733CC1 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 37E5B1C1BA4FC86C3AD6DD6412AD5C3F /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 365A8DF94D36E821363A42428BCD1031 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - 3D74E3639B8306BCE21EAC827F2D0F06 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; - 46ADFA647DB262579870CDE7A7A9B130 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 46C5EA7F33E59F5A0BAC7ED154EF5189 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 491EDD44EFDD92A201B53563DDDE4A9E /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - 4D623BDE9C79D43A58D9951169D5DCE8 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 4C0098C1592E8430B748726E544912A1 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 4CFCEBCA85782D727141183DF7298544 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + 54D3D1BF2F7AAD8DDA8AA9000EEF7E24 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 674818A79F12C550C32D5B20F9F2904C /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 6A6FD821125243353793A74C26AF6AB2 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + 68F1532A628EE993828CBA58896E7077 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + 697336DF4BC71FC961062DEDC74B10D7 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6E742DEDE04FF6FAEC9F376ED9E6AE2C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 71DB61F02CAB93E7ED7B2ECA67F3CF6C /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 7827148096A3B614608E8642496DB653 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 7AAF332E1A7441FB724BBDE4A2D5FCDC /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + 735DF6DCB8DF1DB5486F629DF186F1A6 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 76B2B26ECFA85A2712236F2685A93E58 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - 7DA5C1095D6C6A40025C2D36EE2C810E /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + 817F7932C125759CB8757941957FB522 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + 819E062D7F61C17490818E0BCFFFDF0E /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - 882D08B71AAD3418842BE142C533D36B /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8A79C16689E69DE8EF122B5638FFC47D /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 8D96ACDBF867C25CD7FE0FB6C1002941 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 8EA20E9A1C84F318CA3FD2F021E9906F /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 943AD326EA457918AA6124DF2D2A8AE5 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 961587EA83091B2F9AEE38309E8FEAD2 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 9CFD31C609D01246A22B3FA2FFB24D83 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + 986BD40E95F02B6ADAB839A173A1B161 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 9B4A9A07645EB155AC1BF4D6ECBB6156 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 9EC5715863B484EC717E95EEDDA94C35 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - A1CA3CB3CA69090E8097D77974F95F4E /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - A20AD60386D12E72B2313A4ED186F1FE /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - A6E566ACDC2E2B9BD209C52F6FC3F038 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - A776729DD3FE9677991E54DE267FD577 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - ACBCE80BA837EB73E5A6E45B40F004B8 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + A04BB42169F4AA842BDAF3AE759B5499 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + A49F65158ED08BBC80BE7E0B1AD07E53 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + A6A8D9AA50FF8C8619543654B4CB9CBA /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; + AD32E3264114454DF22A00E18D083302 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - B98974498DE6D6290EEA35B2A9E347BB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - B9EB90FD68C4C823BA7428D94E80A7B3 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + B65A325E17ACAC88392A15A2D3729E85 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + B97601D373B1D5711E447E10A0CC4F6D /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + BB022FF8397B96FAA2B677A324A90FD9 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; BCCA9CA7D9C1A2047BB93336C5708DFD /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - C779250D7B6267BBEC8FA6A297E951FD /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - CFDD5568A22EED27D7570975E4B81B6B /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + BD8390BF121CB383DD1401F46C5AA233 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + BE53D3942CFE21651116525035B81D7C /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + C3125CE1AA4B5F8E028508109C83F5F1 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + C3E2037B5CB54CBF7D9D6620AAC6EF60 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + C5D630602D10F3D2A85CEE76F189275B /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + CAA905B5713059C9E66DC79FB432E1AC /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + CB2BB4A2799CABCEDB8D0D5B8781EDB2 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + CB81005AEC77102285A1E6264F64BD01 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + CBA89D6AA95A0BF0E5A0AC9A07DB5F3C /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; + D747F63B54800CA25A7BD82901C9E5B8 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - DB59A7DB4A9B911E525ECC513D74D00D /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; - DDAFDF0366C6686A7B947426AF20A128 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; + DCDCA21B6B5A92CAC0C8614897A7A350 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; - DE8B2057191DB8F5E2AE31FB27135B6C /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; @@ -193,16 +196,13 @@ E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + E754BEE325D40D820E16CA799169C237 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - EA68C5328B3080DB6504E903EE8FC138 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - EB3C91F15E6A6CE25AA56BB132BD2282 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - EE24724902D07CDE0116B09FAFD21D57 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - EF4F0123552CEF7C9700A7F1DA9C2C73 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + ECAB007B9E3FC36BC739A9EB818EA824 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + ECDBE3A46B042180DAB5CBC2DD404F0E /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - F3E1EA7F03A8F7699B4A38A0059B6DB6 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - F607471BF9870E491AA86EFB89E5ACF9 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - F7D5B61AC90BA0704509CAE6D0F2685B /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + FA1BA9FDB9AA069E50EB9BC9BE5E2595 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -277,6 +277,21 @@ name = "Development Pods"; sourceTree = ""; }; + 2C2F53D531E4AFD446B6ED6DEE846B7F /* Swaggers */ = { + isa = PBXGroup; + children = ( + 54D3D1BF2F7AAD8DDA8AA9000EEF7E24 /* AlamofireImplementations.swift */, + 9B4A9A07645EB155AC1BF4D6ECBB6156 /* APIHelper.swift */, + C3E2037B5CB54CBF7D9D6620AAC6EF60 /* APIs.swift */, + E754BEE325D40D820E16CA799169C237 /* Extensions.swift */, + 491EDD44EFDD92A201B53563DDDE4A9E /* Models.swift */, + FB1F6F6B93761E324908C8D85617C01F /* APIs */, + B68B316D246A5194B95DD72268A66457 /* Models */, + ); + name = Swaggers; + path = Swaggers; + sourceTree = ""; + }; 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = { isa = PBXGroup; children = ( @@ -285,59 +300,6 @@ name = Pods; sourceTree = ""; }; - 49183FCAF0F17F400CC0C62EA451806A /* Models */ = { - isa = PBXGroup; - children = ( - 6E742DEDE04FF6FAEC9F376ED9E6AE2C /* AdditionalPropertiesClass.swift */, - F3E1EA7F03A8F7699B4A38A0059B6DB6 /* Animal.swift */, - CFDD5568A22EED27D7570975E4B81B6B /* AnimalFarm.swift */, - 26F0BD741D5BE8D7ECA2569B96E3F60C /* ApiResponse.swift */, - B98974498DE6D6290EEA35B2A9E347BB /* ArrayOfArrayOfNumberOnly.swift */, - 6A6FD821125243353793A74C26AF6AB2 /* ArrayOfNumberOnly.swift */, - 943AD326EA457918AA6124DF2D2A8AE5 /* ArrayTest.swift */, - 882D08B71AAD3418842BE142C533D36B /* Cat.swift */, - A6E566ACDC2E2B9BD209C52F6FC3F038 /* Category.swift */, - F7D5B61AC90BA0704509CAE6D0F2685B /* ClassModel.swift */, - 0FE6ECDC7B7878E609AEE401961BF14E /* Client.swift */, - EE24724902D07CDE0116B09FAFD21D57 /* Dog.swift */, - 674818A79F12C550C32D5B20F9F2904C /* EnumArrays.swift */, - 2B96675384F47A8DB92E2D3370733CC1 /* EnumClass.swift */, - 4D623BDE9C79D43A58D9951169D5DCE8 /* EnumTest.swift */, - EB3C91F15E6A6CE25AA56BB132BD2282 /* FormatTest.swift */, - F607471BF9870E491AA86EFB89E5ACF9 /* HasOnlyReadOnly.swift */, - 8A79C16689E69DE8EF122B5638FFC47D /* List.swift */, - DE8B2057191DB8F5E2AE31FB27135B6C /* MapTest.swift */, - C779250D7B6267BBEC8FA6A297E951FD /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 3D74E3639B8306BCE21EAC827F2D0F06 /* Model200Response.swift */, - 139DB709435F037DC55BE45FDFF8D13D /* Name.swift */, - 71DB61F02CAB93E7ED7B2ECA67F3CF6C /* NumberOnly.swift */, - 0B517EAE75FC00740AEAA0C504C4B2C6 /* Order.swift */, - EA68C5328B3080DB6504E903EE8FC138 /* OuterEnum.swift */, - 7AAF332E1A7441FB724BBDE4A2D5FCDC /* Pet.swift */, - A20AD60386D12E72B2313A4ED186F1FE /* ReadOnlyFirst.swift */, - B9EB90FD68C4C823BA7428D94E80A7B3 /* Return.swift */, - 7DA5C1095D6C6A40025C2D36EE2C810E /* SpecialModelName.swift */, - 03A35854A2FF642B3B732D763DB0D0BD /* Tag.swift */, - A1CA3CB3CA69090E8097D77974F95F4E /* User.swift */, - ); - name = Models; - path = Models; - sourceTree = ""; - }; - 5057832E4BF5A63A3D14138D4DC02A76 /* APIs */ = { - isa = PBXGroup; - children = ( - DB59A7DB4A9B911E525ECC513D74D00D /* Fake_classname_tags123API.swift */, - 46C5EA7F33E59F5A0BAC7ED154EF5189 /* FakeAPI.swift */, - DDAFDF0366C6686A7B947426AF20A128 /* FakeclassnametagsAPI.swift */, - 46ADFA647DB262579870CDE7A7A9B130 /* PetAPI.swift */, - A776729DD3FE9677991E54DE267FD577 /* StoreAPI.swift */, - ACBCE80BA837EB73E5A6E45B40F004B8 /* UserAPI.swift */, - ); - name = APIs; - path = APIs; - sourceTree = ""; - }; 55F14F994FE7AB51F028BFE66CEF3106 /* Support Files */ = { isa = PBXGroup; children = ( @@ -427,12 +389,52 @@ AD94092456F8ABCB18F74CAC75AD85DE /* Classes */ = { isa = PBXGroup; children = ( - ECF20498E2F38FF69AC5DDAE5C5C6A8F /* Swaggers */, + 2C2F53D531E4AFD446B6ED6DEE846B7F /* Swaggers */, ); name = Classes; path = Classes; sourceTree = ""; }; + B68B316D246A5194B95DD72268A66457 /* Models */ = { + isa = PBXGroup; + children = ( + CB2BB4A2799CABCEDB8D0D5B8781EDB2 /* AdditionalPropertiesClass.swift */, + 68F1532A628EE993828CBA58896E7077 /* Animal.swift */, + 986BD40E95F02B6ADAB839A173A1B161 /* AnimalFarm.swift */, + C5D630602D10F3D2A85CEE76F189275B /* ApiResponse.swift */, + ECAB007B9E3FC36BC739A9EB818EA824 /* ArrayOfArrayOfNumberOnly.swift */, + AD32E3264114454DF22A00E18D083302 /* ArrayOfNumberOnly.swift */, + 365A8DF94D36E821363A42428BCD1031 /* ArrayTest.swift */, + FA1BA9FDB9AA069E50EB9BC9BE5E2595 /* Capitalization.swift */, + 697336DF4BC71FC961062DEDC74B10D7 /* Cat.swift */, + 961587EA83091B2F9AEE38309E8FEAD2 /* Category.swift */, + 735DF6DCB8DF1DB5486F629DF186F1A6 /* ClassModel.swift */, + 8D96ACDBF867C25CD7FE0FB6C1002941 /* Client.swift */, + A49F65158ED08BBC80BE7E0B1AD07E53 /* Dog.swift */, + DCDCA21B6B5A92CAC0C8614897A7A350 /* EnumArrays.swift */, + CB81005AEC77102285A1E6264F64BD01 /* EnumClass.swift */, + D747F63B54800CA25A7BD82901C9E5B8 /* EnumTest.swift */, + 9EC5715863B484EC717E95EEDDA94C35 /* FormatTest.swift */, + 817F7932C125759CB8757941957FB522 /* HasOnlyReadOnly.swift */, + BD8390BF121CB383DD1401F46C5AA233 /* List.swift */, + 76B2B26ECFA85A2712236F2685A93E58 /* MapTest.swift */, + 04806F8C04EBBB3224C7A474458422DA /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 4CFCEBCA85782D727141183DF7298544 /* Model200Response.swift */, + 4C0098C1592E8430B748726E544912A1 /* Name.swift */, + A04BB42169F4AA842BDAF3AE759B5499 /* NumberOnly.swift */, + B65A325E17ACAC88392A15A2D3729E85 /* Order.swift */, + BE53D3942CFE21651116525035B81D7C /* OuterEnum.swift */, + 120C94C2E4BEDE65D04B4EE9C32A0038 /* Pet.swift */, + C3125CE1AA4B5F8E028508109C83F5F1 /* ReadOnlyFirst.swift */, + CBA89D6AA95A0BF0E5A0AC9A07DB5F3C /* Return.swift */, + BB022FF8397B96FAA2B677A324A90FD9 /* SpecialModelName.swift */, + ECDBE3A46B042180DAB5CBC2DD404F0E /* Tag.swift */, + 8EA20E9A1C84F318CA3FD2F021E9906F /* User.swift */, + ); + name = Models; + path = Models; + sourceTree = ""; + }; C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { isa = PBXGroup; children = ( @@ -479,19 +481,17 @@ path = ../..; sourceTree = ""; }; - ECF20498E2F38FF69AC5DDAE5C5C6A8F /* Swaggers */ = { + FB1F6F6B93761E324908C8D85617C01F /* APIs */ = { isa = PBXGroup; children = ( - 7827148096A3B614608E8642496DB653 /* AlamofireImplementations.swift */, - 2A0F510D3CD5F6FE074AA8A702B78FD4 /* APIHelper.swift */, - 37E5B1C1BA4FC86C3AD6DD6412AD5C3F /* APIs.swift */, - 9CFD31C609D01246A22B3FA2FFB24D83 /* Extensions.swift */, - EF4F0123552CEF7C9700A7F1DA9C2C73 /* Models.swift */, - 5057832E4BF5A63A3D14138D4DC02A76 /* APIs */, - 49183FCAF0F17F400CC0C62EA451806A /* Models */, + B97601D373B1D5711E447E10A0CC4F6D /* FakeAPI.swift */, + A6A8D9AA50FF8C8619543654B4CB9CBA /* FakeclassnametagsAPI.swift */, + 21BBE0A88D5F232C4A9581929FAEF85D /* PetAPI.swift */, + CAA905B5713059C9E66DC79FB432E1AC /* StoreAPI.swift */, + 819E062D7F61C17490818E0BCFFFDF0E /* UserAPI.swift */, ); - name = Swaggers; - path = Swaggers; + name = APIs; + path = APIs; sourceTree = ""; }; /* End PBXGroup section */ @@ -536,7 +536,7 @@ isa = PBXNativeTarget; buildConfigurationList = 5C20281827228C999505802256DA894B /* Build configuration list for PBXNativeTarget "PetstoreClient" */; buildPhases = ( - 2F2C3E1F2A34563483B2C9F33A313295 /* Sources */, + 308F8E580759C366F1047ACF5DA16606 /* Sources */, 6FF96BC4D69AB5070FE79110C6420DE4 /* Frameworks */, 60CD6F00C2BDEAD10522E5DDF98A4FD1 /* Headers */, ); @@ -633,53 +633,53 @@ /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 2F2C3E1F2A34563483B2C9F33A313295 /* Sources */ = { + 308F8E580759C366F1047ACF5DA16606 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 361E2A66B95CFFFF9636F2560925C94B /* AdditionalPropertiesClass.swift in Sources */, - 675A47E176F499215ECCB89414950A40 /* AlamofireImplementations.swift in Sources */, - 68926300DAEAB352890C0FA7466299B2 /* Animal.swift in Sources */, - 1E51978A44E02D6C9FD452962FA314C2 /* AnimalFarm.swift in Sources */, - 7B6574F5BE82011621382001E602733A /* APIHelper.swift in Sources */, - 259DBF125A08D2CC6263AFD6914309A1 /* ApiResponse.swift in Sources */, - FF2151E98423EA965AA32B9BC80B5DC9 /* APIs.swift in Sources */, - 7A80FA0C32FA8BCCECCA86267952CB2A /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 872661BC16DCBAF99952C820ED6173C1 /* ArrayOfNumberOnly.swift in Sources */, - 1423DAD26BD241806D915F77200D86CA /* ArrayTest.swift in Sources */, - D6C5DAB5C879495F61515922F51D1AFA /* Cat.swift in Sources */, - 215B55F77DCF17AF5EE73A1FA39A348F /* Category.swift in Sources */, - A2CB4433D3F4970A687BA730779AF577 /* ClassModel.swift in Sources */, - F6FE65D070EAB1502F8CD7407F985251 /* Client.swift in Sources */, - 6D142A4259297C2C18AE1A239E1F8BD4 /* Dog.swift in Sources */, - 75FE7D9EF20002465C295A5919B17FC2 /* EnumArrays.swift in Sources */, - 6CF9F73E6F33FFEFA16AD2A2B0038268 /* EnumClass.swift in Sources */, - 0EAB00E2A951259911DB3D86AED93169 /* EnumTest.swift in Sources */, - 9A82B11744625507F3311B082A67D840 /* Extensions.swift in Sources */, - 526C6BD10D7792467A73505EB0F5234C /* Fake_classname_tags123API.swift in Sources */, - 87B80AADC7CA6556DF4560C015F03A48 /* FakeAPI.swift in Sources */, - 92CE3FFCB9DEC0A83CC7F8E542BFCEE3 /* FakeclassnametagsAPI.swift in Sources */, - 78962A6680E10E4D5D4E6AB3CB7436C5 /* FormatTest.swift in Sources */, - F3D336817F51F5281B557F40385371D0 /* HasOnlyReadOnly.swift in Sources */, - 8EBE12562F03B03ECED283954845976D /* List.swift in Sources */, - 92E8FE2F3FB67E0AF71B48BDC17BCC4C /* MapTest.swift in Sources */, - 0CF86BADF47E0DFB69F2D4AAE8CAA5ED /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 7F2C9B3201AE0B9BD925611F816B78D2 /* Model200Response.swift in Sources */, - 5185A19D002CC10E4948066B5D07F283 /* Models.swift in Sources */, - E13D5D981B849603B4766AE6CA742DEE /* Name.swift in Sources */, - FCAB896E0CBF6AE9387CFAC7BC6FB6B0 /* NumberOnly.swift in Sources */, - C184FE739831FDDCD3E7973BA870F774 /* Order.swift in Sources */, - 110288FCF6186BE86A317D67FFB45EA4 /* OuterEnum.swift in Sources */, - 0C000B886A8014E5D567C1D9D65DD74A /* Pet.swift in Sources */, - 54D158EDB36A7B92F7D90B56A40AC6A9 /* PetAPI.swift in Sources */, - 6479245096A6BCFF431559465E910769 /* PetstoreClient-dummy.m in Sources */, - CF2EE9BA90408C832F894412D9724944 /* ReadOnlyFirst.swift in Sources */, - 99FFDEFE82CEC70F6E1F1BF315145457 /* Return.swift in Sources */, - EED6858187428DC889DF482284501555 /* SpecialModelName.swift in Sources */, - 2EE505BF09DDA06E95B6466C42C4F713 /* StoreAPI.swift in Sources */, - 5DF731758112F165BD9A8A8278BCDA26 /* Tag.swift in Sources */, - 5532A389A0DDD00958CDACACD84AB89B /* User.swift in Sources */, - AFD0458924C288212D4EF81D4DF958C3 /* UserAPI.swift in Sources */, + 7105B2BD1B0604B931E000F16375A335 /* AdditionalPropertiesClass.swift in Sources */, + 4A61D9C5338D311C1F3ECAD10586E02E /* AlamofireImplementations.swift in Sources */, + 08C43F202E7FC3E8F2730CCB9FBD7998 /* Animal.swift in Sources */, + B477B88CCF55DFD09CCEEF6BD1FF3D2A /* AnimalFarm.swift in Sources */, + 9C1A054E67A88CC59D61E008F71E887E /* APIHelper.swift in Sources */, + 9998431EE4A288A2E6DF7BAB4A930DD8 /* ApiResponse.swift in Sources */, + CFEF569B1FF3C7619EA8A735E2720D75 /* APIs.swift in Sources */, + 39F639E647EE2C7BBBE1D600D5460A09 /* ArrayOfArrayOfNumberOnly.swift in Sources */, + CF2FA6B16F54FBF111D56D9D57A5C51A /* ArrayOfNumberOnly.swift in Sources */, + 7B6B385930B1AE86207EB383F0E9EE2B /* ArrayTest.swift in Sources */, + 40B3F80E1C272838FA43C7C60D600B13 /* Capitalization.swift in Sources */, + 91CD595D13E4C78B57CBDC20C0C13209 /* Cat.swift in Sources */, + 1627426CA13781AE27C0FC0C98F6A88D /* Category.swift in Sources */, + AF3CFFEF5A1F0B1D4D1055AA2CF0D1AB /* ClassModel.swift in Sources */, + CCF54C34B39F632B57B1979B0EE6E11D /* Client.swift in Sources */, + 250F58C891252EFD0C30E681503B370A /* Dog.swift in Sources */, + 218599F3A5EF5064545F1C63CD2014ED /* EnumArrays.swift in Sources */, + 3A93D7E1111888C47B0138AE97A5012A /* EnumClass.swift in Sources */, + 0BD2D76CD41573EC2B53977627E0D5BB /* EnumTest.swift in Sources */, + 97E6DEC487E46176D3BA79ECEF5204C5 /* Extensions.swift in Sources */, + 67FA28ADA5C61404EAEB8EE36F647FDC /* FakeAPI.swift in Sources */, + 5337DF6516B114157BDCD4F0957801D0 /* FakeclassnametagsAPI.swift in Sources */, + A8C7A08EC7E9FECA42EB7121E72B35E9 /* FormatTest.swift in Sources */, + D92051A8C9E0A9D7972301C931875DE7 /* HasOnlyReadOnly.swift in Sources */, + 682AD79495052A0A6050DA92FCA57A19 /* List.swift in Sources */, + C310B9190A08C4953C5165F339619A5B /* MapTest.swift in Sources */, + 9573F1161F43C18D877073A50900A80D /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 101544113D88337D6D76FC4B35796A04 /* Model200Response.swift in Sources */, + 7AE18812CE9232702AF58A4AB11A3D4A /* Models.swift in Sources */, + 8AE1AE495DB124BB4E2D7059474CE42B /* Name.swift in Sources */, + 14173079C167B121B3165D371B1025B0 /* NumberOnly.swift in Sources */, + 3E2E6328563E0FA71FE88D30BC1736D7 /* Order.swift in Sources */, + 7D554A5466BFF077A46F15FA5A3F3F6E /* OuterEnum.swift in Sources */, + 6450DC9EC00124441CAB9D8535690EB4 /* Pet.swift in Sources */, + F2CBCAA937A42298653726276FDC7318 /* PetAPI.swift in Sources */, + 349A70A41286448022F4219D4FDE0678 /* PetstoreClient-dummy.m in Sources */, + 860196CD1483F19757C7C30460CD7CA4 /* ReadOnlyFirst.swift in Sources */, + ADC74AA8A82AFCC5B67BC92D4F4DB4EB /* Return.swift in Sources */, + 743033B7F8964EC3AC0C727285876396 /* SpecialModelName.swift in Sources */, + DD556A602A0205DC3BDFD3D9D4D042AA /* StoreAPI.swift in Sources */, + 88D936AADB6658A0BC97E6CEC17499F7 /* Tag.swift in Sources */, + 934A78EEFA3B86BFFEEFE8D4A6112260 /* User.swift in Sources */, + 684364DEE25D2AF06EFE39858D990BF1 /* UserAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -748,147 +748,11 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 1AE0F2EEBA4375F577DD9F8C3B11F7B2 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 621A10F5C0A994B466277661C1B2C19F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 70622D4D4056B90B582AC7F92B46D2D2 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 72DE84F6EA4EE4A32348CCB7D5F4B968 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 82D3AD5A5FD240EEC1B1FEFF53FE2566 /* Release */ = { + 0AE21DC98CE46514764D58B99D2EF07E /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; @@ -918,15 +782,79 @@ }; name = Release; }; - 8C48CCCB862EC56A4174F6E1715688C9 /* Debug */ = { + 2E330FDE8D9D1759ABF2B17413641A14 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3881E269CDB75091FD35AE2BD08739AB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 4FF15CD2E3E7EE34B0314A62CFC36528 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -939,11 +867,44 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 5031D65C40F6E6417C6A44C5FBDF15BD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -951,13 +912,11 @@ }; name = Debug; }; - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */ = { + 5436E1B569734D2A2B26DF9A9F61E63B /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; @@ -987,7 +946,7 @@ }; name = Release; }; - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */ = { + 84FD87D359382A37B07149A12641B965 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -1005,47 +964,6 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B1B5EB0850F98CB5AECDB015B690777F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -1065,19 +983,84 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.2; ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; SYMROOT = "${SRCROOT}/../build"; }; name = Debug; }; - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */ = { + D160E7A504BD3CFDD475975ED3A658A0 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; + baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + F594C655D48020EC34B00AA63E001773 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FB412512A164FCE95718CEB6CB9C366F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; @@ -1086,20 +1069,17 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; + PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1113,8 +1093,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - B1B5EB0850F98CB5AECDB015B690777F /* Debug */, - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */, + 84FD87D359382A37B07149A12641B965 /* Debug */, + F594C655D48020EC34B00AA63E001773 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1122,8 +1102,8 @@ 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8C48CCCB862EC56A4174F6E1715688C9 /* Debug */, - 621A10F5C0A994B466277661C1B2C19F /* Release */, + FB412512A164FCE95718CEB6CB9C366F /* Debug */, + 4FF15CD2E3E7EE34B0314A62CFC36528 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1131,8 +1111,8 @@ 5C20281827228C999505802256DA894B /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 70622D4D4056B90B582AC7F92B46D2D2 /* Debug */, - 1AE0F2EEBA4375F577DD9F8C3B11F7B2 /* Release */, + 2E330FDE8D9D1759ABF2B17413641A14 /* Debug */, + D160E7A504BD3CFDD475975ED3A658A0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1140,8 +1120,8 @@ 5DE561894A3D2FE43769BF10CB87D407 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 72DE84F6EA4EE4A32348CCB7D5F4B968 /* Debug */, - 82D3AD5A5FD240EEC1B1FEFF53FE2566 /* Release */, + 3881E269CDB75091FD35AE2BD08739AB /* Debug */, + 0AE21DC98CE46514764D58B99D2EF07E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1149,8 +1129,8 @@ B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */, - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */, + 5031D65C40F6E6417C6A44C5FBDF15BD /* Debug */, + 5436E1B569734D2A2B26DF9A9F61E63B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 2bd0af42806..e4243744c6c 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -321,7 +321,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.encodeToJSON()?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 13f36567382..f2bd2f0c387 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -43,7 +43,7 @@ open class StoreAPI: APIBase { /** Delete purchase order by ID - - DELETE /store/order/{orderId} + - DELETE /store/order/{order_id} - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - parameter orderId: (path) ID of the order that needs to be deleted @@ -51,8 +51,8 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -150,7 +150,7 @@ open class StoreAPI: APIBase { /** Find purchase order by ID - - GET /store/order/{orderId} + - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= 123456789 @@ -188,8 +188,8 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 920e540c207..58e2f2b7b8b 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -327,7 +327,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.encodeToJSON()?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index ffbf34c9cd8..045661cc371 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -45,7 +45,7 @@ open class StoreAPI: APIBase { /** Delete purchase order by ID - - DELETE /store/order/{orderId} + - DELETE /store/order/{order_id} - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - parameter orderId: (path) ID of the order that needs to be deleted @@ -53,8 +53,8 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil @@ -156,7 +156,7 @@ open class StoreAPI: APIBase { /** Find purchase order by ID - - GET /store/order/{orderId} + - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/xml, example= 123456789 @@ -194,8 +194,8 @@ open class StoreAPI: APIBase { - returns: RequestBuilder */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)", options: .literal, range: nil) + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path let parameters: [String:Any]? = nil diff --git a/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index 6e000ccd383..f8752640d86 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -427,7 +427,7 @@ export enum PetApiApiKeys { } export class PetApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -454,6 +454,14 @@ export class PetApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: PetApiApiKeys, value: string) { this.authentications[PetApiApiKeys[key]].apiKey = value; } @@ -921,7 +929,7 @@ export enum StoreApiApiKeys { } export class StoreApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -948,6 +956,14 @@ export class StoreApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: StoreApiApiKeys, value: string) { this.authentications[StoreApiApiKeys[key]].apiKey = value; } @@ -1166,7 +1182,7 @@ export enum UserApiApiKeys { } export class UserApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -1193,6 +1209,14 @@ export class UserApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: UserApiApiKeys, value: string) { this.authentications[UserApiApiKeys[key]].apiKey = value; } diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index 6e000ccd383..f8752640d86 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -427,7 +427,7 @@ export enum PetApiApiKeys { } export class PetApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -454,6 +454,14 @@ export class PetApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: PetApiApiKeys, value: string) { this.authentications[PetApiApiKeys[key]].apiKey = value; } @@ -921,7 +929,7 @@ export enum StoreApiApiKeys { } export class StoreApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -948,6 +956,14 @@ export class StoreApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: StoreApiApiKeys, value: string) { this.authentications[StoreApiApiKeys[key]].apiKey = value; } @@ -1166,7 +1182,7 @@ export enum UserApiApiKeys { } export class UserApi { - protected basePath = defaultBasePath; + protected _basePath = defaultBasePath; protected defaultHeaders : any = {}; protected _useQuerystring : boolean = false; @@ -1193,6 +1209,14 @@ export class UserApi { this._useQuerystring = value; } + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + public setApiKey(key: UserApiApiKeys, value: string) { this.authentications[UserApiApiKeys[key]].apiKey = value; } diff --git a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml index ad9567e6fff..ed7fa3e189c 100644 --- a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml +++ b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml @@ -348,7 +348,7 @@ paths: description: "Invalid Order" x-contentType: "application/json" x-accepts: "application/json" - /store/order/{orderId}: + /store/order/{order_id}: get: tags: - "store" @@ -360,7 +360,7 @@ paths: - "application/xml" - "application/json" parameters: - - name: "orderId" + - name: "order_id" in: "path" description: "ID of pet that needs to be fetched" required: true @@ -390,7 +390,7 @@ paths: - "application/xml" - "application/json" parameters: - - name: "orderId" + - name: "order_id" in: "path" description: "ID of the order that needs to be deleted" required: true diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java index 6d6aa3848f7..097edd60859 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java @@ -32,7 +32,7 @@ public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); @DELETE - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) @@ -40,7 +40,7 @@ public class StoreApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) }) - public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId + public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId ) throws NotFoundException { return delegate.deleteOrder(orderId); @@ -59,7 +59,7 @@ public class StoreApi { return delegate.getInventory(); } @GET - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @@ -69,7 +69,7 @@ public class StoreApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId ) throws NotFoundException { return delegate.getOrderById(orderId); diff --git a/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore index c5fa491b4c5..70b88e71039 100644 --- a/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +**/impl/* \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index 8ddeb8f3dea..2698ca445e6 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -25,13 +25,13 @@ import javax.validation.Valid; public interface StoreApi { @DELETE - @Path("/store/order/{orderId}") + @Path("/store/order/{order_id}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete purchase order by ID", tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - public void deleteOrder(@PathParam("orderId") String orderId); + public void deleteOrder(@PathParam("order_id") String orderId); @GET @Path("/store/inventory") @@ -42,14 +42,14 @@ public interface StoreApi { public Map getInventory(); @GET - @Path("/store/order/{orderId}") + @Path("/store/order/{order_id}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); + public Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) Long orderId); @POST @Path("/store/order") diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java index 5f4f359b6d9..928ecf719c8 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java @@ -37,5 +37,6 @@ public enum EnumClass { } return null; } + } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java index 1a2f5bbac54..a95e0f4f052 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java @@ -37,5 +37,6 @@ public enum OuterEnum { } return null; } + } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java index 188fdb7b5cf..444c595b78e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java @@ -80,7 +80,7 @@ public class PetApiTest { @Test public void addPetTest() { Pet body = null; - //api.addPet(body); + //api.addPet(body); // TODO: test validations @@ -99,7 +99,7 @@ public class PetApiTest { public void deletePetTest() { Long petId = null; String apiKey = null; - //api.deletePet(petId, apiKey); + //api.deletePet(petId, apiKey); // TODO: test validations @@ -153,7 +153,7 @@ public class PetApiTest { @Test public void getPetByIdTest() { Long petId = null; - //Pet response = api.getPetById(petId); + //Pet response = api.getPetById(petId); //assertNotNull(response); // TODO: test validations @@ -171,7 +171,7 @@ public class PetApiTest { @Test public void updatePetTest() { Pet body = null; - //api.updatePet(body); + //api.updatePet(body); // TODO: test validations @@ -191,7 +191,7 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - //api.updatePetWithForm(petId, name, status); + //api.updatePetWithForm(petId, name, status); // TODO: test validations @@ -211,7 +211,7 @@ public class PetApiTest { Long petId = null; String additionalMetadata = null; org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java index aa476b0cf0f..c0cd10dca71 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java @@ -79,7 +79,7 @@ public class StoreApiTest { @Test public void deleteOrderTest() { String orderId = null; - //api.deleteOrder(orderId); + //api.deleteOrder(orderId); // TODO: test validations @@ -114,7 +114,7 @@ public class StoreApiTest { @Test public void getOrderByIdTest() { Long orderId = null; - //Order response = api.getOrderById(orderId); + //Order response = api.getOrderById(orderId); //assertNotNull(response); // TODO: test validations @@ -132,7 +132,7 @@ public class StoreApiTest { @Test public void placeOrderTest() { Order body = null; - //Order response = api.placeOrder(body); + //Order response = api.placeOrder(body); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java index 76bb7fa5578..2d1481bde34 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java @@ -79,7 +79,7 @@ public class UserApiTest { @Test public void createUserTest() { User body = null; - //api.createUser(body); + //api.createUser(body); // TODO: test validations @@ -97,7 +97,7 @@ public class UserApiTest { @Test public void createUsersWithArrayInputTest() { List body = null; - //api.createUsersWithArrayInput(body); + //api.createUsersWithArrayInput(body); // TODO: test validations @@ -115,7 +115,7 @@ public class UserApiTest { @Test public void createUsersWithListInputTest() { List body = null; - //api.createUsersWithListInput(body); + //api.createUsersWithListInput(body); // TODO: test validations @@ -133,7 +133,7 @@ public class UserApiTest { @Test public void deleteUserTest() { String username = null; - //api.deleteUser(username); + //api.deleteUser(username); // TODO: test validations @@ -151,7 +151,7 @@ public class UserApiTest { @Test public void getUserByNameTest() { String username = null; - //User response = api.getUserByName(username); + //User response = api.getUserByName(username); //assertNotNull(response); // TODO: test validations @@ -170,7 +170,7 @@ public class UserApiTest { public void loginUserTest() { String username = null; String password = null; - //String response = api.loginUser(username, password); + //String response = api.loginUser(username, password); //assertNotNull(response); // TODO: test validations @@ -187,7 +187,7 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - //api.logoutUser(); + //api.logoutUser(); // TODO: test validations @@ -206,7 +206,7 @@ public class UserApiTest { public void updateUserTest() { String username = null; User body = null; - //api.updateUser(username, body); + //api.updateUser(username, body); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java index 153fd729be4..3d0a9532b51 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java @@ -21,14 +21,14 @@ import javax.validation.constraints.*; public class StoreApi { @DELETE - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), @ApiResponse(code = 404, message = "Order not found", response = void.class) }) - public Response deleteOrder(@PathParam("orderId") @ApiParam("ID of the order that needs to be deleted") String orderId) { + public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) { return Response.ok().entity("magic!").build(); } @@ -46,7 +46,7 @@ public class StoreApi { } @GET - @Path("/order/{orderId}") + @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @@ -54,7 +54,7 @@ public class StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) - public Response getOrderById(@PathParam("orderId") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) { + public Response getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index bad99f0581c..469711d6f5b 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -362,7 +362,7 @@ } } }, - "/store/order/{orderId}" : { + "/store/order/{order_id}" : { "get" : { "tags" : [ "store" ], "summary" : "Find purchase order by ID", @@ -370,7 +370,7 @@ "operationId" : "getOrderById", "produces" : [ "application/xml", "application/json" ], "parameters" : [ { - "name" : "orderId", + "name" : "order_id", "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, @@ -401,7 +401,7 @@ "operationId" : "deleteOrder", "produces" : [ "application/xml", "application/json" ], "parameters" : [ { - "name" : "orderId", + "name" : "order_id", "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, diff --git a/samples/server/petstore/lumen/lib/app/Http/routes.php b/samples/server/petstore/lumen/lib/app/Http/routes.php index b5ce5e4666c..304fd56d989 100644 --- a/samples/server/petstore/lumen/lib/app/Http/routes.php +++ b/samples/server/petstore/lumen/lib/app/Http/routes.php @@ -125,14 +125,14 @@ $app->POST('/v2/store/order', 'StoreApi@placeOrder'); * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * Output-Formats: [application/xml, application/json] */ -$app->DELETE('/v2/store/order/{orderId}', 'StoreApi@deleteOrder'); +$app->DELETE('/v2/store/order/{order_id}', 'StoreApi@deleteOrder'); /** * GET getOrderById * Summary: Find purchase order by ID * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * Output-Formats: [application/xml, application/json] */ -$app->GET('/v2/store/order/{orderId}', 'StoreApi@getOrderById'); +$app->GET('/v2/store/order/{order_id}', 'StoreApi@getOrderById'); /** * POST createUser * Summary: Create user diff --git a/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml b/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml index ced8e85705b..a2b8cd0f5cc 100644 --- a/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml +++ b/samples/server/petstore/nodejs-google-cloud-functions/api/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: diff --git a/samples/server/petstore/nodejs/api/swagger.yaml b/samples/server/petstore/nodejs/api/swagger.yaml index ced8e85705b..a2b8cd0f5cc 100644 --- a/samples/server/petstore/nodejs/api/swagger.yaml +++ b/samples/server/petstore/nodejs/api/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java index 227c85b9e55..a7cb2a4cc0e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java @@ -26,10 +26,10 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -56,10 +56,10 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + default ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java index 07ed22b7314..6a3afe25cbe 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java @@ -29,7 +29,7 @@ public class StoreApiController implements StoreApi { } - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return delegate.deleteOrder(orderId); } @@ -39,7 +39,7 @@ public class StoreApiController implements StoreApi { return delegate.getInventory(); } - public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return delegate.getOrderById(orderId); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java index 7a756ae42b0..361b1d5dbe6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java @@ -25,10 +25,10 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -49,10 +49,10 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java index 07ed22b7314..6a3afe25cbe 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java @@ -29,7 +29,7 @@ public class StoreApiController implements StoreApi { } - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return delegate.deleteOrder(orderId); } @@ -39,7 +39,7 @@ public class StoreApiController implements StoreApi { return delegate.getInventory(); } - public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return delegate.getOrderById(orderId); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java index b63234b59a4..ec189068d63 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java @@ -27,10 +27,10 @@ public interface StoreApi { @ApiImplicitParams({ }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -55,10 +55,10 @@ public interface StoreApi { @ApiImplicitParams({ }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java index 97a1b7e5129..f5446d8d0d1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java @@ -24,7 +24,7 @@ public class StoreApiController implements StoreApi { - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -34,7 +34,7 @@ public class StoreApiController implements StoreApi { return new ResponseEntity>(HttpStatus.OK); } - public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java index 7a756ae42b0..361b1d5dbe6 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java @@ -25,10 +25,10 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -49,10 +49,10 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java index 97a1b7e5129..f5446d8d0d1 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java @@ -24,7 +24,7 @@ public class StoreApiController implements StoreApi { - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -34,7 +34,7 @@ public class StoreApiController implements StoreApi { return new ResponseEntity>(HttpStatus.OK); } - public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); }