syntax, String definition) {
+ this.syntax = syntax;
+ this.definition = definition;
+ }
+
+ public abstract Boolean matches(String relativePath);
+
+ public String getDefinition() {
+ return this.definition;
+ }
+
+ protected String getPattern() {
+ if(syntax == null) return this.definition;
+
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < syntax.size(); i++) {
+ Part current = syntax.get(i);
+
+ switch(current.getToken()){
+ case MATCH_ALL:
+ case MATCH_ANY:
+ case ESCAPED_EXCLAMATION:
+ case ESCAPED_SPACE:
+ case PATH_DELIM:
+ case TEXT:
+ case DIRECTORY_MARKER:
+ sb.append(current.getValue());
+ break;
+ case NEGATE:
+ case ROOTED_MARKER:
+ case COMMENT:
+ break;
+ }
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Whether or not the rule should be negated. !foo means foo should be removed from previous matches.
+ * Example: **\/*.bak excludes all backup. Adding !/test.bak will include test.bak in the project root.
+ *
+ * NOTE: It is not possible to re-include a file if a parent directory of that file is excluded.
+ */
+ public Boolean getNegated() {
+ return this.syntax != null && this.syntax.size() > 0 && this.syntax.get(0).getToken() == IgnoreLineParser.Token.NEGATE;
+ }
+
+ public Operation evaluate(String relativePath) {
+ if (Boolean.TRUE.equals(matches(relativePath))) {
+ if(Boolean.TRUE.equals(this.getNegated())) {
+ return this.getIncludeOperation();
+ }
+ return this.getExcludeOperation();
+ }
+ return Operation.NOOP;
+ }
+
+ protected Operation getIncludeOperation(){ return Operation.INCLUDE; }
+ protected Operation getExcludeOperation(){ return Operation.EXCLUDE; }
+
+ public static Rule create(String definition) {
+ // NOTE: Comments that start with a : (e.g. //:) are pulled from git documentation for .gitignore
+ // see: https://github.com/git/git/blob/90f7b16b3adc78d4bbabbd426fb69aa78c714f71/Documentation/gitignore.txt
+ Rule rule = null;
+ if (definition.equals(".")) {
+ return new InvalidRule(null, definition, "Pattern '.' is invalid.");
+ } else if (definition.equals("!.")) {
+ return new InvalidRule(null, definition, "Pattern '!.' is invalid.");
+ } else if (definition.startsWith("..")) {
+ return new InvalidRule(null, definition, "Pattern '..' is invalid.");
+ }
+
+ try {
+ List result = IgnoreLineParser.parse(definition);
+
+ Boolean directoryOnly = null;
+ if (result.size() == 0) {
+ return rule;
+ } else if (result.size() == 1) {
+ // single-character filename only
+ Part part = result.get(0);
+ if (IgnoreLineParser.Token.MATCH_ANY.equals(part.getToken())) {
+ rule = new RootedFileRule(result, definition);
+ } else {
+ rule = new FileRule(result, definition);
+ }
+ } else {
+ IgnoreLineParser.Token head = result.get(0).getToken();
+
+ //: An optional prefix "`!`" which negates the pattern; any
+ //: matching file excluded by a previous pattern will become
+ //: included again. It is not possible to re-include a file if a parent
+ //: directory of that file is excluded. Git doesn't list excluded
+ //: directories for performance reasons, so any patterns on contained
+ //: files have no effect, no matter where they are defined.
+ //: Put a backslash ("`\`") in front of the first "`!`" for patterns
+ //: that begin with a literal "`!`", for example, "`\!important!.txt`".
+ // see this.getNegated();
+
+ //: If the pattern ends with a slash, it is removed for the
+ //: purpose of the following description, but it would only find
+ //: a match with a directory. In other words, `foo/` will match a
+ //: directory `foo` and paths underneath it, but will not match a
+ //: regular file or a symbolic link `foo` (this is consistent
+ //: with the way how pathspec works in general in Git).
+ directoryOnly = IgnoreLineParser.Token.DIRECTORY_MARKER.equals(result.get(result.size() - 1).getToken());
+
+ if (directoryOnly) {
+ rule = new DirectoryRule(result, definition);
+ } else if (IgnoreLineParser.Token.PATH_DELIM.equals(head)) {
+ //: A leading slash matches the beginning of the pathname.
+ //: For example, "/{asterisk}.c" matches "cat-file.c" but not
+ //: "mozilla-sha1/sha1.c".
+ rule = new RootedFileRule(result, definition);
+ } else {
+ // case 1
+ //: If the pattern does not contain a slash '/', Git treats it as
+ //: a shell glob pattern and checks for a match against the
+ //: pathname relative to the location of the `.gitignore` file
+ //: (relative to the toplevel of the work tree if not from a
+ //: `.gitignore` file).
+
+ // case 2
+ //: Otherwise, Git treats the pattern as a shell glob suitable
+ //: for consumption by fnmatch(3) with the FNM_PATHNAME flag:
+ //: wildcards in the pattern will not match a / in the pathname.
+ //: For example, "Documentation/{asterisk}.html" matches
+ //: "Documentation/git.html" but not "Documentation/ppc/ppc.html"
+ //: or "tools/perf/Documentation/perf.html".
+
+
+ // case 3
+ //: Two consecutive asterisks ("`**`") in patterns matched against
+ //: full pathname may have special meaning:
+ //:
+ //: - A leading "`**`" followed by a slash means match in all
+ //: directories. For example, "`**/foo`" matches file or directory
+ //: "`foo`" anywhere, the same as pattern "`foo`". "`**/foo/bar`"
+ //: matches file or directory "`bar`" anywhere that is directly
+ //: under directory "`foo`".
+ //:
+ //: - A trailing "`/**`" matches everything inside. For example,
+ //: "`abc/**`" matches all files inside directory "`abc`", relative
+ //: to the location of the `.gitignore` file, with infinite depth.
+ //:
+ //: - A slash followed by two consecutive asterisks then a slash
+ //: matches zero or more directories. For example, "`a/**/b`"
+ //: matches "`a/b`", "`a/x/b`", "`a/x/y/b`" and so on.
+ //:
+ //: - Other consecutive asterisks are considered invalid.
+ rule = new FileRule(result, definition);
+ }
+
+ }
+ } catch (ParserException e) {
+ e.printStackTrace();
+ return new InvalidRule(null, definition, e.getMessage());
+ }
+
+ return rule;
+ }
+}
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractTypeScriptClientCodegen.java
index 9e30ae657c8..cc41f3ea297 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractTypeScriptClientCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractTypeScriptClientCodegen.java
@@ -1,62 +1,73 @@
package io.swagger.codegen.languages;
-import io.swagger.codegen.*;
-import io.swagger.models.properties.*;
+import org.apache.commons.lang3.StringUtils;
-import java.util.*;
import java.io.File;
-
-import org.apache.commons.lang3.StringUtils;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import io.swagger.codegen.CliOption;
+import io.swagger.codegen.CodegenConfig;
+import io.swagger.codegen.CodegenConstants;
+import io.swagger.codegen.CodegenProperty;
+import io.swagger.codegen.CodegenType;
+import io.swagger.codegen.DefaultCodegen;
+import io.swagger.models.properties.ArrayProperty;
+import io.swagger.models.properties.FileProperty;
+import io.swagger.models.properties.MapProperty;
+import io.swagger.models.properties.Property;
public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen implements CodegenConfig {
protected String modelPropertyNaming= "camelCase";
protected Boolean supportsES6 = true;
- public AbstractTypeScriptClientCodegen() {
- super();
- supportsInheritance = true;
- setReservedWordsLowerCase(Arrays.asList(
- // local variable names used in API methods (endpoints)
- "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred",
- "requestOptions",
- // Typescript reserved words
- "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));
-
- languageSpecificPrimitives = new HashSet(Arrays.asList(
- "string",
- "String",
- "boolean",
- "Boolean",
- "Double",
- "Integer",
- "Long",
- "Float",
- "Object",
+ public AbstractTypeScriptClientCodegen() {
+ super();
+ supportsInheritance = true;
+ setReservedWordsLowerCase(Arrays.asList(
+ // local variable names used in API methods (endpoints)
+ "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred",
+ "requestOptions",
+ // Typescript reserved words
+ "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));
+
+ languageSpecificPrimitives = new HashSet(Arrays.asList(
+ "string",
+ "String",
+ "boolean",
+ "Boolean",
+ "Double",
+ "Integer",
+ "Long",
+ "Float",
+ "Object",
"Array",
"Date",
"number",
"any"
- ));
- instantiationTypes.put("array", "Array");
-
- typeMapping = new HashMap();
- typeMapping.put("Array", "Array");
- typeMapping.put("array", "Array");
- typeMapping.put("List", "Array");
- typeMapping.put("boolean", "boolean");
- typeMapping.put("string", "string");
- typeMapping.put("int", "number");
- typeMapping.put("float", "number");
- typeMapping.put("number", "number");
- typeMapping.put("long", "number");
- typeMapping.put("short", "number");
- typeMapping.put("char", "string");
- typeMapping.put("double", "number");
- typeMapping.put("object", "any");
- typeMapping.put("integer", "number");
- typeMapping.put("Map", "any");
- typeMapping.put("DateTime", "Date");
+ ));
+ instantiationTypes.put("array", "Array");
+
+ typeMapping = new HashMap();
+ typeMapping.put("Array", "Array");
+ typeMapping.put("array", "Array");
+ typeMapping.put("List", "Array");
+ typeMapping.put("boolean", "boolean");
+ typeMapping.put("string", "string");
+ typeMapping.put("int", "number");
+ typeMapping.put("float", "number");
+ typeMapping.put("number", "number");
+ typeMapping.put("long", "number");
+ typeMapping.put("short", "number");
+ typeMapping.put("char", "string");
+ typeMapping.put("double", "number");
+ typeMapping.put("object", "any");
+ typeMapping.put("integer", "number");
+ typeMapping.put("Map", "any");
+ typeMapping.put("DateTime", "Date");
//TODO binary should be mapped to byte array
// mapped to String as a workaround
typeMapping.put("binary", "string");
@@ -66,7 +77,7 @@ public AbstractTypeScriptClientCodegen() {
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue("false"));
- }
+ }
@Override
public void processOpts() {
@@ -104,24 +115,24 @@ public String modelFileFolder() {
}
@Override
- public String toParamName(String name) {
- // replace - with _ e.g. created-at => created_at
- name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
+ public String toParamName(String name) {
+ // replace - with _ e.g. created-at => created_at
+ name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
- // if it's all uppper case, do nothing
- if (name.matches("^[A-Z_]*$"))
- return name;
+ // if it's all uppper case, do nothing
+ if (name.matches("^[A-Z_]*$"))
+ return name;
- // camelize the variable name
- // pet_id => petId
- name = camelize(name, true);
+ // camelize the variable name
+ // pet_id => petId
+ name = camelize(name, true);
- // for reserved word or word starting with number, append _
- if (isReservedWord(name) || name.matches("^\\d.*"))
- name = escapeReservedWord(name);
+ // for reserved word or word starting with number, append _
+ if (isReservedWord(name) || name.matches("^\\d.*"))
+ name = escapeReservedWord(name);
- return name;
- }
+ return name;
+ }
@Override
public String toVarName(String name) {
@@ -130,70 +141,70 @@ public String toVarName(String name) {
}
@Override
- public String toModelName(String name) {
- name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
-
- if (!StringUtils.isEmpty(modelNamePrefix)) {
- name = modelNamePrefix + "_" + name;
- }
-
- if (!StringUtils.isEmpty(modelNameSuffix)) {
- name = name + "_" + modelNameSuffix;
+ public String toModelName(String name) {
+ name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
+
+ if (!StringUtils.isEmpty(modelNamePrefix)) {
+ name = modelNamePrefix + "_" + name;
+ }
+
+ if (!StringUtils.isEmpty(modelNameSuffix)) {
+ name = name + "_" + modelNameSuffix;
+ }
+
+ // model name cannot use reserved keyword, e.g. return
+ if (isReservedWord(name)) {
+ String modelName = camelize("model_" + name);
+ LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName);
+ return modelName;
+ }
+
+ // model name starts with number
+ if (name.matches("^\\d.*")) {
+ String modelName = camelize("model_" + name); // e.g. 200Response => Model200Response (after camelize)
+ LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName);
+ return modelName;
+ }
+
+ // camelize the model name
+ // phone_number => PhoneNumber
+ return camelize(name);
}
- // model name cannot use reserved keyword, e.g. return
- if (isReservedWord(name)) {
- String modelName = camelize("model_" + name);
- LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName);
- return modelName;
- }
+ @Override
+ public String toModelFilename(String name) {
+ // should be the same as the model name
+ return toModelName(name);
+ }
- // model name starts with number
- if (name.matches("^\\d.*")) {
- String modelName = camelize("model_" + name); // e.g. 200Response => Model200Response (after camelize)
- LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName);
- return modelName;
+ @Override
+ public String getTypeDeclaration(Property p) {
+ if (p instanceof ArrayProperty) {
+ ArrayProperty ap = (ArrayProperty) p;
+ Property inner = ap.getItems();
+ return getSwaggerType(p) + "<" + getTypeDeclaration(inner) + ">";
+ } else if (p instanceof MapProperty) {
+ MapProperty mp = (MapProperty) p;
+ Property inner = mp.getAdditionalProperties();
+ return "{ [key: string]: "+ getTypeDeclaration(inner) + "; }";
+ } else if (p instanceof FileProperty) {
+ return "any";
}
+ return super.getTypeDeclaration(p);
+ }
- // camelize the model name
- // phone_number => PhoneNumber
- return camelize(name);
- }
-
- @Override
- public String toModelFilename(String name) {
- // should be the same as the model name
- return toModelName(name);
- }
-
- @Override
- public String getTypeDeclaration(Property p) {
- if (p instanceof ArrayProperty) {
- ArrayProperty ap = (ArrayProperty) p;
- Property inner = ap.getItems();
- return getSwaggerType(p) + "<" + getTypeDeclaration(inner) + ">";
- } else if (p instanceof MapProperty) {
- MapProperty mp = (MapProperty) p;
- Property inner = mp.getAdditionalProperties();
- return "{ [key: string]: "+ getTypeDeclaration(inner) + "; }";
- } else if (p instanceof FileProperty) {
- return "any";
- }
- return super.getTypeDeclaration(p);
- }
-
- @Override
- public String getSwaggerType(Property p) {
- String swaggerType = super.getSwaggerType(p);
- String type = null;
- if (typeMapping.containsKey(swaggerType)) {
- type = typeMapping.get(swaggerType);
- if (languageSpecificPrimitives.contains(type))
- return type;
- } else
- type = swaggerType;
- return toModelName(type);
- }
+ @Override
+ public String getSwaggerType(Property p) {
+ String swaggerType = super.getSwaggerType(p);
+ String type = null;
+ if (typeMapping.containsKey(swaggerType)) {
+ type = typeMapping.get(swaggerType);
+ if (languageSpecificPrimitives.contains(type))
+ return type;
+ } else
+ type = swaggerType;
+ return toModelName(type);
+ }
@Override
public String toOperationId(String operationId) {
@@ -217,8 +228,8 @@ public void setModelPropertyNaming(String naming) {
this.modelPropertyNaming = naming;
} else {
throw new IllegalArgumentException("Invalid model property naming '" +
- naming + "'. Must be 'original', 'camelCase', " +
- "'PascalCase' or 'snake_case'");
+ naming + "'. Must be 'original', 'camelCase', " +
+ "'PascalCase' or 'snake_case'");
}
}
@@ -232,9 +243,9 @@ public String getNameUsingModelPropertyNaming(String name) {
case camelCase: return camelize(name, true);
case PascalCase: return camelize(name);
case snake_case: return underscore(name);
- default: throw new IllegalArgumentException("Invalid model property naming '" +
- name + "'. Must be 'original', 'camelCase', " +
- "'PascalCase' or 'snake_case'");
+ default: throw new IllegalArgumentException("Invalid model property naming '" +
+ name + "'. Must be 'original', 'camelCase', " +
+ "'PascalCase' or 'snake_case'");
}
}
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java
index 58b59f71364..d11cc6ce0a3 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java
@@ -33,6 +33,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
// requestPackage and authPackage are used by the "volley" template/library
protected String requestPackage = "io.swagger.client.request";
protected String authPackage = "io.swagger.client.auth";
+ protected String gradleWrapperPackage = "gradle.wrapper";
protected String apiDocPath = "docs/";
protected String modelDocPath = "docs/";
@@ -418,6 +419,15 @@ private void addSupportingFilesForHttpClient() {
(sourceFolder + File.separator + invokerPackage).replace(".", File.separator), "Pair.java"));
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
+
+ // gradle wrapper files
+ supportingFiles.add(new SupportingFile( "gradlew.mustache", "", "gradlew" ));
+ supportingFiles.add(new SupportingFile( "gradlew.bat.mustache", "", "gradlew.bat" ));
+ supportingFiles.add(new SupportingFile( "gradle-wrapper.properties.mustache",
+ gradleWrapperPackage.replace(".", File.separator), "gradle-wrapper.properties" ));
+ supportingFiles.add(new SupportingFile( "gradle-wrapper.jar",
+ gradleWrapperPackage.replace(".", File.separator), "gradle-wrapper.jar" ));
+
}
private void addSupportingFilesForVolley() {
@@ -456,6 +466,14 @@ private void addSupportingFilesForVolley() {
(sourceFolder + File.separator + authPackage).replace(".", File.separator), "HttpBasicAuth.java"));
supportingFiles.add(new SupportingFile("auth/authentication.mustache",
(sourceFolder + File.separator + authPackage).replace(".", File.separator), "Authentication.java"));
+
+ // gradle wrapper files
+ supportingFiles.add(new SupportingFile( "gradlew.mustache", "", "gradlew" ));
+ supportingFiles.add(new SupportingFile( "gradlew.bat.mustache", "", "gradlew.bat" ));
+ supportingFiles.add(new SupportingFile( "gradle-wrapper.properties.mustache",
+ gradleWrapperPackage.replace(".", File.separator), "gradle-wrapper.properties" ));
+ supportingFiles.add(new SupportingFile( "gradle-wrapper.jar",
+ gradleWrapperPackage.replace(".", File.separator), "gradle-wrapper.jar" ));
}
public Boolean getUseAndroidMavenGradlePlugin() {
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java
index 4e34424eab7..f1c3db7c430 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java
@@ -146,6 +146,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go"));
supportingFiles.add(new SupportingFile("api_client.mustache", "", "api_client.go"));
supportingFiles.add(new SupportingFile("api_response.mustache", "", "api_response.go"));
+ supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml"));
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
}
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 7feae0f5b9f..1fba93891a4 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
@@ -39,6 +39,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
protected String projectTestFolder = "src" + File.separator + "test";
protected String sourceFolder = projectFolder + File.separator + "java";
protected String testFolder = projectTestFolder + File.separator + "java";
+ protected String gradleWrapperPackage = "gradle.wrapper";
protected String localVariablePrefix = "";
protected boolean fullJavaUtil;
protected String javaUtilPrefix = "";
@@ -266,6 +267,14 @@ public void processOpts() {
final String authFolder = (sourceFolder + '/' + invokerPackage + ".auth").replace(".", "/");
if ("feign".equals(getLibrary())) {
supportingFiles.add(new SupportingFile("FormAwareEncoder.mustache", invokerFolder, "FormAwareEncoder.java"));
+
+ //gradleWrapper files
+ supportingFiles.add( new SupportingFile( "gradlew.mustache", "", "gradlew") );
+ supportingFiles.add( new SupportingFile( "gradlew.bat.mustache", "", "gradlew.bat") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.properties.mustache",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.properties") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.jar",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.jar") );
}
supportingFiles.add(new SupportingFile("auth/HttpBasicAuth.mustache", authFolder, "HttpBasicAuth.java"));
supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));
@@ -284,6 +293,14 @@ public void processOpts() {
// generate markdown docs
modelDocTemplateFiles.put("model_doc.mustache", ".md");
apiDocTemplateFiles.put("api_doc.mustache", ".md");
+
+ //gradleWrapper files
+ supportingFiles.add( new SupportingFile( "gradlew.mustache", "", "gradlew") );
+ supportingFiles.add( new SupportingFile( "gradlew.bat.mustache", "", "gradlew.bat") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.properties.mustache",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.properties") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.jar",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.jar") );
} else if ("okhttp-gson".equals(getLibrary())) {
// generate markdown docs
modelDocTemplateFiles.put("model_doc.mustache", ".md");
@@ -296,14 +313,38 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("ProgressResponseBody.mustache", invokerFolder, "ProgressResponseBody.java"));
// "build.sbt" is for development with SBT
supportingFiles.add(new SupportingFile("build.sbt.mustache", "", "build.sbt"));
+
+ //gradleWrapper files
+ supportingFiles.add( new SupportingFile( "gradlew.mustache", "", "gradlew") );
+ supportingFiles.add( new SupportingFile( "gradlew.bat.mustache", "", "gradlew.bat") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.properties.mustache",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.properties") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.jar",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.jar") );
} else if (usesAnyRetrofitLibrary()) {
supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java"));
supportingFiles.add(new SupportingFile("CollectionFormats.mustache", invokerFolder, "CollectionFormats.java"));
+
+ //gradleWrapper files
+ supportingFiles.add( new SupportingFile( "gradlew.mustache", "", "gradlew") );
+ supportingFiles.add( new SupportingFile( "gradlew.bat.mustache", "", "gradlew.bat") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.properties.mustache",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.properties") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.jar",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.jar") );
} else if("jersey2".equals(getLibrary())) {
// generate markdown docs
modelDocTemplateFiles.put("model_doc.mustache", ".md");
apiDocTemplateFiles.put("api_doc.mustache", ".md");
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
+
+ //gradleWrapper files
+ supportingFiles.add( new SupportingFile( "gradlew.mustache", "", "gradlew") );
+ supportingFiles.add( new SupportingFile( "gradlew.bat.mustache", "", "gradlew.bat") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.properties.mustache",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.properties") );
+ supportingFiles.add( new SupportingFile( "gradle-wrapper.jar",
+ gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.jar") );
}
if(additionalProperties.containsKey(DATE_LIBRARY)) {
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java
index 579ae56635e..1a9d0a80c24 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java
@@ -307,12 +307,12 @@ public String getTypeDeclaration(Property p) {
if(innerTypeDeclaration.equalsIgnoreCase(BinaryDataType)) {
return "NSData*";
}
- // In this codition, type of property p is array of primitive,
+ // In this condition, type of property p is array of primitive,
// return container type with pointer, e.g. `NSArray**'
if (languageSpecificPrimitives.contains(innerTypeDeclaration)) {
return getSwaggerType(p) + "<" + innerTypeDeclaration + "*>*";
}
- // In this codition, type of property p is array of model,
+ // In this condition, type of property p is array of model,
// return container type combine inner type with pointer, e.g. `NSArray*'
else {
for (String sd : advancedMapingTypes) {
@@ -344,18 +344,18 @@ public String getTypeDeclaration(Property p) {
} else {
String swaggerType = getSwaggerType(p);
- // In this codition, type of p is objective-c primitive type, e.g. `NSSNumber',
+ // In this condition, type of p is objective-c primitive type, e.g. `NSSNumber',
// return type of p with pointer, e.g. `NSNumber*'
if (languageSpecificPrimitives.contains(swaggerType) &&
foundationClasses.contains(swaggerType)) {
return swaggerType + "*";
}
- // In this codition, type of p is c primitive type, e.g. `bool',
+ // In this condition, type of p is c primitive type, e.g. `bool',
// return type of p, e.g. `bool'
else if (languageSpecificPrimitives.contains(swaggerType)) {
return swaggerType;
}
- // In this codition, type of p is objective-c object type, e.g. `SWGPet',
+ // In this condition, type of p is objective-c object type, e.g. `SWGPet',
// return type of p with pointer, e.g. `SWGPet*'
else {
return swaggerType + "*";
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java
index 6655a28f1d5..0db5598f7f0 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java
@@ -5,6 +5,7 @@
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenParameter;
+import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.DefaultCodegen;
import io.swagger.codegen.SupportingFile;
@@ -224,6 +225,9 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
+ supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
+
+ // test files should not be overwritten
writeOptional(outputFolder, new SupportingFile("rspec.mustache", "", ".rspec"));
writeOptional(outputFolder, new SupportingFile("spec_helper.mustache", specFolder, "spec_helper.rb"));
writeOptional(outputFolder, new SupportingFile("configuration_spec.mustache", specFolder, "configuration_spec.rb"));
@@ -527,6 +531,57 @@ public String toApiName(String name) {
return camelize(name) + "Api";
}
+ @Override
+ public String toEnumValue(String value, String datatype) {
+ if ("Integer".equals(datatype) || "Float".equals(datatype)) {
+ return value;
+ } else {
+ return "\"" + escapeText(value) + "\"";
+ }
+ }
+
+ @Override
+ public String toEnumVarName(String name, String datatype) {
+ // number
+ if ("Integer".equals(datatype) || "Float".equals(datatype)) {
+ String varName = new String(name);
+ varName = varName.replaceAll("-", "MINUS_");
+ varName = varName.replaceAll("\\+", "PLUS_");
+ varName = varName.replaceAll("\\.", "_DOT_");
+ return varName;
+ }
+
+ // string
+ String enumName = sanitizeName(underscore(name).toUpperCase());
+ enumName = enumName.replaceFirst("^_", "");
+ enumName = enumName.replaceFirst("_$", "");
+
+ if (enumName.matches("\\d.*")) { // starts with number
+ return "N" + enumName;
+ } else {
+ return enumName;
+ }
+ }
+
+ @Override
+ public String toEnumName(CodegenProperty property) {
+ String enumName = underscore(toModelName(property.name)).toUpperCase();
+ enumName = enumName.replaceFirst("^_", "");
+ enumName = enumName.replaceFirst("_$", "");
+
+ if (enumName.matches("\\d.*")) { // starts with number
+ return "N" + enumName;
+ } else {
+ return enumName;
+ }
+ }
+
+ @Override
+ public Map postProcessModels(Map objs) {
+ // process enum in models
+ return postProcessModelsEnum(objs);
+ }
+
@Override
public String toOperationId(String operationId) {
// rename to empty_method_name_1 (e.g.) if method name is empty
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java
index 9d6d891df70..6ec81c1c357 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java
@@ -342,7 +342,7 @@ public CodegenProperty fromProperty(String name, Property p) {
// Ensure that the enum type doesn't match a reserved word or
// the variable name doesn't match the generated enum type or the
// Swift compiler will generate an error
- if (isReservedWord(codegenProperty.datatypeWithEnum) || name.equals(codegenProperty.datatypeWithEnum)) {
+ if (isReservedWord(codegenProperty.datatypeWithEnum) || toVarName(name).equals(codegenProperty.datatypeWithEnum)) {
codegenProperty.datatypeWithEnum = codegenProperty.datatypeWithEnum + "Enum";
}
}
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java
index a80e0f66ae0..6a945249af6 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java
@@ -5,12 +5,15 @@
import java.util.Date;
import io.swagger.codegen.CliOption;
+import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.SupportingFile;
+import io.swagger.models.ModelImpl;
import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.BooleanProperty;
import io.swagger.models.properties.FileProperty;
import io.swagger.models.properties.MapProperty;
+import io.swagger.models.properties.ObjectProperty;
import io.swagger.models.properties.Property;
public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCodegen {
@@ -43,6 +46,12 @@ public TypeScriptAngular2ClientCodegen() {
this.cliOptions.add(new CliOption(SNAPSHOT, "When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString()));
}
+ @Override
+ protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, ModelImpl swaggerModel) {
+ codegenModel.additionalPropertiesType = getSwaggerType(swaggerModel.getAdditionalProperties());
+ addImport(codegenModel, codegenModel.additionalPropertiesType);
+ }
+
@Override
public String getName() {
return "typescript-angular2";
@@ -106,14 +115,19 @@ public String getTypeDeclaration(Property p) {
MapProperty mp = (MapProperty)p;
inner = mp.getAdditionalProperties();
return "{ [key: string]: " + this.getTypeDeclaration(inner) + "; }";
+ } else if(p instanceof FileProperty || p instanceof ObjectProperty) {
+ return "any";
} else {
- return p instanceof FileProperty ? "any" : super.getTypeDeclaration(p);
+ return super.getTypeDeclaration(p);
}
}
@Override
public String getSwaggerType(Property p) {
String swaggerType = super.getSwaggerType(p);
+ if(languageSpecificPrimitives.contains(swaggerType)) {
+ return swaggerType;
+ }
return addModelPrefix(swaggerType);
}
@@ -121,13 +135,25 @@ private String addModelPrefix(String swaggerType) {
String type = null;
if (typeMapping.containsKey(swaggerType)) {
type = typeMapping.get(swaggerType);
- if (languageSpecificPrimitives.contains(type))
- return type;
- } else
+ } else {
+ type = swaggerType;
+ }
+
+ if (!startsWithLanguageSpecificPrimitiv(type)) {
type = "models." + swaggerType;
+ }
return type;
}
+ private boolean startsWithLanguageSpecificPrimitiv(String type) {
+ for (String langPrimitive:languageSpecificPrimitives) {
+ if (type.startsWith(langPrimitive)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
public void postProcessParameter(CodegenParameter parameter) {
super.postProcessParameter(parameter);
diff --git a/modules/swagger-codegen/src/main/resources/Java/api.mustache b/modules/swagger-codegen/src/main/resources/Java/api.mustache
index ad7b9051f05..4d54d84d337 100644
--- a/modules/swagger-codegen/src/main/resources/Java/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/Java/api.mustache
@@ -78,12 +78,12 @@ public class {{classname}} {
{{/formParams}}
final String[] {{localVariablePrefix}}localVarAccepts = {
- {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
+ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
};
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
final String[] {{localVariablePrefix}}localVarContentTypes = {
- {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
+ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
};
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
diff --git a/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache
index 93c5bc5b13a..bbb5b66f840 100644
--- a/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/Java/api_doc.mustache
@@ -75,8 +75,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
{{/operation}}
{{/operations}}
diff --git a/modules/swagger-codegen/src/main/resources/Java/gitignore.mustache b/modules/swagger-codegen/src/main/resources/Java/gitignore.mustache
index 32858aad3c3..7cf39af816c 100644
--- a/modules/swagger-codegen/src/main/resources/Java/gitignore.mustache
+++ b/modules/swagger-codegen/src/main/resources/Java/gitignore.mustache
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/modules/swagger-codegen/src/main/resources/Java/gradle-wrapper.jar b/modules/swagger-codegen/src/main/resources/Java/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/modules/swagger-codegen/src/main/resources/Java/gradle-wrapper.jar differ
diff --git a/modules/swagger-codegen/src/main/resources/Java/gradle-wrapper.properties.mustache b/modules/swagger-codegen/src/main/resources/Java/gradle-wrapper.properties.mustache
new file mode 100644
index 00000000000..b7a36473955
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/Java/gradle-wrapper.properties.mustache
@@ -0,0 +1,6 @@
+#Tue May 17 23:08:05 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/modules/swagger-codegen/src/main/resources/Java/gradlew.bat.mustache b/modules/swagger-codegen/src/main/resources/Java/gradlew.bat.mustache
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/Java/gradlew.bat.mustache
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/modules/swagger-codegen/src/main/resources/Java/gradlew.mustache b/modules/swagger-codegen/src/main/resources/Java/gradlew.mustache
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/Java/gradlew.mustache
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache
index 6c980b727fa..26cb9d7d946 100644
--- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache
@@ -76,12 +76,12 @@ public class {{classname}} {
{{/formParams}}
final String[] {{localVariablePrefix}}localVarAccepts = {
- {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
+ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
};
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
final String[] {{localVariablePrefix}}localVarContentTypes = {
- {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
+ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
};
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache
index 6c46a9aed9a..dd9141bd3dc 100644
--- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache
@@ -76,13 +76,13 @@ public class {{classname}} {
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});{{/formParams}}
final String[] {{localVariablePrefix}}localVarAccepts = {
- {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
+ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
};
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
if ({{localVariablePrefix}}localVarAccept != null) {{localVariablePrefix}}localVarHeaderParams.put("Accept", {{localVariablePrefix}}localVarAccept);
final String[] {{localVariablePrefix}}localVarContentTypes = {
- {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
+ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
};
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
{{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType);
diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache
index 5d25496a1b3..7d57616610d 100644
--- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache
@@ -18,8 +18,8 @@ public interface {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
- {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
- {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
+ {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
+ {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}});
{{/operation}}
}
diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/api.mustache
index 16f46ce0534..15442ad4748 100644
--- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/api.mustache
@@ -25,8 +25,8 @@ import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
@Path("/{{baseName}}")
-{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
-{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
+{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
+{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.Api(description = "the {{baseName}} API")
{{>generatedAnnotation}}
{{#operations}}
@@ -36,8 +36,8 @@ public class {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
- {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
- {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
+ {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
+ {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
{{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = {
{{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}},
diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey2/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey2/api.mustache
index 4200f4aca6e..e1eb66091ae 100644
--- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey2/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey2/api.mustache
@@ -23,8 +23,8 @@ import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
@Path("/{{baseName}}")
-{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
-{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
+{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
+{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.Api(description = "the {{baseName}} API")
{{>generatedAnnotation}}
{{#operations}}
@@ -34,8 +34,8 @@ public class {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
- {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
- {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
+ {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
+ {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
{{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = {
{{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}},
diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache
index d83facaf646..6354f755b8b 100644
--- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/api.mustache
@@ -19,8 +19,8 @@ import javax.ws.rs.*;
{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
{{/isMultipart}}{{/operation}}{{/operations}}
@Path("/{{baseName}}")
-{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
-{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
+{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
+{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
{{>generatedAnnotation}}
{{#operations}}
public class {{classname}} {
@@ -29,8 +29,8 @@ public class {{classname}} {
{{#operation}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
- {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
- {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
+ {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
+ {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.{{nickname}}({{#isMultipart}}input,{{/isMultipart}}{{#allParams}}{{^isMultipart}}{{paramName}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}}{{paramName}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}securityContext);
diff --git a/modules/swagger-codegen/src/main/resources/JavaSpringBoot/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpringBoot/api.mustache
index 126fbf61a2c..b214f376110 100644
--- a/modules/swagger-codegen/src/main/resources/JavaSpringBoot/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaSpringBoot/api.mustache
@@ -41,8 +41,8 @@ public class {{classname}} {
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
@RequestMapping(value = "{{{path}}}",
- {{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
- {{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
+ {{#hasProduces}}produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
+ {{#hasConsumes}}consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
method = RequestMethod.{{httpMethod}})
public ResponseEntity<{{>returnTypes}}> {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
{{/hasMore}}{{/allParams}})
diff --git a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api-j8-async.mustache b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api-j8-async.mustache
index b11e5c2db20..90cb04104f0 100755
--- a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api-j8-async.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api-j8-async.mustache
@@ -49,8 +49,8 @@ public interface {{classname}} {
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"){{#hasMore}},{{/hasMore}}{{/responses}} })
@RequestMapping(value = "{{path}}",
- {{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
- {{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
+ {{#hasProduces}}produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
+ {{#hasConsumes}}consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
method = RequestMethod.{{httpMethod}})
default CallablereturnTypes}}>> {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
{{/hasMore}}{{/allParams}})
diff --git a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache
index ee02339909e..7fe7c5acf60 100644
--- a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache
@@ -46,8 +46,8 @@ public class {{classname}} {
@io.swagger.annotations.ApiResponses(value = { {{#responses}}
@io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
@RequestMapping(value = "{{{path}}}",
- {{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
- {{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
+ {{#hasProduces}}produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
+ {{#hasConsumes}}consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
method = RequestMethod.{{httpMethod}})
public ResponseEntity<{{>returnTypes}}> {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
{{/hasMore}}{{/allParams}})
diff --git a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache
index f47085ad657..14abda4751c 100644
--- a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache
@@ -74,8 +74,8 @@
};
var authNames = [<#authMethods>''<#hasMore>, ];
- var contentTypes = [<#consumes>''<#hasMore>, ];
- var accepts = [<#produces>''<#hasMore>, ];
+ var contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, ];
+ var accepts = [<#produces>'<& mediaType>'<#hasMore>, ];
var returnType = <#returnType><&returnType><^returnType>null;
return this.apiClient.callApi(
diff --git a/modules/swagger-codegen/src/main/resources/Javascript/api_doc.mustache b/modules/swagger-codegen/src/main/resources/Javascript/api_doc.mustache
index f5aad995da5..0decb56e915 100644
--- a/modules/swagger-codegen/src/main/resources/Javascript/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/Javascript/api_doc.mustache
@@ -82,8 +82,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
{{/operation}}
{{/operations}}
diff --git a/modules/swagger-codegen/src/main/resources/_common/.swagger-codegen-ignore b/modules/swagger-codegen/src/main/resources/_common/.swagger-codegen-ignore
new file mode 100644
index 00000000000..19d3377182e
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/_common/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache
index 4d0e8c99675..7983a41edf6 100644
--- a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache
@@ -20,7 +20,7 @@ object {{classname}} {
{{>javadoc}}
{{/javadocRenderer}}
def {{operationId}}({{>methodParameters}}): ApiRequest[{{>operationReturnType}}] =
- ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{basePath}}", "{{path}}", {{#consumes.0}}"{{mediaType}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}})
+ ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{basePath}}", "{{path}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}})
{{#authMethods}}{{#isApiKey}}.withApiKey(apiKey, "{{keyParamName}}", {{#isKeyInQuery}}QUERY{{/isKeyInQuery}}{{#isKeyInHeader}}HEADER{{/isKeyInHeader}})
{{/isApiKey}}{{#isBasic}}.withCredentials(basicAuth)
{{/isBasic}}{{/authMethods}}{{#bodyParam}}.withBody({{paramName}})
diff --git a/modules/swagger-codegen/src/main/resources/android/api.mustache b/modules/swagger-codegen/src/main/resources/android/api.mustache
index f3d0f7996de..5f786e503a0 100644
--- a/modules/swagger-codegen/src/main/resources/android/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/api.mustache
@@ -73,7 +73,7 @@ public class {{classname}} {
{{/headerParams}}
String[] localVarContentTypes = {
- {{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
+ {{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
};
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
diff --git a/modules/swagger-codegen/src/main/resources/android/apiException.mustache b/modules/swagger-codegen/src/main/resources/android/apiException.mustache
index a6bcba75b7c..be5255e2568 100644
--- a/modules/swagger-codegen/src/main/resources/android/apiException.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/apiException.mustache
@@ -14,16 +14,16 @@ public class ApiException extends Exception {
public int getCode() {
return code;
}
-
+
public void setCode(int code) {
this.code = code;
}
-
+
public String getMessage() {
return message;
}
-
+
public void setMessage(String message) {
this.message = message;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/api_doc.mustache b/modules/swagger-codegen/src/main/resources/android/api_doc.mustache
index 2fdcab749ab..cd3888dfb06 100644
--- a/modules/swagger-codegen/src/main/resources/android/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/api_doc.mustache
@@ -53,8 +53,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
{{/operation}}
{{/operations}}
diff --git a/modules/swagger-codegen/src/main/resources/android/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/android/git_push.sh.mustache
index e153ce23ecf..a9b0f28edfb 100755
--- a/modules/swagger-codegen/src/main/resources/android/git_push.sh.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/git_push.sh.mustache
@@ -28,7 +28,7 @@ git init
# Adds the files in the local repository and stages them for commit.
git add .
-# Commits the tracked changes and prepares them to be pushed to a remote repository.
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
diff --git a/modules/swagger-codegen/src/main/resources/android/gradle-wrapper.jar b/modules/swagger-codegen/src/main/resources/android/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/modules/swagger-codegen/src/main/resources/android/gradle-wrapper.jar differ
diff --git a/modules/swagger-codegen/src/main/resources/android/gradle-wrapper.properties.mustache b/modules/swagger-codegen/src/main/resources/android/gradle-wrapper.properties.mustache
new file mode 100644
index 00000000000..fa452523ac0
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/android/gradle-wrapper.properties.mustache
@@ -0,0 +1,6 @@
+#Mon May 16 21:00:11 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/modules/swagger-codegen/src/main/resources/android/gradlew.bat.mustache b/modules/swagger-codegen/src/main/resources/android/gradlew.bat.mustache
new file mode 100644
index 00000000000..5f192121eb4
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/android/gradlew.bat.mustache
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/modules/swagger-codegen/src/main/resources/android/gradlew.mustache b/modules/swagger-codegen/src/main/resources/android/gradlew.mustache
new file mode 100644
index 00000000000..9d82f789151
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/android/gradlew.mustache
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/modules/swagger-codegen/src/main/resources/android/httpPatch.mustache b/modules/swagger-codegen/src/main/resources/android/httpPatch.mustache
index 55cec2f1279..08ce4409f7a 100644
--- a/modules/swagger-codegen/src/main/resources/android/httpPatch.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/httpPatch.mustache
@@ -13,4 +13,4 @@ public class HttpPatch extends HttpPost {
public String getMethod() {
return METHOD_PATCH;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache
index 38c7f00cdaa..5d9ecb32066 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache
@@ -81,7 +81,7 @@ public class {{classname}} {
{{/headerParams}}
String[] contentTypes = {
- {{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
+ {{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
@@ -167,7 +167,7 @@ public class {{classname}} {
{{/headerParams}}
String[] contentTypes = {
- {{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
+ {{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}
};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiException.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiException.mustache
index a6bcba75b7c..be5255e2568 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiException.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiException.mustache
@@ -14,16 +14,16 @@ public class ApiException extends Exception {
public int getCode() {
return code;
}
-
+
public void setCode(int code) {
this.code = code;
}
-
+
public String getMessage() {
return message;
}
-
+
public void setMessage(String message) {
this.message = message;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/git_push.sh.mustache
index 079d91582ef..b3c88d4be09 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/git_push.sh.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/git_push.sh.mustache
@@ -28,7 +28,7 @@ git init
# Adds the files in the local repository and stages them for commit.
git add .
-# Commits the tracked changes and prepares them to be pushed to a remote repository.
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
@@ -48,4 +48,4 @@ git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
-git push origin master 2>&1 | grep -v 'To https'
\ No newline at end of file
+git push origin master 2>&1 | grep -v 'To https'
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/gitignore.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/gitignore.mustache
index a7b72d554da..a8368751267 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/gitignore.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/gitignore.mustache
@@ -36,4 +36,4 @@ captures/
*.iml
# Keystore files
-*.jks
\ No newline at end of file
+*.jks
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/model.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/model.mustache
index d22bfa5693b..df99de87403 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/model.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/model.mustache
@@ -52,7 +52,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
return true;{{/hasVars}}
}
- @Override
+ @Override
public int hashCode() {
int result = 17;
{{#vars}}
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/deleterequest.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/deleterequest.mustache
index 0df3f6e4ac4..6b0600e77b9 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/deleterequest.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/deleterequest.mustache
@@ -83,4 +83,4 @@ public class DeleteRequest extends Request {
return headers;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/getrequest.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/getrequest.mustache
index 63803c3b481..ec225b5a46c 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/getrequest.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/getrequest.mustache
@@ -36,4 +36,4 @@ public class GetRequest extends StringRequest{
return headers;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/patchrequest.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/patchrequest.mustache
index 87270b48ebf..188fc5edb41 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/patchrequest.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/patchrequest.mustache
@@ -83,4 +83,4 @@ public class PatchRequest extends Request {
return headers;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/postrequest.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/postrequest.mustache
index f11fddd25ef..02c7fdfb119 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/postrequest.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/postrequest.mustache
@@ -83,4 +83,4 @@ public class PostRequest extends Request {
return headers;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/putrequest.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/putrequest.mustache
index 9e54c7cfe9a..571a921e56a 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/putrequest.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/request/putrequest.mustache
@@ -83,4 +83,4 @@ public class PutRequest extends Request {
return headers;
}
-}
\ No newline at end of file
+}
diff --git a/modules/swagger-codegen/src/main/resources/android/model.mustache b/modules/swagger-codegen/src/main/resources/android/model.mustache
index d22bfa5693b..df99de87403 100644
--- a/modules/swagger-codegen/src/main/resources/android/model.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/model.mustache
@@ -52,7 +52,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
return true;{{/hasVars}}
}
- @Override
+ @Override
public int hashCode() {
int result = 17;
{{#vars}}
diff --git a/modules/swagger-codegen/src/main/resources/android/pom.mustache b/modules/swagger-codegen/src/main/resources/android/pom.mustache
index 0c00c55de1f..bf11a6625c5 100644
--- a/modules/swagger-codegen/src/main/resources/android/pom.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/pom.mustache
@@ -152,4 +152,4 @@
4.8.1
4.3.6
-
\ No newline at end of file
+
diff --git a/modules/swagger-codegen/src/main/resources/android/settings.gradle.mustache b/modules/swagger-codegen/src/main/resources/android/settings.gradle.mustache
index b8fd6c4c41f..ba0114cb176 100644
--- a/modules/swagger-codegen/src/main/resources/android/settings.gradle.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/settings.gradle.mustache
@@ -1 +1 @@
-rootProject.name = "{{artifactId}}"
\ No newline at end of file
+rootProject.name = "{{artifactId}}"
diff --git a/modules/swagger-codegen/src/main/resources/clojure/api.mustache b/modules/swagger-codegen/src/main/resources/clojure/api.mustache
index a6b598fc610..cf821cfdd3c 100644
--- a/modules/swagger-codegen/src/main/resources/clojure/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/clojure/api.mustache
@@ -14,8 +14,8 @@
<#hasOptionalParams> :query-params {<#queryParams>"" <#collectionFormat>(with-collection-format :)<^collectionFormat> }
<#hasOptionalParams> :form-params {<#formParams>"" <#collectionFormat>(with-collection-format :)<^collectionFormat> }<#bodyParam>
<#hasOptionalParams> :body-param
- <#hasOptionalParams> :content-types [<#consumes>""<#hasMore> ]
- <#hasOptionalParams> :accepts [<#produces>""<#hasMore> ]
+ <#hasOptionalParams> :content-types [<#consumes>"<& mediaType>"<#hasMore> ]
+ <#hasOptionalParams> :accepts [<#produces>"<& mediaType>"<#hasMore> ]
<#hasOptionalParams> :auth-names [<#authMethods>"<&name>"<#hasMore> ]})<#hasOptionalParams>))
(defn
@@ -24,4 +24,4 @@
([<#allParams><#required><#isFile>^File ] (<#allParams><#required> nil))
<#hasOptionalParams>([<#allParams><#required><#isFile>^File <#hasOptionalParams>optional-params]
<#hasOptionalParams> (:data (-with-http-info<#allParams><#required> <#hasOptionalParams> optional-params))<#hasOptionalParams>))
-
\ No newline at end of file
+
diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
index a96f4ced1ef..da1cee8caef 100644
--- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
@@ -196,7 +196,7 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
{{#consumes}}
- "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
@@ -204,7 +204,7 @@ namespace {{packageName}}.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
{{#produces}}
- "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
@@ -329,7 +329,7 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
{{#consumes}}
- "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
@@ -337,7 +337,7 @@ namespace {{packageName}}.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
{{#produces}}
- "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
{{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
diff --git a/modules/swagger-codegen/src/main/resources/csharp/api_doc.mustache b/modules/swagger-codegen/src/main/resources/csharp/api_doc.mustache
index 677ad3edbe1..c0a31d09377 100644
--- a/modules/swagger-codegen/src/main/resources/csharp/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/csharp/api_doc.mustache
@@ -87,8 +87,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
diff --git a/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache
index acc3675f10c..c8a00373ff2 100644
--- a/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache
+++ b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache
@@ -39,7 +39,7 @@
/// {{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.
{{/isReadOnly}}
{{/vars}}
- public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} = null{{/isReadOnly}}{{#hasMoreNonReadOnly}}, {{/hasMoreNonReadOnly}}{{/vars}})
+ public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} = null{{^-last}}, {{/-last}}{{/readWriteVars}})
{
{{#vars}}
{{^isReadOnly}}
diff --git a/modules/swagger-codegen/src/main/resources/dart/api.mustache b/modules/swagger-codegen/src/main/resources/dart/api.mustache
index d8ee98569c1..cba12208b7d 100644
--- a/modules/swagger-codegen/src/main/resources/dart/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/dart/api.mustache
@@ -37,7 +37,7 @@ class {{classname}} {
{{#headerParams}}headerParams["{{baseName}}"] = {{paramName}};
{{/headerParams}}
- List contentTypes = [{{#consumes}}"{{mediaType}}"{{#hasMore}},{{/hasMore}}{{/consumes}}];
+ List contentTypes = [{{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}];
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
List authNames = [{{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}];
diff --git a/modules/swagger-codegen/src/main/resources/go/.travis.yml b/modules/swagger-codegen/src/main/resources/go/.travis.yml
new file mode 100644
index 00000000000..f5cb2ce9a5a
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/go/.travis.yml
@@ -0,0 +1,8 @@
+language: go
+
+install:
+ - go get -d -v .
+
+script:
+ - go build -v ./
+
diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache
index ee828484ef3..0209e8590c3 100644
--- a/modules/swagger-codegen/src/main/resources/go/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/go/api.mustache
@@ -95,7 +95,7 @@ func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{
{{/queryParams}}{{/hasQueryParams}}
// to determine the Content-Type header
- localVarHttpContentTypes := []string{ {{#consumes}}"{{mediaType}}", {{/consumes}} }
+ localVarHttpContentTypes := []string{ {{#consumes}}"{{{mediaType}}}", {{/consumes}} }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
@@ -104,7 +104,7 @@ func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
- {{#produces}}"{{mediaType}}",
+ {{#produces}}"{{{mediaType}}}",
{{/produces}} }
// set Accept header
diff --git a/modules/swagger-codegen/src/main/resources/go/api_doc.mustache b/modules/swagger-codegen/src/main/resources/go/api_doc.mustache
index e91082ffc99..3c3444474ee 100644
--- a/modules/swagger-codegen/src/main/resources/go/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/go/api_doc.mustache
@@ -35,8 +35,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache
index 60da5979a89..ad22284d4e4 100644
--- a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache
+++ b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache
@@ -14,10 +14,17 @@
{{#infoUrl}}{{/infoUrl}}
{{#infoEmail}}{{/infoEmail}}
{{#version}}Version: {{{version}}}
{{/version}}
+ {{#basePathWithoutHost}}BasePath:{{basePathWithoutHost}}
{{/basePathWithoutHost}}
{{{licenseInfo}}}
{{{licenseUrl}}}
Access
- {{access}}
+ {{#hasAuthMethods}}
+
+ {{#authMethods}}
+ - {{#isBasic}}HTTP Basic Authentication{{/isBasic}}{{#isOAuth}}OAuth AuthorizationUrl:{{authorizationUrl}}TokenUrl:{{tokenUrl}}{{/isOAuth}}{{#isApiKey}}APIKey KeyParamName:{{keyParamName}} KeyInQuery:{{isKeyInQuery}} KeyInHeader:{{isKeyInHeader}}{{/isApiKey}}
+ {{/authMethods}}
+
+ {{/hasAuthMethods}}
[ Jump to Models ]
@@ -61,7 +68,7 @@
This API call consumes the following media types via the Content-Type request header:
{{#consumes}}
- {{mediaType}}
+ {{{mediaType}}}
{{/consumes}}
{{/hasConsumes}}
@@ -118,7 +125,7 @@
the media type will be conveyed by the Content-Type response header.
{{#produces}}
- {{mediaType}}
+ {{{mediaType}}}
{{/produces}}
{{/hasProduces}}
diff --git a/modules/swagger-codegen/src/main/resources/lumen/app/Http/routes.mustache b/modules/swagger-codegen/src/main/resources/lumen/app/Http/routes.mustache
index 3166f947935..4b904bf2f8e 100644
--- a/modules/swagger-codegen/src/main/resources/lumen/app/Http/routes.mustache
+++ b/modules/swagger-codegen/src/main/resources/lumen/app/Http/routes.mustache
@@ -13,7 +13,7 @@ $app->get('/', function () use ($app) {
* {{httpMethod}} {{nickname}}
* Summary: {{summary}}
* Notes: {{notes}}
-{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
+{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
*/
$app->{{httpMethod}}('{{path}}', function({{#pathParams}}${{paramName}}, {{/pathParams}}$null = null) use ($app) {
{{#hasHeaderParams}}$headers = Request::header();{{/hasHeaderParams}}
diff --git a/modules/swagger-codegen/src/main/resources/lumen/routes.mustache b/modules/swagger-codegen/src/main/resources/lumen/routes.mustache
index be2fac8d86e..3d91b32c8e4 100644
--- a/modules/swagger-codegen/src/main/resources/lumen/routes.mustache
+++ b/modules/swagger-codegen/src/main/resources/lumen/routes.mustache
@@ -13,7 +13,7 @@ $app->get('/', function () use ($app) {
* {{httpMethod}} {{nickname}}
* Summary: {{summary}}
* Notes: {{notes}}
-{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
+{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
*/
Route::{{httpMethod}}('{{path}}', function({{#pathParams}}${{paramName}}, {{/pathParams}}null) use ($app) {
{{#hasHeaderParams}}$headers = Request::header();{{/hasHeaderParams}}
diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache
index 92dbf1d0065..5c09f340b4d 100644
--- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache
+++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache
@@ -126,7 +126,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513;
}
{{/headerParams}}
// HTTP header `Accept`
- NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
+ NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[{{#produces}}@"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
if(acceptHeader.length > 0) {
headerParams[@"Accept"] = acceptHeader;
}
@@ -135,7 +135,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513;
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";
// request content type
- NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
+ NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[{{#consumes}}@"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
// Authentication setting
NSArray *authSettings = @[{{#authMethods}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}];
diff --git a/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache b/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache
index 7acaada7e32..44fe31d6404 100644
--- a/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/objc/api_doc.mustache
@@ -76,8 +76,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
diff --git a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache
index 776cd55ccef..6f15d3b6c5b 100644
--- a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache
+++ b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache
@@ -7,7 +7,7 @@
- (instancetype)init {
self = [super init];
if (self) {
- // initalise property's default value, if any
+ // initialize property's default value, if any
{{#vars}}{{#defaultValue}}self.{{name}} = {{{defaultValue}}};
{{/defaultValue}}{{/vars}}
}
diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache
index d96a2302a8a..d7ece2d1e65 100644
--- a/modules/swagger-codegen/src/main/resources/perl/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache
@@ -100,11 +100,11 @@ sub {{operationId}} {
my $form_params = {};
# 'Accept' and 'Content-Type' header
- my $_header_accept = $self->{api_client}->select_header_accept({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}});
+ my $_header_accept = $self->{api_client}->select_header_accept({{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}});
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
- $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}});
+ $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}});
{{#queryParams}}
# query params
diff --git a/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache b/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache
index 17dc3903152..585a67c1ac1 100644
--- a/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache
@@ -67,8 +67,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache
index 7a9b2afa993..26024ea4789 100644
--- a/modules/swagger-codegen/src/main/resources/php/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/php/api.mustache
@@ -167,11 +167,11 @@ use \{{invokerPackage}}\ObjectSerializer;
$queryParams = array();
$headerParams = array();
$formParams = array();
- $_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}));
+ $_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
- $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}}));
+ $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}{{/consumes}}));
{{#queryParams}}// query params
{{#collectionFormat}}
diff --git a/modules/swagger-codegen/src/main/resources/php/api_doc.mustache b/modules/swagger-codegen/src/main/resources/php/api_doc.mustache
index fa6033b084a..be2cb895fed 100644
--- a/modules/swagger-codegen/src/main/resources/php/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/php/api_doc.mustache
@@ -63,8 +63,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache
index 94458e3f724..c9c94ad3e3e 100644
--- a/modules/swagger-codegen/src/main/resources/python/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/python/api.mustache
@@ -156,13 +156,13 @@ class {{classname}}(object):
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
- select_header_accept([{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}])
+ select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
- select_header_content_type([{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}])
+ select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}])
# Authentication setting
auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]
diff --git a/modules/swagger-codegen/src/main/resources/python/api_doc.mustache b/modules/swagger-codegen/src/main/resources/python/api_doc.mustache
index 8eb25a87b06..98dec04a393 100644
--- a/modules/swagger-codegen/src/main/resources/python/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/python/api_doc.mustache
@@ -65,8 +65,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
diff --git a/modules/swagger-codegen/src/main/resources/ruby/LICENSE b/modules/swagger-codegen/src/main/resources/ruby/LICENSE
new file mode 100644
index 00000000000..8dada3edaf5
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/ruby/LICENSE
@@ -0,0 +1,201 @@
+ 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/modules/swagger-codegen/src/main/resources/ruby/api.mustache b/modules/swagger-codegen/src/main/resources/ruby/api.mustache
index 20b6d4593e3..5201fd343ea 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/api.mustache
@@ -98,11 +98,11 @@ module {{moduleName}}
header_params = {}
# HTTP header 'Accept' (if needed)
- local_header_accept = [{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]
+ local_header_accept = [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
- local_header_content_type = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
+ local_header_content_type = [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type){{#headerParams}}{{#required}}
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}{{/required}}{{/headerParams}}{{#headerParams}}{{^required}}
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if opts[:'{{{paramName}}}']{{/required}}{{/headerParams}}
diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache
index 1ed497da21e..ae32ff0ccfa 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache
@@ -1,3 +1,7 @@
+=begin
+{{> api_info}}
+=end
+
require 'spec_helper'
describe {{moduleName}}::ApiClient do
diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_doc.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_doc.mustache
index 754e41db5a8..02fd5f7f547 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/api_doc.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/api_doc.mustache
@@ -70,8 +70,8 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache
index 28301757e70..44d38c5cfad 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache
@@ -1,18 +1,23 @@
-{{#appName}}{{{appName}}}
+{{#appName}}
+{{{appName}}}
{{/appName}}
-{{#appDescription}}{{{appDescription}}}
+{{#appDescription}}
+{{{appDescription}}}
{{/appDescription}}
{{#version}}OpenAPI spec version: {{version}}{{/version}}
{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
Generated by: https://github.com/swagger-api/swagger-codegen.git
-{{#licenseInfo}}
-License: {{{licenseInfo}}}
-{{#licenseUrl}}{{licenseUrl}}{{/licenseUrl}}
+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
-{{/licenseInfo}}
-{{#termsOfService}}
-Terms of Service: {{{termsOfService}}}
-{{/termsOfService}}
+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/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache b/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache
index 160fa85a57d..e22b6d6f8a1 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache
@@ -1,3 +1,7 @@
+=begin
+{{> api_info}}
+=end
+
require 'uri'
module {{moduleName}}
diff --git a/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache b/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache
index 4c23a067175..6ea22543491 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache
@@ -1,3 +1,7 @@
+=begin
+{{> api_info}}
+=end
+
require 'spec_helper'
describe {{moduleName}}::Configuration do
diff --git a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache
index 65884d0f562..86d9a6e55d8 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache
@@ -1,4 +1,9 @@
# -*- encoding: utf-8 -*-
+#
+=begin
+{{> api_info}}
+=end
+
$:.push File.expand_path("../lib", __FILE__)
require "{{gemName}}/version"
diff --git a/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache
index a9b0f28edfb..3def1140afc 100755
--- a/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache
@@ -1,4 +1,19 @@
#!/bin/sh
+#
+# Generated by: https://github.com/swagger-api/swagger-codegen.git
+#
+# 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.
+#
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
diff --git a/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache b/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache
index a8b1cda23f8..522134fcdd3 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache
@@ -1,3 +1,17 @@
+# Generated by: https://github.com/swagger-api/swagger-codegen.git
+#
+# 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.
+
*.gem
*.rbc
/.config
diff --git a/modules/swagger-codegen/src/main/resources/ruby/model.mustache b/modules/swagger-codegen/src/main/resources/ruby/model.mustache
index 685b6006f97..33a5d134029 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/model.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/model.mustache
@@ -4,239 +4,6 @@
require 'date'
-module {{moduleName}}{{#models}}{{#model}}{{#description}}
- # {{{description}}}{{/description}}
- class {{classname}}{{#vars}}{{#description}}
- # {{{description}}}{{/description}}
- attr_accessor :{{{name}}}
-{{/vars}}
-
- # Attribute mapping from ruby-style variable name to JSON key.
- def self.attribute_map
- {
- {{#vars}}
- :'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}}
- {{/vars}}
- }
- end
-
- # Attribute type mapping.
- def self.swagger_types
- {
- {{#vars}}
- :'{{{name}}}' => :'{{{datatype}}}'{{#hasMore}},{{/hasMore}}
- {{/vars}}
- }
- end
-
- # Initializes the object
- # @param [Hash] attributes Model attributes in the form of hash
- def initialize(attributes = {})
- return unless attributes.is_a?(Hash)
-
- # convert string to symbol for hash key
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
-
- {{#vars}}
- if attributes.has_key?(:'{{{baseName}}}')
- {{#isContainer}}
- if (value = attributes[:'{{{baseName}}}']).is_a?(Array)
- self.{{{name}}} = value
- end
- {{/isContainer}}
- {{^isContainer}}
- self.{{{name}}} = attributes[:'{{{baseName}}}']
- {{/isContainer}}
- {{#defaultValue}}
- else
- self.{{{name}}} = {{{defaultValue}}}
- {{/defaultValue}}
- end
-
- {{/vars}}
- end
-
- # Show invalid properties with the reasons. Usually used together with valid?
- # @return Array for valid properies with the reasons
- def list_invalid_properties
- invalid_properties = Array.new
- {{#isEnum}}
- allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
- if @{{{name}}} && !allowed_values.include?({{{name}}})
- invalid_properties.push("invalid value for '{{{name}}}', must be one of #{allowed_values}.")
- end
-
- {{/isEnum}}
- {{#hasValidation}}
- if @{{{name}}}.nil?
- fail ArgumentError, "{{{name}}} cannot be nil"
- end
-
- {{#minLength}}
- if @{{{name}}}.to_s.length > {{{maxLength}}}
- invalid_properties.push("invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}.")
- end
-
- {{/minLength}}
- {{#maxLength}}
- if @{{{name}}}.to_s.length < {{{minLength}}}
- invalid_properties.push("invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}.")
- end
-
- {{/maxLength}}
- {{#maximum}}
- if @{{{name}}} > {{{maximum}}}
- invalid_properties.push("invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}.")
- end
-
- {{/maximum}}
- {{#minimum}}
- if @{{{name}}} < {{{minimum}}}
- invalid_properties.push("invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}.")
- end
-
- {{/minimum}}
- {{#pattern}}
- if @{{{name}}} !~ Regexp.new({{{pattern}}})
- invalid_properties.push("invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}.")
- end
-
- {{/pattern}}
- {{/hasValidation}}
- return invalid_properties
- end
-
- # Check to see if the all the properties in the model are valid
- # @return true if the model is valid
- def valid?
- {{#vars}}
- {{#required}}
- if @{{{name}}}.nil?
- return false
- end
-
- {{/required}}
- {{#isEnum}}
- allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
- if @{{{name}}} && !allowed_values.include?(@{{{name}}})
- return false
- end
- {{/isEnum}}
- {{#hasValidation}}
- {{#minLength}}
- if @{{{name}}}.to_s.length > {{{maxLength}}}
- return false
- end
-
- {{/minLength}}
- {{#maxLength}}
- if @{{{name}}}.to_s.length < {{{minLength}}}
- return false
- end
-
- {{/maxLength}}
- {{#maximum}}
- if @{{{name}}} > {{{maximum}}}
- return false
- end
-
- {{/maximum}}
- {{#minimum}}
- if @{{{name}}} < {{{minimum}}}
- return false
- end
-
- {{/minimum}}
- {{#pattern}}
- if @{{{name}}} !~ Regexp.new({{{pattern}}})
- return false
- end
-
- {{/pattern}}
- {{/hasValidation}}
- {{/vars}}
- end
-
- {{#vars}}
- {{#isEnum}}
- # Custom attribute writer method checking allowed values (enum).
- # @param [Object] {{{name}}} Object to be assigned
- def {{{name}}}=({{{name}}})
- allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
- if {{{name}}} && !allowed_values.include?({{{name}}})
- fail ArgumentError, "invalid value for '{{{name}}}', must be one of #{allowed_values}."
- end
- @{{{name}}} = {{{name}}}
- end
-
- {{/isEnum}}
- {{^isEnum}}
- {{#hasValidation}}
- # Custom attribute writer method with validation
- # @param [Object] {{{name}}} Value to be assigned
- def {{{name}}}=({{{name}}})
- if {{{name}}}.nil?
- fail ArgumentError, "{{{name}}} cannot be nil"
- end
-
- {{#minLength}}
- if {{{name}}}.to_s.length > {{{maxLength}}}
- fail ArgumentError, "invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}."
- end
-
- {{/minLength}}
- {{#maxLength}}
- if {{{name}}}.to_s.length < {{{minLength}}}
- fail ArgumentError, "invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}."
- end
-
- {{/maxLength}}
- {{#maximum}}
- if {{{name}}} > {{{maximum}}}
- fail ArgumentError, "invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}."
- end
-
- {{/maximum}}
- {{#minimum}}
- if {{{name}}} < {{{minimum}}}
- fail ArgumentError, "invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}."
- end
-
- {{/minimum}}
- {{#pattern}}
- if @{{{name}}} !~ Regexp.new({{{pattern}}})
- fail ArgumentError, "invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}."
- end
-
- {{/pattern}}
- @{{{name}}} = {{{name}}}
- end
-
- {{/hasValidation}}
- {{/isEnum}}
- {{/vars}}
- # Checks equality by comparing each attribute.
- # @param [Object] Object to be compared
- def ==(o)
- return true if self.equal?(o)
- self.class == o.class{{#vars}} &&
- {{name}} == o.{{name}}{{/vars}}
- end
-
- # @see the `==` method
- # @param [Object] Object to be compared
- def eql?(o)
- self == o
- end
-
- # Calculates hash code according to all attributes.
- # @return [Fixnum] Hash code
- def hash
- [{{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}].hash
- end
-
-{{> base_object}}
- end
-{{/model}}
-{{/models}}
+module {{moduleName}}
+{{#models}}{{#model}}{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}}{{/model}}{{/models}}
end
diff --git a/modules/swagger-codegen/src/main/resources/ruby/partial_model_enum_class.mustache b/modules/swagger-codegen/src/main/resources/ruby/partial_model_enum_class.mustache
new file mode 100644
index 00000000000..e0e1ca9403d
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/ruby/partial_model_enum_class.mustache
@@ -0,0 +1,4 @@
+ class {{classname}}
+ {{#allowableValues}}{{#enumVars}}
+ {{{name}}} = {{{value}}}.freeze{{/enumVars}}{{/allowableValues}}
+ end
diff --git a/modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache b/modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache
new file mode 100644
index 00000000000..25a71610168
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache
@@ -0,0 +1,232 @@
+{{#description}} # {{{description}}}{{/description}}
+ class {{classname}}{{#vars}}{{#description}}
+ # {{{description}}}{{/description}}
+ attr_accessor :{{{name}}}
+ {{/vars}}
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ {{#vars}}
+ :'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}}
+ {{/vars}}
+ }
+ end
+
+ # Attribute type mapping.
+ def self.swagger_types
+ {
+ {{#vars}}
+ :'{{{name}}}' => :'{{{datatype}}}'{{#hasMore}},{{/hasMore}}
+ {{/vars}}
+ }
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ return unless attributes.is_a?(Hash)
+
+ # convert string to symbol for hash key
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
+
+ {{#vars}}
+ if attributes.has_key?(:'{{{baseName}}}')
+ {{#isContainer}}
+ if (value = attributes[:'{{{baseName}}}']).is_a?(Array)
+ self.{{{name}}} = value
+ end
+ {{/isContainer}}
+ {{^isContainer}}
+ self.{{{name}}} = attributes[:'{{{baseName}}}']
+ {{/isContainer}}
+ {{#defaultValue}}
+ else
+ self.{{{name}}} = {{{defaultValue}}}
+ {{/defaultValue}}
+ end
+
+ {{/vars}}
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properies with the reasons
+ def list_invalid_properties
+ invalid_properties = Array.new
+ {{#isEnum}}
+ allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
+ if @{{{name}}} && !allowed_values.include?({{{name}}})
+ invalid_properties.push("invalid value for '{{{name}}}', must be one of #{allowed_values}.")
+ end
+
+ {{/isEnum}}
+ {{#hasValidation}}
+ if @{{{name}}}.nil?
+ fail ArgumentError, "{{{name}}} cannot be nil"
+ end
+
+ {{#minLength}}
+ if @{{{name}}}.to_s.length > {{{maxLength}}}
+ invalid_properties.push("invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}.")
+ end
+
+ {{/minLength}}
+ {{#maxLength}}
+ if @{{{name}}}.to_s.length < {{{minLength}}}
+ invalid_properties.push("invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}.")
+ end
+
+ {{/maxLength}}
+ {{#maximum}}
+ if @{{{name}}} > {{{maximum}}}
+ invalid_properties.push("invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}.")
+ end
+
+ {{/maximum}}
+ {{#minimum}}
+ if @{{{name}}} < {{{minimum}}}
+ invalid_properties.push("invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}.")
+ end
+
+ {{/minimum}}
+ {{#pattern}}
+ if @{{{name}}} !~ Regexp.new({{{pattern}}})
+ invalid_properties.push("invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}.")
+ end
+
+ {{/pattern}}
+ {{/hasValidation}}
+ return invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ {{#vars}}
+ {{#required}}
+ if @{{{name}}}.nil?
+ return false
+ end
+
+ {{/required}}
+ {{#isEnum}}
+ allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
+ if @{{{name}}} && !allowed_values.include?(@{{{name}}})
+ return false
+ end
+ {{/isEnum}}
+ {{#hasValidation}}
+ {{#minLength}}
+ if @{{{name}}}.to_s.length > {{{maxLength}}}
+ return false
+ end
+
+ {{/minLength}}
+ {{#maxLength}}
+ if @{{{name}}}.to_s.length < {{{minLength}}}
+ return false
+ end
+
+ {{/maxLength}}
+ {{#maximum}}
+ if @{{{name}}} > {{{maximum}}}
+ return false
+ end
+
+ {{/maximum}}
+ {{#minimum}}
+ if @{{{name}}} < {{{minimum}}}
+ return false
+ end
+
+ {{/minimum}}
+ {{#pattern}}
+ if @{{{name}}} !~ Regexp.new({{{pattern}}})
+ return false
+ end
+
+ {{/pattern}}
+ {{/hasValidation}}
+ {{/vars}}
+ end
+
+ {{#vars}}
+ {{#isEnum}}
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] {{{name}}} Object to be assigned
+ def {{{name}}}=({{{name}}})
+ allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
+ if {{{name}}} && !allowed_values.include?({{{name}}})
+ fail ArgumentError, "invalid value for '{{{name}}}', must be one of #{allowed_values}."
+ end
+ @{{{name}}} = {{{name}}}
+ end
+
+ {{/isEnum}}
+ {{^isEnum}}
+ {{#hasValidation}}
+ # Custom attribute writer method with validation
+ # @param [Object] {{{name}}} Value to be assigned
+ def {{{name}}}=({{{name}}})
+ if {{{name}}}.nil?
+ fail ArgumentError, "{{{name}}} cannot be nil"
+ end
+
+ {{#minLength}}
+ if {{{name}}}.to_s.length > {{{maxLength}}}
+ fail ArgumentError, "invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}."
+ end
+
+ {{/minLength}}
+ {{#maxLength}}
+ if {{{name}}}.to_s.length < {{{minLength}}}
+ fail ArgumentError, "invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}."
+ end
+
+ {{/maxLength}}
+ {{#maximum}}
+ if {{{name}}} > {{{maximum}}}
+ fail ArgumentError, "invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}."
+ end
+
+ {{/maximum}}
+ {{#minimum}}
+ if {{{name}}} < {{{minimum}}}
+ fail ArgumentError, "invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}."
+ end
+
+ {{/minimum}}
+ {{#pattern}}
+ if @{{{name}}} !~ Regexp.new({{{pattern}}})
+ fail ArgumentError, "invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}."
+ end
+
+ {{/pattern}}
+ @{{{name}}} = {{{name}}}
+ end
+
+ {{/hasValidation}}
+ {{/isEnum}}
+ {{/vars}}
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class{{#vars}} &&
+ {{name}} == o.{{name}}{{/vars}}
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Fixnum] Hash code
+ def hash
+ [{{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}].hash
+ end
+
+{{> base_object}}
+ end
diff --git a/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache b/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache
index bc4187c3378..8f4bb754165 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache
@@ -1,3 +1,7 @@
+=begin
+{{> api_info}}
+=end
+
# load the gem
require '{{{gemName}}}'
diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache
index 6345cd876c8..2600e71cffd 100644
--- a/modules/swagger-codegen/src/main/resources/scala/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache
@@ -36,7 +36,7 @@ class {{classname}}(val defBasePath: String = "{{basePath}}",
{{/pathParams}}
- val contentTypes = List({{#consumes}}"{{mediaType}}", {{/consumes}}"application/json")
+ val contentTypes = List({{#consumes}}"{{{mediaType}}}", {{/consumes}}"application/json")
val contentType = contentTypes(0)
// query params
diff --git a/modules/swagger-codegen/src/main/resources/slim/index.mustache b/modules/swagger-codegen/src/main/resources/slim/index.mustache
index 4fdd77681c3..383094821dd 100644
--- a/modules/swagger-codegen/src/main/resources/slim/index.mustache
+++ b/modules/swagger-codegen/src/main/resources/slim/index.mustache
@@ -13,7 +13,7 @@ $app = new Slim\App();
* {{httpMethod}} {{nickname}}
* Summary: {{summary}}
* Notes: {{notes}}
-{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
+{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
*/
$app->{{httpMethod}}('{{path}}', function($request, $response, $args) {
{{#hasHeaderParams}}$headers = $request->getHeaders();{{/hasHeaderParams}}
diff --git a/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache b/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache
index 85b227ece87..3af6910a094 100644
--- a/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache
+++ b/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache
@@ -15,6 +15,6 @@ Pod::Spec.new do |s|
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'{{#usePromiseKit}}
- s.dependency 'PromiseKit', '~> 3.0.0'{{/usePromiseKit}}
- s.dependency 'Alamofire', '~> 3.1.4'
+ s.dependency 'PromiseKit', '~> 3.1.1'{{/usePromiseKit}}
+ s.dependency 'Alamofire', '~> 3.1.5'
end
diff --git a/modules/swagger-codegen/src/main/resources/swift/api.mustache b/modules/swagger-codegen/src/main/resources/swift/api.mustache
index 8e3216052a0..298aa69e45e 100644
--- a/modules/swagger-codegen/src/main/resources/swift/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/swift/api.mustache
@@ -16,6 +16,18 @@ extension {{projectName}}API {
/** {{description}} */{{/description}}
public class {{classname}}: APIBase {
{{#operation}}
+ {{#allParams}}
+ {{#isEnum}}
+ /**
+
+ enum for parameter {{paramName}}
+ */
+ public enum {{{datatypeWithEnum}}}_{{operationId}}: String { {{#allowableValues}}{{#values}}
+ case {{enum}} = "{{raw}}"{{/values}}{{/allowableValues}}
+ }
+
+ {{/isEnum}}
+ {{/allParams}}
/**
{{#summary}}
{{{summary}}}
@@ -23,7 +35,7 @@ public class {{classname}}: APIBase {
- parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}
- parameter completion: completion handler to receive the data and the error objects
*/
- public class func {{operationId}}({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{{dataType}}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: (({{#returnType}}data: {{{returnType}}}?, {{/returnType}}error: ErrorType?) -> Void)) {
+ public class func {{operationId}}({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{{datatypeWithEnum}}}_{{operationId}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: (({{#returnType}}data: {{{returnType}}}?, {{/returnType}}error: ErrorType?) -> Void)) {
{{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute { (response, error) -> Void in
completion({{#returnType}}data: response?.body, {{/returnType}}error: error);
}
@@ -37,7 +49,7 @@ public class {{classname}}: APIBase {
- parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}
- returns: Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
*/
- public class func {{operationId}}({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{{dataType}}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {
+ public class func {{operationId}}({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{{datatypeWithEnum}}}_{{operationId}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {
let deferred = Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.pendingPromise()
{{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}data, {{/returnType}}error in
if let error = error {
@@ -69,16 +81,16 @@ public class {{classname}}: APIBase {
- returns: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}}
*/
- public class func {{operationId}}WithRequestBuilder({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{{dataType}}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {
+ public class func {{operationId}}WithRequestBuilder({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{{datatypeWithEnum}}}_{{operationId}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {
{{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{path}}"{{#pathParams}}
- path = path.stringByReplacingOccurrencesOfString("{{=<% %>=}}{<%paramName%>}<%={{ }}=%>", withString: "\({{paramName}})", options: .LiteralSearch, range: nil){{/pathParams}}
+ path = path.stringByReplacingOccurrencesOfString("{{=<% %>=}}{<%paramName%>}<%={{ }}=%>", withString: "\({{paramName}}{{#isEnum}}.rawValue{{/isEnum}})", options: .LiteralSearch, range: nil){{/pathParams}}
let URLString = {{projectName}}API.basePath + path
{{#bodyParam}}
let parameters = {{paramName}}{{^required}}?{{/required}}.encodeToJSON() as? [String:AnyObject]{{/bodyParam}}{{^bodyParam}}
let nillableParameters: [String:AnyObject?] = {{^queryParams}}{{^formParams}}[:]{{/formParams}}{{#formParams}}{{^secondaryParam}}[{{/secondaryParam}}
"{{baseName}}": {{paramName}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{#hasMore}},{{/hasMore}}{{^hasMore}}
]{{/hasMore}}{{/formParams}}{{/queryParams}}{{#queryParams}}{{^secondaryParam}}[{{/secondaryParam}}
- "{{baseName}}": {{paramName}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{#hasMore}},{{/hasMore}}{{^hasMore}}
+ "{{baseName}}": {{paramName}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{#isEnum}}{{^required}}?{{/required}}.rawValue{{/isEnum}}{{#hasMore}},{{/hasMore}}{{^hasMore}}
]{{/hasMore}}{{/queryParams}}
let parameters = APIHelper.rejectNil(nillableParameters){{/bodyParam}}
diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache
index efc6e00c633..817afd33f34 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache
@@ -35,7 +35,7 @@ export class {{classname}} {
const path = this.basePath + '{{path}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}};
- let queryParameters: any = ""; // This should probably be an object in the future
+ let queryParameters = new URLSearchParams();
let headerParams = this.defaultHeaders;
{{#hasFormParams}}
let formParams = new URLSearchParams();
@@ -51,7 +51,7 @@ export class {{classname}} {
{{/allParams}}
{{#queryParams}}
if ({{paramName}} !== undefined) {
- queryParameters['{{baseName}}'] = {{paramName}};
+ queryParameters.set('{{baseName}}', {{paramName}});
}
{{/queryParams}}
diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/apis.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/apis.mustache
index 05b5c6ec2ea..9a39b864538 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-angular2/apis.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/apis.mustache
@@ -1,9 +1,7 @@
{{#apiInfo}}
{{#apis}}
{{#operations}}
-export * from '../api/{{classname}}';
+export * from './{{ classname }}';
{{/operations}}
{{/apis}}
-{{/apiInfo}}
-
-
+{{/apiInfo}}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/model.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/model.mustache
index 4170b2d1594..e8ce6c3642b 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-angular2/model.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/model.mustache
@@ -9,6 +9,7 @@ import * as models from './models';
*/
{{/description}}
export interface {{classname}} {{#parent}}extends models.{{{parent}}} {{/parent}}{
+ {{#additionalPropertiesType}}[key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}};{{/additionalPropertiesType}}
{{#vars}}
{{#description}}
@@ -19,7 +20,6 @@ export interface {{classname}} {{#parent}}extends models.{{{parent}}} {{/parent}
{{name}}?: {{#isEnum}}{{classname}}.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}};
{{/vars}}
}
-
{{#hasEnums}}
export namespace {{classname}} {
{{#vars}}
@@ -33,4 +33,4 @@ export namespace {{classname}} {
}
{{/hasEnums}}
{{/model}}
-{{/models}}
+{{/models}}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/models.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/models.mustache
index 677b6b87328..ace053bd55b 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-angular2/models.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/models.mustache
@@ -3,6 +3,3 @@
export * from './{{{ classname }}}';
{{/model}}
{{/models}}
-
-
-
diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache
index 547200a6695..28a18bfb91b 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache
@@ -16,15 +16,8 @@
"build": "typings install && tsc"
},
"peerDependencies": {
- "@angular/common": "^2.0.0-rc.1",
- "@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
- "@angular/http": "^2.0.0-rc.1",
- "@angular/platform-browser": "^2.0.0-rc.1",
- "@angular/platform-browser-dynamic": "^2.0.0-rc.1",
- "core-js": "^2.3.0",
- "rxjs": "^5.0.0-beta.6",
- "zone.js": "^0.6.12"
+ "@angular/http": "^2.0.0-rc.1"
},
"devDependencies": {
"@angular/common": "^2.0.0-rc.1",
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 81163d686aa..2d1c16309bd 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache
@@ -1,7 +1,7 @@
import request = require('request');
import http = require('http');
{{^supportsES6}}
-import promise = require('bluebird');
+import Promise = require('bluebird');
{{/supportsES6}}
let defaultBasePath = '{{basePath}}';
@@ -111,6 +111,7 @@ export enum {{classname}}ApiKeys {
export class {{classname}} {
protected basePath = defaultBasePath;
protected defaultHeaders : any = {};
+ protected _useQuerystring : boolean = false;
protected authentications = {
'default': new VoidAuth(),
@@ -151,12 +152,15 @@ export class {{classname}} {
}
}
+ set useQuerystring(value: boolean) {
+ this._useQuerystring = value;
+ }
+
public setApiKey(key: {{classname}}ApiKeys, value: string) {
this.authentications[{{classname}}ApiKeys[key]].apiKey = value;
}
{{#authMethods}}
{{#isBasic}}
-
set username(username: string) {
this.authentications.{{name}}.username = username;
}
@@ -220,14 +224,12 @@ export class {{classname}} {
{{/isFile}}
{{/formParams}}
- {{^supportsES6}}
- let localVarDeferred = promise.defer<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>();
- {{/supportsES6}}
let requestOptions: request.Options = {
method: '{{httpMethod}}',
qs: queryParameters,
headers: headerParams,
uri: localVarPath,
+ useQuerystring: this._useQuerystring,
json: true,
{{#bodyParam}}
body: {{paramName}},
@@ -247,22 +249,7 @@ export class {{classname}} {
requestOptions.form = formParams;
}
}
- {{^supportsES6}}
- request(requestOptions, (error, response, body) => {
- if (error) {
- localVarDeferred.reject(error);
- } else {
- if (response.statusCode >= 200 && response.statusCode <= 299) {
- localVarDeferred.resolve({ response: response, body: body });
- } else {
- localVarDeferred.reject({ response: response, body: body });
- }
- }
- });
- return localVarDeferred.promise;
- {{/supportsES6}}
- {{#supportsES6}}
- return new Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>((resolve, reject) => {
+ return new Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>((resolve, reject) => {
request(requestOptions, (error, response, body) => {
if (error) {
reject(error);
@@ -275,7 +262,6 @@ export class {{classname}} {
}
});
});
- {{/supportsES6}}
}
{{/operation}}
}
diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache
index 96714500208..d7b5a8142a4 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache
@@ -2,12 +2,16 @@
"name": "{{npmName}}",
"version": "{{npmVersion}}",
"description": "NodeJS client for {{npmName}}",
+ "repository": "{{gitUserId}}/{{gitRepoId}}",
"main": "api.js",
"scripts": {
- "build": "typings install && tsc"
+ "postinstall": "typings install",
+ "clean": "rm -Rf node_modules/ typings/ *.js",
+ "build": "tsc",
+ "test": "npm run build && node client.js"
},
"author": "Swagger Codegen Contributors",
- "license": "MIT",
+ "license": "Apache-2.0",
"dependencies": {
"bluebird": "^3.3.5",
"request": "^2.72.0"
diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache
index 1a3bd00183a..e47082e11e9 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache
@@ -10,9 +10,10 @@
"noLib": false,
"declaration": true
},
- "files": [
- "api.ts",
- "typings/main.d.ts"
+ "exclude": [
+ "node_modules",
+ "typings/browser",
+ "typings/browser.d.ts"
]
}
diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache
index 76c4cc8e6af..22fcebdc231 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache
@@ -1,10 +1,10 @@
{
"ambientDependencies": {
- "bluebird": "registry:dt/bluebird#2.0.0+20160319051630",
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"node": "registry:dt/node#4.0.0+20160423143914"
},
"dependencies": {
+ "bluebird": "registry:npm/bluebird#3.3.4+20160515010139",
"request": "registry:npm/request#2.69.0+20160304121250"
}
}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/AbstractIntegrationTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/AbstractIntegrationTest.java
new file mode 100644
index 00000000000..8aaa127c6d8
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/AbstractIntegrationTest.java
@@ -0,0 +1,46 @@
+package io.swagger.codegen;
+
+import org.testng.annotations.Test;
+import org.testng.reporters.Files;
+
+import java.io.IOException;
+import java.util.Map;
+
+import io.swagger.codegen.testutils.IntegrationTestPathsConfig;
+import io.swagger.models.Swagger;
+import io.swagger.parser.SwaggerParser;
+
+import static io.swagger.codegen.testutils.AssertFile.assertPathEqualsRecursively;
+
+public abstract class AbstractIntegrationTest {
+
+ protected abstract IntegrationTestPathsConfig getIntegrationTestPathsConfig();
+
+ protected abstract CodegenConfig getCodegenConfig();
+
+ protected abstract Map configProperties();
+
+ // @wing328: ignore for the time being until we fix the error with the integration test
+ @Test(enabled = false)
+ public void generatesCorrectDirectoryStructure() throws IOException {
+ DefaultGenerator codeGen = new DefaultGenerator();
+ IntegrationTestPathsConfig integrationTestPathsConfig = getIntegrationTestPathsConfig();
+
+ String specContent = Files.readFile(integrationTestPathsConfig.getSpecPath().toFile());
+ Swagger swagger = new SwaggerParser().parse(specContent);
+
+ CodegenConfig codegenConfig = getCodegenConfig();
+ codegenConfig.setOutputDir(integrationTestPathsConfig.getOutputPath().toString());
+
+ ClientOpts clientOpts = new ClientOpts();
+ clientOpts.setProperties(configProperties());
+ ClientOptInput opts = new ClientOptInput()
+ .config(codegenConfig)
+ .opts(clientOpts)
+ .swagger(swagger);
+
+ codeGen.opts(opts).generate();
+
+ assertPathEqualsRecursively(integrationTestPathsConfig.getExpectedPath(), integrationTestPathsConfig.getOutputPath());
+ }
+}
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/CodegenIgnoreProcessorTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/CodegenIgnoreProcessorTest.java
new file mode 100644
index 00000000000..a9fe89214d5
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/CodegenIgnoreProcessorTest.java
@@ -0,0 +1,21 @@
+package io.swagger.codegen.ignore;
+
+import org.testng.annotations.Test;
+
+public class CodegenIgnoreProcessorTest {
+ @Test
+ public void loadCodegenRules() throws Exception {
+
+ }
+
+ @Test
+ public void getInclusionRules() throws Exception {
+
+ }
+
+ @Test
+ public void getExclusionRules() throws Exception {
+
+ }
+
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/FileRuleTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/FileRuleTest.java
new file mode 100644
index 00000000000..f093507d84c
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/FileRuleTest.java
@@ -0,0 +1,70 @@
+package io.swagger.codegen.ignore.rules;
+
+import org.testng.annotations.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.testng.Assert.*;
+
+public class FileRuleTest {
+ @Test
+ public void testMatchComplex() throws Exception {
+ // Arrange
+ final String definition = "path/to/**/complex/*.txt";
+ final String relativePath = "path/to/some/nested/complex/xyzzy.txt";
+
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "path"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.TEXT, "to"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.MATCH_ALL),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.TEXT, "complex"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, ".txt")
+ );
+
+ Rule rule = new FileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testNonMatchComplex() throws Exception {
+ // Arrange
+ final String definition = "path/to/**/complex/*.txt";
+ final String relativePath = "path/to/some/nested/invalid/xyzzy.txt";
+
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "path"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.TEXT, "to"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.MATCH_ALL),
+ new Part(IgnoreLineParser.Token.TEXT, "complex"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, ".txt")
+ );
+
+ Rule rule = new FileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertFalse(actual);
+ }
+
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/IgnoreLineParserTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/IgnoreLineParserTest.java
new file mode 100644
index 00000000000..17a96932d72
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/IgnoreLineParserTest.java
@@ -0,0 +1,158 @@
+package io.swagger.codegen.ignore.rules;
+
+import org.testng.annotations.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Queue;
+
+import static org.testng.Assert.*;
+
+public class IgnoreLineParserTest {
+ private IgnoreLineParser.Token verifyInputToSingleToken(final String input, IgnoreLineParser.Token token) throws ParserException {
+ // Act
+ List result = IgnoreLineParser.parse(input);
+
+ // Assert
+ assertNotNull(result);
+ assertEquals(result.size(), 1);
+ IgnoreLineParser.Token actual = result.get(0).getToken();
+ assertEquals(actual, token);
+
+ return actual;
+ }
+
+ @Test
+ public void parseMatchAll() throws Exception {
+ verifyInputToSingleToken("**", IgnoreLineParser.Token.MATCH_ALL);
+ }
+
+ @Test
+ public void parseMatchAny() throws Exception {
+ verifyInputToSingleToken("*", IgnoreLineParser.Token.MATCH_ANY);
+ }
+
+ @Test(expectedExceptions = ParserException.class,
+ expectedExceptionsMessageRegExp = "Negation with no negated pattern\\.")
+ public void parseNegate() throws Exception {
+ verifyInputToSingleToken("!", IgnoreLineParser.Token.NEGATE);
+
+ // Assert
+ fail("Expected simple pattern '!' to throw a ParserException.");
+ }
+
+ @Test
+ public void parseComment() throws Exception {
+ // Arrange
+ final String input = "# This is a comment";
+ Part actual = null;
+
+ // Act
+ List result = IgnoreLineParser.parse(input);
+
+ // Assert
+ assertEquals(result.size(), 1);
+ actual = result.get(0);
+ assertEquals(actual.getToken(), IgnoreLineParser.Token.COMMENT);
+ assertEquals(actual.getValue(), input);
+ }
+
+ @Test
+ public void parseEscapedExclamation() throws Exception {
+ final String input = "\\!";
+ verifyInputToSingleToken(input, IgnoreLineParser.Token.ESCAPED_EXCLAMATION);
+ }
+
+ @Test
+ public void parseEscapedSpace() throws Exception {
+ final String input = "\\ ";
+ verifyInputToSingleToken(input, IgnoreLineParser.Token.ESCAPED_SPACE);
+ }
+
+ @Test
+ public void parseDirectoryMarker() throws Exception {
+ // Arrange
+ final String input = "foo/";
+ Part actual = null;
+
+ // Act
+ List result = IgnoreLineParser.parse(input);
+
+ // Assert
+ assertEquals(result.size(), 2);
+ actual = result.get(0);
+ assertEquals(actual.getToken(), IgnoreLineParser.Token.TEXT);
+ assertEquals(actual.getValue(), "foo");
+ actual = result.get(1);
+ assertEquals(actual.getToken(), IgnoreLineParser.Token.DIRECTORY_MARKER);
+ }
+
+ @Test
+ public void parseRooted() throws Exception {
+ // Arrange
+ final String input = "/abcd";
+ Part actual = null;
+
+ // Act
+ List result = IgnoreLineParser.parse(input);
+
+ // Assert
+ assertEquals(result.size(), 2);
+ actual = result.get(0);
+ assertEquals(actual.getToken(), IgnoreLineParser.Token.ROOTED_MARKER);
+ actual = result.get(1);
+ assertEquals(actual.getToken(), IgnoreLineParser.Token.TEXT);
+ assertEquals(actual.getValue(), "abcd");
+ }
+
+ @Test
+ public void parseComplex() throws Exception {
+ // Arrange
+ final String input = "**/abcd/**/foo/bar/sample.txt";
+ Part current = null;
+
+ // Act
+ Queue result = new LinkedList<>(IgnoreLineParser.parse(input));
+
+ // Assert
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.MATCH_ALL);
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.PATH_DELIM);
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.TEXT);
+ assertEquals(current.getValue(), "abcd");
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.PATH_DELIM);
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.MATCH_ALL);
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.PATH_DELIM);
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.TEXT);
+ assertEquals(current.getValue(), "foo");
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.PATH_DELIM);
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.TEXT);
+ assertEquals(current.getValue(), "bar");
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.PATH_DELIM);
+ current = result.remove();
+ assertEquals(current.getToken(), IgnoreLineParser.Token.TEXT);
+ assertEquals(current.getValue(), "sample.txt");
+ }
+
+ @Test(expectedExceptions = ParserException.class,
+ expectedExceptionsMessageRegExp = "The pattern \\*\\*\\* is invalid\\.")
+ public void parseTripleStarPattern() throws Exception {
+ // Arrange
+ final String input = "should/throw/***/anywhere";
+
+ // Act
+ List result = IgnoreLineParser.parse(input);
+
+ // Assert
+ fail("Expected pattern containing '***' to throw a ParserException.");
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/RootedFileRuleTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/RootedFileRuleTest.java
new file mode 100644
index 00000000000..471422fcc03
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/rules/RootedFileRuleTest.java
@@ -0,0 +1,285 @@
+package io.swagger.codegen.ignore.rules;
+
+import org.testng.annotations.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.testng.Assert.*;
+
+public class RootedFileRuleTest {
+ @Test
+ public void testMatchFilenameOnly() throws Exception {
+ // Arrange
+ final String definition = "/foo";
+ final String relativePath = "foo";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testNonMatchFilenameOnly() throws Exception {
+ // Arrange
+ final String definition = "/foo";
+ final String relativePath = "bar";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertFalse(actual);
+ }
+
+ @Test
+ public void testMatchFilenameAndExtension() throws Exception {
+ // Arrange
+ final String definition = "/foo.txt";
+ final String relativePath = "foo.txt";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo.txt")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testNonMatchFilenameAndExtension() throws Exception {
+ // Arrange
+ final String definition = "/foo.txt";
+ final String relativePath = "bar.baz";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo.txt")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertFalse(actual);
+ }
+
+ @Test
+ public void testMatchFilenameWithGlob() throws Exception {
+ // Arrange
+ final String definition = "/foo*";
+ final String relativePath = "foobarbaz";
+
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY)
+ );
+
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testNonMatchFilenameWithGlob() throws Exception {
+ // Arrange
+ final String definition = "/foo*";
+ final String relativePath = "boobarbaz";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY)
+ );
+
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertFalse(actual);
+ }
+
+ @Test
+ public void testMatchFilenameAndExtensionWithFilenameGlob() throws Exception {
+ // Arrange
+ final String definition = "/foo*.txt";
+ final String relativePath = "foobarbaz.txt";
+
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, ".txt")
+ );
+
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testNonMatchFilenameAndExtensionWithFilenameGlob() throws Exception {
+ // Arrange
+ final String definition = "/foo*qux.txt";
+ final String relativePath = "foobarbaz.txt";
+
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, "qux.txt")
+ );
+
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertFalse(actual);
+ }
+
+ @Test
+ public void testMatchFilenameAndExtensionWithExtensionGlob() throws Exception {
+ // Arrange
+ final String definition = "/foo.*";
+ final String relativePath = "foo.bak";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo."),
+ new Part(IgnoreLineParser.Token.MATCH_ANY)
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testMatchFilenameAndExtensionWithMultiplePeriods() throws Exception {
+ // Arrange
+ final String definition = "/foo*.xyzzy.txt";
+ final String relativePath = "foo.bar.baz.xyzzy.txt";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, ".xyzzy.txt")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testNonMatchFilenameAndExtensionWithMultiplePeriods() throws Exception {
+ // Arrange
+ final String definition = "/foo*.xyzzy.txt";
+ final String relativePath = "foo.bar.baz.qux.txt";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, ".xyzzy.txt")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertFalse(actual);
+ }
+
+ @Test
+ public void testMatchWithoutLeadingForwardSlash() throws Exception {
+ // Arrange
+ final String definition = "foo*.xyzzy.txt";
+ final String relativePath = "foo.bar.baz.xyzzy.txt";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "foo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, ".xyzzy.txt")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertTrue(actual);
+ }
+
+ @Test
+ public void testMatchesOnlyRooted() throws Exception {
+ // Arrange
+ final String definition = "/path/to/some/foo*.xyzzy.txt";
+ final String relativePath = "foo.bar.baz.xyzzy.txt";
+ final List syntax = Arrays.asList(
+ new Part(IgnoreLineParser.Token.ROOTED_MARKER),
+ new Part(IgnoreLineParser.Token.TEXT, "path"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.TEXT, "to"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.TEXT, "some"),
+ new Part(IgnoreLineParser.Token.PATH_DELIM),
+ new Part(IgnoreLineParser.Token.TEXT, "oo"),
+ new Part(IgnoreLineParser.Token.MATCH_ANY),
+ new Part(IgnoreLineParser.Token.TEXT, ".xyzzy.txt")
+ );
+ Rule rule = new RootedFileRule(syntax, definition);
+ Boolean actual = null;
+
+ // Act
+ actual = rule.matches(relativePath);
+
+ // Assert
+ assertFalse(actual);
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/testutils/AssertFile.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/testutils/AssertFile.java
new file mode 100644
index 00000000000..f810e20eb0a
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/testutils/AssertFile.java
@@ -0,0 +1,132 @@
+package io.swagger.codegen.testutils;
+
+import org.testng.Assert;
+
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.file.FileVisitResult;
+import java.nio.file.FileVisitor;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.List;
+
+import difflib.Delta;
+import difflib.DiffUtils;
+import difflib.Patch;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+
+/**
+ * Assertion for recursively testing directories.
+ *
+ * @author andreas
+ */
+public class AssertFile {
+
+ private AssertFile() {
+ throw new RuntimeException("This class should not be instantiated");
+ }
+
+ /**
+ * Asserts that two directories are recursively equal. If they are not, an {@link AssertionError} is thrown with the
+ * given message.
+ * There will be a textual comparison of all files under expected with all files under actual. File attributes will
+ * not be considered.
+ * Missing or additional files are considered an error.
+ *
+ * @param expected Path expected directory
+ * @param actual Path actual directory
+ */
+ public static void assertPathEqualsRecursively(final Path expected, final Path actual) {
+ Assert.assertNotNull(expected);
+ Assert.assertNotNull(actual);
+ final Path absoluteExpected = expected.toAbsolutePath();
+ final Path absoluteActual = actual.toAbsolutePath();
+ try {
+ Files.walkFileTree(expected, new FileVisitor() {
+
+ @Override
+ public FileVisitResult preVisitDirectory(Path expectedDir, BasicFileAttributes attrs) throws IOException {
+ Path relativeExpectedDir = absoluteExpected.relativize(expectedDir.toAbsolutePath());
+ Path actualDir = absoluteActual.resolve(relativeExpectedDir);
+
+ if (!Files.exists(actualDir)) {
+ fail(String.format("Directory '%s' is missing.", actualDir));
+ }
+
+ assertEquals(expectedDir.toFile().list(),
+ actualDir.toFile().list(),
+ String.format("Directory content of '%s' and '%s' differ.", expectedDir, actualDir));
+
+ return FileVisitResult.CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult visitFile(Path expectedFile, BasicFileAttributes attrs) throws IOException {
+ Path relativeExpectedFile = absoluteExpected.relativize(expectedFile.toAbsolutePath());
+ Path actualFile = absoluteActual.resolve(relativeExpectedFile);
+
+ if (!Files.exists(actualFile)) {
+ fail(String.format("File '%s' is missing.", actualFile));
+ }
+
+ assertFilesAreEqual(expectedFile, actualFile);
+
+ return FileVisitResult.CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
+ fail(exc.getMessage());
+ return FileVisitResult.TERMINATE;
+ }
+
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
+ return FileVisitResult.CONTINUE;
+ }
+
+ });
+ } catch (IOException e) {
+ fail(e.getMessage(), e);
+ }
+ }
+
+
+ public static void assertFilesAreEqual(final Path expected, final Path actual) {
+
+ if(!Files.isRegularFile(expected)) {
+ fail("expected: '%s' is not a readable file");
+ }
+
+ if(!Files.isRegularFile(actual)) {
+ fail("actual: '%s' is not a readable file");
+ }
+
+ try {
+ List expectedLines = Files.readAllLines(expected, Charset.defaultCharset());
+ List actualLines = Files.readAllLines(actual, Charset.defaultCharset());
+ Patch diff = DiffUtils.diff(expectedLines, actualLines);
+ List deltas = diff.getDeltas();
+ if(!deltas.isEmpty()) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("files diff:\n");
+ stringBuilder.append("\tfile: '" + expected.toAbsolutePath().toString() + "' \n");
+ stringBuilder.append("\tfile: '" + actual.toAbsolutePath().toString() + "' \n");
+ stringBuilder.append("\tdiffs:\n");
+
+ for (Delta delta: deltas) {
+ stringBuilder.append(delta.toString() + "\n");
+ }
+
+ fail(stringBuilder.toString());
+ }
+
+ } catch (IOException e) {
+ fail(e.getMessage(), e);
+ }
+ }
+}
+
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/testutils/IntegrationTestPathsConfig.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/testutils/IntegrationTestPathsConfig.java
new file mode 100644
index 00000000000..4335c69dd2d
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/testutils/IntegrationTestPathsConfig.java
@@ -0,0 +1,33 @@
+package io.swagger.codegen.testutils;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class IntegrationTestPathsConfig {
+ private static final Path INTEGRATION_TEST_PATH = Paths.get("target/test-classes/integrationtests").toAbsolutePath();
+ private final Path outputPath;
+ private final Path specPath;
+ private final Path expectedPath;
+
+ public IntegrationTestPathsConfig(String location) {
+ this(location + "-spec.json", location + "-result", location + "-expected");
+ }
+
+ public IntegrationTestPathsConfig(String specLocation, String outputLocation, String expectedLocation) {
+ outputPath = INTEGRATION_TEST_PATH.resolve(outputLocation);
+ expectedPath = INTEGRATION_TEST_PATH.resolve(expectedLocation);
+ specPath = INTEGRATION_TEST_PATH.resolve(specLocation);
+ }
+
+ public Path getOutputPath() {
+ return outputPath;
+ }
+
+ public Path getSpecPath() {
+ return specPath;
+ }
+
+ public Path getExpectedPath() {
+ return expectedPath;
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptfetch/TypeScriptFetchClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java
similarity index 96%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptfetch/TypeScriptFetchClientOptionsTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java
index 09f16799ad9..c2744cc8258 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptfetch/TypeScriptFetchClientOptionsTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java
@@ -1,4 +1,4 @@
-package io.swagger.codegen.typescriptfetch;
+package io.swagger.codegen.typescript.fetch;
import io.swagger.codegen.AbstractOptionsTest;
import io.swagger.codegen.CodegenConfig;
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptfetch/TypeScriptFetchModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/fetch/TypeScriptFetchModelTest.java
similarity index 96%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptfetch/TypeScriptFetchModelTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/fetch/TypeScriptFetchModelTest.java
index d2173fdb710..d1b0a4be233 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptfetch/TypeScriptFetchModelTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/fetch/TypeScriptFetchModelTest.java
@@ -1,6 +1,10 @@
-package io.swagger.codegen.typescriptfetch;
+package io.swagger.codegen.typescript.fetch;
import com.google.common.collect.Sets;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.DefaultCodegen;
@@ -8,9 +12,11 @@
import io.swagger.models.ArrayModel;
import io.swagger.models.Model;
import io.swagger.models.ModelImpl;
-import io.swagger.models.properties.*;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import io.swagger.models.properties.ArrayProperty;
+import io.swagger.models.properties.DateTimeProperty;
+import io.swagger.models.properties.LongProperty;
+import io.swagger.models.properties.RefProperty;
+import io.swagger.models.properties.StringProperty;
@SuppressWarnings("static-method")
public class TypeScriptFetchModelTest {
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular/TypeScriptAngularClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java
similarity index 95%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular/TypeScriptAngularClientOptionsTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java
index 70cfb3d250d..2a68ab37110 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular/TypeScriptAngularClientOptionsTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java
@@ -1,4 +1,4 @@
-package io.swagger.codegen.typescriptangular;
+package io.swagger.codegen.typescript.typescriptangular;
import io.swagger.codegen.AbstractOptionsTest;
import io.swagger.codegen.CodegenConfig;
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular/TypeScriptAngularModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java
similarity index 99%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular/TypeScriptAngularModelTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java
index 26e8f841be9..75ab210966d 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular/TypeScriptAngularModelTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java
@@ -1,4 +1,4 @@
-package io.swagger.codegen.typescriptangular;
+package io.swagger.codegen.typescript.typescriptangular;
import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenProperty;
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular2/TypeScriptAngular2ClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ClientOptionsTest.java
similarity index 95%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular2/TypeScriptAngular2ClientOptionsTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ClientOptionsTest.java
index 74e575c4496..73ace65a207 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular2/TypeScriptAngular2ClientOptionsTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ClientOptionsTest.java
@@ -1,4 +1,4 @@
-package io.swagger.codegen.typescriptangular2;
+package io.swagger.codegen.typescript.typescriptangular2;
import io.swagger.codegen.AbstractOptionsTest;
import io.swagger.codegen.CodegenConfig;
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular2/TypeScriptAngular2ModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ModelTest.java
similarity index 98%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular2/TypeScriptAngular2ModelTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ModelTest.java
index 3aa33df7da4..685495f03c2 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptangular2/TypeScriptAngular2ModelTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ModelTest.java
@@ -1,4 +1,4 @@
-package io.swagger.codegen.typescriptangular2;
+package io.swagger.codegen.typescript.typescriptangular2;
import com.google.common.collect.Sets;
@@ -178,6 +178,7 @@ public void mapModelTest() {
Assert.assertEquals(cm.description, "a map model");
Assert.assertEquals(cm.vars.size(), 0);
Assert.assertEquals(cm.imports.size(), 1);
+ Assert.assertEquals(cm.additionalPropertiesType, "models.Children");
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("models.Children")).size(), 1);
}
}
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2AdditionalPropertiesIntegrationTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2AdditionalPropertiesIntegrationTest.java
new file mode 100644
index 00000000000..8b23105f28c
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2AdditionalPropertiesIntegrationTest.java
@@ -0,0 +1,32 @@
+package io.swagger.codegen.typescript.typescriptangular2;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import io.swagger.codegen.AbstractIntegrationTest;
+import io.swagger.codegen.CodegenConfig;
+import io.swagger.codegen.languages.TypeScriptAngular2ClientCodegen;
+import io.swagger.codegen.testutils.IntegrationTestPathsConfig;
+
+public class TypescriptAngular2AdditionalPropertiesIntegrationTest extends AbstractIntegrationTest {
+
+ @Override
+ protected CodegenConfig getCodegenConfig() {
+ return new TypeScriptAngular2ClientCodegen();
+ }
+
+ @Override
+ protected Map configProperties() {
+ Map propeties = new HashMap<>();
+ propeties.put("npmName", "additionalPropertiesTest");
+ propeties.put("npmVersion", "1.0.2");
+ propeties.put("snapshot", "false");
+
+ return propeties;
+ }
+
+ @Override
+ protected IntegrationTestPathsConfig getIntegrationTestPathsConfig() {
+ return new IntegrationTestPathsConfig("typescript/additional-properties");
+ }
+}
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2ArrayAndObjectTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2ArrayAndObjectTest.java
new file mode 100644
index 00000000000..b9a8868a6b8
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2ArrayAndObjectTest.java
@@ -0,0 +1,32 @@
+package io.swagger.codegen.typescript.typescriptangular2;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import io.swagger.codegen.AbstractIntegrationTest;
+import io.swagger.codegen.CodegenConfig;
+import io.swagger.codegen.languages.TypeScriptAngular2ClientCodegen;
+import io.swagger.codegen.testutils.IntegrationTestPathsConfig;
+
+public class TypescriptAngular2ArrayAndObjectTest extends AbstractIntegrationTest {
+
+ @Override
+ protected CodegenConfig getCodegenConfig() {
+ return new TypeScriptAngular2ClientCodegen();
+ }
+
+ @Override
+ protected Map configProperties() {
+ Map propeties = new HashMap<>();
+ propeties.put("npmName", "arrayAndAnyTest");
+ propeties.put("npmVersion", "1.0.2");
+ propeties.put("snapshot", "false");
+
+ return propeties;
+ }
+
+ @Override
+ protected IntegrationTestPathsConfig getIntegrationTestPathsConfig() {
+ return new IntegrationTestPathsConfig("typescript/array-and-object");
+ }
+}
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptnode/TypeScriptNodeClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java
similarity index 95%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptnode/TypeScriptNodeClientOptionsTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java
index 72b55b0b39d..4872e1d419d 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptnode/TypeScriptNodeClientOptionsTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java
@@ -1,4 +1,4 @@
-package io.swagger.codegen.typescriptnode;
+package io.swagger.codegen.typescript.typescriptnode;
import io.swagger.codegen.AbstractOptionsTest;
import io.swagger.codegen.CodegenConfig;
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptnode/TypeScriptNodeModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java
similarity index 99%
rename from modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptnode/TypeScriptNodeModelTest.java
rename to modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java
index 81a67e87b87..37e4fb688e0 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescriptnode/TypeScriptNodeModelTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java
@@ -1,4 +1,4 @@
-package io.swagger.codegen.typescriptnode;
+package io.swagger.codegen.typescript.typescriptnode;
import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenProperty;
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypescriptNodeES5IntegrationTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypescriptNodeES5IntegrationTest.java
new file mode 100644
index 00000000000..22bac4ea316
--- /dev/null
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptnode/TypescriptNodeES5IntegrationTest.java
@@ -0,0 +1,33 @@
+package io.swagger.codegen.typescript.typescriptnode;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import io.swagger.codegen.AbstractIntegrationTest;
+import io.swagger.codegen.CodegenConfig;
+import io.swagger.codegen.languages.TypeScriptNodeClientCodegen;
+import io.swagger.codegen.testutils.IntegrationTestPathsConfig;
+
+public class TypescriptNodeES5IntegrationTest extends AbstractIntegrationTest {
+
+ @Override
+ protected CodegenConfig getCodegenConfig() {
+ return new TypeScriptNodeClientCodegen();
+ }
+
+ @Override
+ protected Map configProperties() {
+ Map propeties = new HashMap<>();
+ propeties.put("npmName", "node-es6-test");
+ propeties.put("npmVersion", "1.0.3");
+ propeties.put("snapshot", "false");
+ propeties.put("supportsES6", "false");
+
+ return propeties;
+ }
+
+ @Override
+ protected IntegrationTestPathsConfig getIntegrationTestPathsConfig() {
+ return new IntegrationTestPathsConfig("typescript/node-es5");
+ }
+}
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 b9fa750d38a..cb710b32566 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
@@ -575,9 +575,12 @@ paths:
偽のエンドポイント
가짜 엔드 포인트
operationId: testEndpointParameters
+ consumes:
+ - application/xml; charset=utf-8
+ - application/json; charset=utf-8
produces:
- - application/xml
- - application/json
+ - application/xml; charset=utf-8
+ - application/json; charset=utf-8
parameters:
- name: integer
type: integer
@@ -944,6 +947,30 @@ definitions:
enum:
- 1.1
- -1.2
+ AdditionalPropertiesClass:
+ type: object
+ additionalProperties:
+ type: string
+ MixedPropertiesAndAdditionalPropertiesClass:
+ type: object
+ properties:
+ uuid:
+ type: string
+ format: uuid
+ dateTime:
+ type: string
+ format: date-time
+ additionalProperties:
+ type: string
+ $ref: '#/definitions/Animal'
+ ReadOnlyFirst:
+ type: object
+ properties:
+ bar:
+ type: string
+ readOnly: true
+ baz:
+ type: string
externalDocs:
description: Find out more about Swagger
url: 'http://swagger.io'
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/.swagger-codegen-ignore b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/.swagger-codegen-ignore
new file mode 100644
index 00000000000..19d3377182e
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/README.md b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/README.md
new file mode 100644
index 00000000000..b5338574869
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/README.md
@@ -0,0 +1,33 @@
+## additionalPropertiesTest@1.0.2
+
+### Building
+
+To build an compile the typescript sources to javascript use:
+```
+npm install
+npm run build
+```
+
+### publishing
+
+First build the package than run ```npm publish```
+
+### consuming
+
+navigate to the folder of your consuming project and run one of next commando's.
+
+_published:_
+
+```
+npm install additionalPropertiesTest@1.0.2 --save
+```
+
+_unPublished (not recommended):_
+
+```
+npm install PATH_TO_GENERATED_PACKAGE --save
+```
+
+In your angular2 project:
+
+TODO: paste example.
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/UserApi.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/UserApi.ts
new file mode 100644
index 00000000000..77b6c013a8b
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/UserApi.ts
@@ -0,0 +1,64 @@
+import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
+import {Injectable, Optional} from '@angular/core';
+import {Observable} from 'rxjs/Observable';
+import * as models from '../model/models';
+import 'rxjs/Rx';
+
+/* tslint:disable:no-unused-variable member-ordering */
+
+'use strict';
+
+@Injectable()
+export class UserApi {
+ protected basePath = 'http://additional-properties.swagger.io/v2';
+ public defaultHeaders : Headers = new Headers();
+
+ constructor(protected http: Http, @Optional() basePath: string) {
+ if (basePath) {
+ this.basePath = basePath;
+ }
+ }
+
+ /**
+ * Add a new User to the store
+ *
+ * @param body User object that needs to be added to the store
+ */
+ public addUser (body?: models.User, extraHttpRequestParams?: any ) : Observable<{}> {
+ const path = this.basePath + '/user';
+
+ let queryParameters: any = ""; // This should probably be an object in the future
+ let headerParams = this.defaultHeaders;
+ let requestOptions: RequestOptionsArgs = {
+ method: 'POST',
+ headers: headerParams,
+ search: queryParameters
+ };
+ requestOptions.body = JSON.stringify(body);
+
+ return this.http.request(path, requestOptions)
+ .map((response: Response) => response.json());
+ }
+
+ /**
+ * Update an existing User
+ *
+ * @param body User object that needs to be added to the store
+ */
+ public updateUser (body?: models.User, extraHttpRequestParams?: any ) : Observable<{}> {
+ const path = this.basePath + '/user';
+
+ let queryParameters: any = ""; // This should probably be an object in the future
+ let headerParams = this.defaultHeaders;
+ let requestOptions: RequestOptionsArgs = {
+ method: 'PUT',
+ headers: headerParams,
+ search: queryParameters
+ };
+ requestOptions.body = JSON.stringify(body);
+
+ return this.http.request(path, requestOptions)
+ .map((response: Response) => response.json());
+ }
+
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/api.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/api.ts
new file mode 100644
index 00000000000..d3bd8432806
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/api.ts
@@ -0,0 +1 @@
+export * from './UserApi';
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/index.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/index.ts
new file mode 100644
index 00000000000..cdfea183ad3
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/index.ts
@@ -0,0 +1,2 @@
+export * from './api/api';
+export * from './model/models';
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/model/User.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/model/User.ts
new file mode 100644
index 00000000000..66f270cea01
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/model/User.ts
@@ -0,0 +1,13 @@
+'use strict';
+import * as models from './models';
+
+export interface User {
+ [key: string]: string | any;
+
+ id?: number;
+
+ /**
+ * User Status
+ */
+ userStatus?: number;
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/model/models.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/model/models.ts
new file mode 100644
index 00000000000..f6b9f36c6e1
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/model/models.ts
@@ -0,0 +1 @@
+export * from './User';
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json
new file mode 100644
index 00000000000..36ec153321d
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "additionalPropertiesTest",
+ "version": "1.0.2",
+ "description": "swagger client for additionalPropertiesTest",
+ "author": "Swagger Codegen Contributors",
+ "keywords": [
+ "swagger-client"
+ ],
+ "license": "MIT",
+ "files": [
+ "lib"
+ ],
+ "main": "./lib/index.js",
+ "typings": "./lib/index.d.ts",
+ "scripts": {
+ "build": "typings install && tsc"
+ },
+ "peerDependencies": {
+ "@angular/core": "^2.0.0-rc.1",
+ "@angular/http": "^2.0.0-rc.1"
+ },
+ "devDependencies": {
+ "@angular/common": "^2.0.0-rc.1",
+ "@angular/compiler": "^2.0.0-rc.1",
+ "@angular/core": "^2.0.0-rc.1",
+ "@angular/http": "^2.0.0-rc.1",
+ "@angular/platform-browser": "^2.0.0-rc.1",
+ "@angular/platform-browser-dynamic": "^2.0.0-rc.1",
+ "core-js": "^2.3.0",
+ "rxjs": "^5.0.0-beta.6",
+ "zone.js": "^0.6.12",
+ "typescript": "^1.8.10",
+ "typings": "^0.8.1",
+ "es6-shim": "^0.35.0",
+ "es7-reflect-metadata": "^1.6.0"
+ }}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/tsconfig.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/tsconfig.json
new file mode 100644
index 00000000000..07fbdf7e1b1
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "emitDecoratorMetadata": true,
+ "experimentalDecorators": true,
+ "noImplicitAny": false,
+ "suppressImplicitAnyIndexErrors": true,
+ "target": "es5",
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "removeComments": true,
+ "sourceMap": true,
+ "outDir": "./lib",
+ "noLib": false,
+ "declaration": true
+ },
+ "exclude": [
+ "node_modules",
+ "typings/main.d.ts",
+ "typings/main",
+ "lib"
+ ],
+ "filesGlob": [
+ "./model/*.ts",
+ "./api/*.ts",
+ "typings/browser.d.ts"
+ ]
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/typings.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/typings.json
new file mode 100644
index 00000000000..0848dcffe31
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/typings.json
@@ -0,0 +1,5 @@
+{
+ "ambientDependencies": {
+ "core-js": "registry:dt/core-js#0.0.0+20160317120654"
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-spec.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-spec.json
new file mode 100644
index 00000000000..3a06b88986c
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-spec.json
@@ -0,0 +1,110 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "description": "This is a test spec",
+ "version": "1.0.0",
+ "title": "Swagger Additional Properties",
+ "termsOfService": "http://swagger.io/terms/",
+ "contact": {
+ "email": "apiteam@swagger.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "host": "additional-properties.swagger.io",
+ "basePath": "/v2",
+ "schemes": [
+ "http"
+ ],
+ "paths": {
+ "/user": {
+ "post": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Add a new User to the store",
+ "description": "",
+ "operationId": "addUser",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "User object that needs to be added to the store",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/User"
+ }
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Invalid input"
+ }
+ }
+ },
+ "put": {
+ "tags": [
+ "user"
+ ],
+ "summary": "Update an existing User",
+ "description": "",
+ "operationId": "updateUser",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "User object that needs to be added to the store",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/User"
+ }
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Validation exception"
+ },
+ "404": {
+ "description": "User not found"
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "User": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "userStatus": {
+ "type": "integer",
+ "format": "int32",
+ "description": "User Status"
+ }
+ },
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/.swagger-codegen-ignore b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/.swagger-codegen-ignore
new file mode 100644
index 00000000000..19d3377182e
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/README.md b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/README.md
new file mode 100644
index 00000000000..85e98e0f9d9
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/README.md
@@ -0,0 +1,33 @@
+## arrayAndAnyTest@1.0.2
+
+### Building
+
+To build an compile the typescript sources to javascript use:
+```
+npm install
+npm run build
+```
+
+### publishing
+
+First build the package than run ```npm publish```
+
+### consuming
+
+navigate to the folder of your consuming project and run one of next commando's.
+
+_published:_
+
+```
+npm install arrayAndAnyTest@1.0.2 --save
+```
+
+_unPublished (not recommended):_
+
+```
+npm install PATH_TO_GENERATED_PACKAGE --save
+```
+
+In your angular2 project:
+
+TODO: paste example.
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/ProjectApi.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/ProjectApi.ts
new file mode 100644
index 00000000000..dbcdbe5fb7a
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/ProjectApi.ts
@@ -0,0 +1,218 @@
+import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
+import {Injectable, Optional} from '@angular/core';
+import {Observable} from 'rxjs/Observable';
+import * as models from '../model/models';
+import 'rxjs/Rx';
+
+/* tslint:disable:no-unused-variable member-ordering */
+
+'use strict';
+
+@Injectable()
+export class ProjectApi {
+ protected basePath = 'https://localhost/v1';
+ public defaultHeaders : Headers = new Headers();
+
+ constructor(protected http: Http, @Optional() basePath: string) {
+ if (basePath) {
+ this.basePath = basePath;
+ }
+ }
+
+ /**
+ * Create a Project
+ * Creates an empty Project
+ * @param name
+ * @param address
+ * @param longitude
+ * @param latitude
+ * @param meta
+ */
+ public createProject (name?: string, address?: string, longitude?: number, latitude?: number, meta?: string, extraHttpRequestParams?: any ) : Observable {
+ const path = this.basePath + '/projects';
+
+ let queryParameters: any = ""; // This should probably be an object in the future
+ let headerParams = this.defaultHeaders;
+ let formParams = new URLSearchParams();
+
+ headerParams.set('Content-Type', 'application/x-www-form-urlencoded');
+
+ formParams['name'] = name;
+
+ formParams['address'] = address;
+
+ formParams['longitude'] = longitude;
+
+ formParams['latitude'] = latitude;
+
+ formParams['meta'] = meta;
+
+ let requestOptions: RequestOptionsArgs = {
+ method: 'POST',
+ headers: headerParams,
+ search: queryParameters
+ };
+ requestOptions.body = formParams.toString();
+
+ return this.http.request(path, requestOptions)
+ .map((response: Response) => response.json());
+ }
+
+ /**
+ * Delete a Project
+ * Returns a Project JSON object
+ * @param id Project id
+ */
+ public deleteProjectById (id: number, extraHttpRequestParams?: any ) : Observable<{}> {
+ const path = this.basePath + '/projects/{id}'
+ .replace('{' + 'id' + '}', String(id));
+
+ let queryParameters: any = ""; // This should probably be an object in the future
+ let headerParams = this.defaultHeaders;
+ // verify required parameter 'id' is set
+ if (!id) {
+ throw new Error('Missing required parameter id when calling deleteProjectById');
+ }
+ let requestOptions: RequestOptionsArgs = {
+ method: 'DELETE',
+ headers: headerParams,
+ search: queryParameters
+ };
+
+ return this.http.request(path, requestOptions)
+ .map((response: Response) => response.json());
+ }
+
+ /**
+ * Get a Project
+ * Returns a Project JSON object
+ * @param id Project id
+ */
+ public getProjectById (id: number, extraHttpRequestParams?: any ) : Observable {
+ const path = this.basePath + '/projects/{id}'
+ .replace('{' + 'id' + '}', String(id));
+
+ let queryParameters: any = ""; // This should probably be an object in the future
+ let headerParams = this.defaultHeaders;
+ // verify required parameter 'id' is set
+ if (!id) {
+ throw new Error('Missing required parameter id when calling getProjectById');
+ }
+ let requestOptions: RequestOptionsArgs = {
+ method: 'GET',
+ headers: headerParams,
+ search: queryParameters
+ };
+
+ return this.http.request(path, requestOptions)
+ .map((response: Response) => response.json());
+ }
+
+ /**
+ * Get project list
+ * Returns a Project JSON object
+ * @param page
+ * @param perPage
+ * @param kind
+ * @param q
+ * @param filter
+ * @param latitude Valid with kind as location
+ * @param longitude Valid with kind as location
+ * @param scope Valid with kind as location, and between 1~9
+ */
+ public getProjectList (page?: number, perPage?: number, kind?: string, q?: string, filter?: string, latitude?: number, longitude?: number, scope?: number, extraHttpRequestParams?: any ) : Observable {
+ const path = this.basePath + '/projects';
+
+ let queryParameters: any = ""; // This should probably be an object in the future
+ let headerParams = this.defaultHeaders;
+ if (page !== undefined) {
+ queryParameters['page'] = page;
+ }
+
+ if (perPage !== undefined) {
+ queryParameters['per_page'] = perPage;
+ }
+
+ if (kind !== undefined) {
+ queryParameters['kind'] = kind;
+ }
+
+ if (q !== undefined) {
+ queryParameters['q'] = q;
+ }
+
+ if (filter !== undefined) {
+ queryParameters['filter'] = filter;
+ }
+
+ if (latitude !== undefined) {
+ queryParameters['latitude'] = latitude;
+ }
+
+ if (longitude !== undefined) {
+ queryParameters['longitude'] = longitude;
+ }
+
+ if (scope !== undefined) {
+ queryParameters['scope'] = scope;
+ }
+
+ let requestOptions: RequestOptionsArgs = {
+ method: 'GET',
+ headers: headerParams,
+ search: queryParameters
+ };
+
+ return this.http.request(path, requestOptions)
+ .map((response: Response) => response.json());
+ }
+
+ /**
+ * Update project
+ *
+ * @param id Project id
+ * @param name User ID
+ * @param address Address
+ * @param longitude
+ * @param latitude
+ * @param meta
+ * @param thumbnail Project thumbnail
+ */
+ public updateProject (id: number, name?: string, address?: string, longitude?: number, latitude?: number, meta?: string, thumbnail?: any, extraHttpRequestParams?: any ) : Observable {
+ const path = this.basePath + '/projects/{id}'
+ .replace('{' + 'id' + '}', String(id));
+
+ let queryParameters: any = ""; // This should probably be an object in the future
+ let headerParams = this.defaultHeaders;
+ let formParams = new URLSearchParams();
+
+ // verify required parameter 'id' is set
+ if (!id) {
+ throw new Error('Missing required parameter id when calling updateProject');
+ }
+ headerParams.set('Content-Type', 'application/x-www-form-urlencoded');
+
+ formParams['name'] = name;
+
+ formParams['address'] = address;
+
+ formParams['longitude'] = longitude;
+
+ formParams['latitude'] = latitude;
+
+ formParams['meta'] = meta;
+
+ formParams['thumbnail'] = thumbnail;
+
+ let requestOptions: RequestOptionsArgs = {
+ method: 'PUT',
+ headers: headerParams,
+ search: queryParameters
+ };
+ requestOptions.body = formParams.toString();
+
+ return this.http.request(path, requestOptions)
+ .map((response: Response) => response.json());
+ }
+
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/api.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/api.ts
new file mode 100644
index 00000000000..d919ee6d629
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/api.ts
@@ -0,0 +1 @@
+export * from './ProjectApi';
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/index.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/index.ts
new file mode 100644
index 00000000000..557365516ad
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/index.ts
@@ -0,0 +1,2 @@
+export * from './api/api';
+export * from './model/models';
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectEntity.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectEntity.ts
new file mode 100644
index 00000000000..dc3bd6bdce9
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectEntity.ts
@@ -0,0 +1,32 @@
+'use strict';
+import * as models from './models';
+
+export interface ProjectEntity {
+
+
+ id?: number;
+
+ kind?: ProjectEntity.KindEnum;
+
+ thumbnailUrl?: string;
+
+ name?: string;
+
+ state?: string;
+
+ meta?: any;
+
+ location?: models.ProjectEntityLocation;
+
+ createdAt?: Date;
+
+ updatedAt?: Date;
+
+ publishedAt?: Date;
+}
+export namespace ProjectEntity {
+
+ export enum KindEnum {
+ project = 'project',
+ }
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectEntityLocation.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectEntityLocation.ts
new file mode 100644
index 00000000000..81fd66511a6
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectEntityLocation.ts
@@ -0,0 +1,10 @@
+'use strict';
+import * as models from './models';
+
+export interface ProjectEntityLocation {
+
+
+ lat?: number;
+
+ lon?: number;
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectList.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectList.ts
new file mode 100644
index 00000000000..a8a98e93a75
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/ProjectList.ts
@@ -0,0 +1,8 @@
+'use strict';
+import * as models from './models';
+
+export interface ProjectList {
+
+
+ contents?: Array;
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/models.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/models.ts
new file mode 100644
index 00000000000..b917c007157
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/model/models.ts
@@ -0,0 +1,3 @@
+export * from './ProjectEntity';
+export * from './ProjectEntityLocation';
+export * from './ProjectList';
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json
new file mode 100644
index 00000000000..83a9a586ab9
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "arrayAndAnyTest",
+ "version": "1.0.2",
+ "description": "swagger client for arrayAndAnyTest",
+ "author": "Swagger Codegen Contributors",
+ "keywords": [
+ "swagger-client"
+ ],
+ "license": "MIT",
+ "files": [
+ "lib"
+ ],
+ "main": "./lib/index.js",
+ "typings": "./lib/index.d.ts",
+ "scripts": {
+ "build": "typings install && tsc"
+ },
+ "peerDependencies": {
+ "@angular/core": "^2.0.0-rc.1",
+ "@angular/http": "^2.0.0-rc.1"
+ },
+ "devDependencies": {
+ "@angular/common": "^2.0.0-rc.1",
+ "@angular/compiler": "^2.0.0-rc.1",
+ "@angular/core": "^2.0.0-rc.1",
+ "@angular/http": "^2.0.0-rc.1",
+ "@angular/platform-browser": "^2.0.0-rc.1",
+ "@angular/platform-browser-dynamic": "^2.0.0-rc.1",
+ "core-js": "^2.3.0",
+ "rxjs": "^5.0.0-beta.6",
+ "zone.js": "^0.6.12",
+ "typescript": "^1.8.10",
+ "typings": "^0.8.1",
+ "es6-shim": "^0.35.0",
+ "es7-reflect-metadata": "^1.6.0"
+ }}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/tsconfig.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/tsconfig.json
new file mode 100644
index 00000000000..07fbdf7e1b1
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "emitDecoratorMetadata": true,
+ "experimentalDecorators": true,
+ "noImplicitAny": false,
+ "suppressImplicitAnyIndexErrors": true,
+ "target": "es5",
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "removeComments": true,
+ "sourceMap": true,
+ "outDir": "./lib",
+ "noLib": false,
+ "declaration": true
+ },
+ "exclude": [
+ "node_modules",
+ "typings/main.d.ts",
+ "typings/main",
+ "lib"
+ ],
+ "filesGlob": [
+ "./model/*.ts",
+ "./api/*.ts",
+ "typings/browser.d.ts"
+ ]
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/typings.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/typings.json
new file mode 100644
index 00000000000..0848dcffe31
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/typings.json
@@ -0,0 +1,5 @@
+{
+ "ambientDependencies": {
+ "core-js": "registry:dt/core-js#0.0.0+20160317120654"
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-spec.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-spec.json
new file mode 100644
index 00000000000..366cbb9cb39
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-spec.json
@@ -0,0 +1,570 @@
+{
+ "swagger": "2.0",
+ "info":
+ {
+ "version": "1.7.0",
+ "title": "Cupix API",
+ "contact":
+ {
+ "name": "inska.lee@cupix.com"
+ }
+ },
+ "basePath": "/v1",
+ "consumes":
+ [
+ "application/json"
+ ],
+ "produces":
+ [
+ "application/json"
+ ],
+ "schemes":
+ [
+ "https"
+ ],
+ "paths":
+ {
+ "/projects":
+ {
+ "post":
+ {
+ "tags":
+ [
+ "Project"
+ ],
+ "summary": "Create a Project",
+ "operationId": "create_project",
+ "description": "Creates an empty Project",
+ "consumes":
+ [
+ "application/x-www-form-urlencoded"
+ ],
+ "produces":
+ [
+ "application/json"
+ ],
+ "parameters":
+ [
+
+ {
+ "name": "name",
+ "type": "string",
+ "in": "formData"
+ },
+
+ {
+ "name": "address",
+ "type": "string",
+ "in": "formData"
+ },
+
+ {
+ "name": "longitude",
+ "type": "number",
+ "format": "float",
+ "in": "formData"
+ },
+
+ {
+ "name": "latitude",
+ "type": "number",
+ "format": "float",
+ "in": "formData"
+ },
+
+ {
+ "name": "meta",
+ "type": "string",
+ "in": "formData"
+ }
+ ],
+ "responses":
+ {
+ "200":
+ {
+ "description": "Project information",
+ "schema":
+ {
+ "$ref": "#/definitions/ProjectEntity"
+ }
+ },
+ "400":
+ {
+ "description": "Bad Request",
+ "schema":
+ {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "401":
+ {
+ "description": "Unauthorized request"
+ },
+ "403":
+ {
+ "description": "Forbidden"
+ },
+ "404":
+ {
+ "description": "Project not found"
+ }
+ }
+ },
+ "get":
+ {
+ "tags":
+ [
+ "Project"
+ ],
+ "summary": "Get project list",
+ "operationId": "get_project_list",
+ "description": "Returns a Project JSON object",
+ "produces":
+ [
+ "application/json"
+ ],
+ "security":
+ [
+
+ {
+ "key":
+ [
+
+ ]
+ },
+
+ {
+ "token":
+ [
+
+ ]
+ }
+ ],
+ "parameters":
+ [
+
+ {
+ "name": "page",
+ "type": "integer",
+ "format": "int32",
+ "in": "query"
+ },
+
+ {
+ "name": "per_page",
+ "type": "integer",
+ "format": "int32",
+ "in": "query"
+ },
+
+ {
+ "name": "kind",
+ "type": "string",
+ "in": "query",
+ "enum":
+ [
+ "my_models",
+ "published",
+ "location"
+ ]
+ },
+
+ {
+ "name": "q",
+ "type": "string",
+ "in": "query"
+ },
+
+ {
+ "name": "filter",
+ "type": "string",
+ "in": "query"
+ },
+
+ {
+ "name": "latitude",
+ "in": "query",
+ "type": "number",
+ "format": "float",
+ "description": "Valid with kind as location"
+ },
+
+ {
+ "name": "longitude",
+ "in": "query",
+ "type": "number",
+ "format": "float",
+ "description": "Valid with kind as location"
+ },
+
+ {
+ "name": "scope",
+ "in": "query",
+ "type": "integer",
+ "description": "Valid with kind as location, and between 1~9"
+ }
+ ],
+ "responses":
+ {
+ "200":
+ {
+ "description": "Project list",
+ "schema":
+ {
+ "$ref": "#/definitions/ProjectList"
+ }
+ },
+ "400":
+ {
+ "description": "Bad Request",
+ "schema":
+ {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "401":
+ {
+ "description": "Unauthorized request"
+ },
+ "403":
+ {
+ "description": "Forbidden"
+ },
+ "404":
+ {
+ "description": "Project not found"
+ }
+ }
+ }
+ },
+ "/projects/{id}":
+ {
+ "get":
+ {
+ "tags":
+ [
+ "Project"
+ ],
+ "summary": "Get a Project",
+ "operationId": "get_project_by_id",
+ "description": "Returns a Project JSON object",
+ "produces":
+ [
+ "application/json"
+ ],
+ "parameters":
+ [
+
+ {
+ "name": "id",
+ "in": "path",
+ "description": "Project id",
+ "required": true,
+ "type": "integer",
+ "format": "int32"
+ }
+ ],
+ "responses":
+ {
+ "200":
+ {
+ "description": "Project information",
+ "schema":
+ {
+ "$ref": "#/definitions/ProjectEntity"
+ }
+ },
+ "400":
+ {
+ "description": "Bad Request",
+ "schema":
+ {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "401":
+ {
+ "description": "Unauthorized request"
+ },
+ "403":
+ {
+ "description": "Forbidden"
+ },
+ "404":
+ {
+ "description": "Project not found"
+ }
+ }
+ },
+ "put":
+ {
+ "tags":
+ [
+ "Project"
+ ],
+ "summary": "Update project",
+ "operationId": "update_project",
+ "consumes":
+ [
+ "multipart/form-data"
+ ],
+ "produces":
+ [
+ "application/json"
+ ],
+ "parameters":
+ [
+
+ {
+ "name": "id",
+ "in": "path",
+ "description": "Project id",
+ "required": true,
+ "type": "integer",
+ "format": "int32"
+ },
+
+ {
+ "name": "name",
+ "in": "formData",
+ "description": "User ID",
+ "type": "string"
+ },
+
+ {
+ "name": "address",
+ "in": "formData",
+ "description": "Address",
+ "type": "string"
+ },
+
+ {
+ "name": "longitude",
+ "type": "number",
+ "format": "float",
+ "in": "formData"
+ },
+
+ {
+ "name": "latitude",
+ "type": "number",
+ "format": "float",
+ "in": "formData"
+ },
+
+ {
+ "name": "meta",
+ "type": "string",
+ "in": "formData"
+ },
+
+ {
+ "name": "thumbnail",
+ "in": "formData",
+ "description": "Project thumbnail",
+ "type": "file"
+ }
+ ],
+ "responses":
+ {
+ "200":
+ {
+ "description": "Project information",
+ "schema":
+ {
+ "$ref": "#/definitions/ProjectEntity"
+ }
+ },
+ "400":
+ {
+ "description": "Bad Request",
+ "schema":
+ {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "401":
+ {
+ "description": "Unauthorized request"
+ },
+ "403":
+ {
+ "description": "Forbidden"
+ },
+ "404":
+ {
+ "description": "Project not found"
+ }
+ }
+ },
+ "delete":
+ {
+ "tags":
+ [
+ "Project"
+ ],
+ "summary": "Delete a Project",
+ "operationId": "delete_project_by_id",
+ "description": "Returns a Project JSON object",
+ "produces":
+ [
+ "application/json"
+ ],
+ "parameters":
+ [
+
+ {
+ "name": "id",
+ "in": "path",
+ "description": "Project id",
+ "required": true,
+ "type": "integer",
+ "format": "int32"
+ }
+ ],
+ "security":
+ [
+
+ {
+ "key":
+ [
+
+ ]
+ },
+
+ {
+ "token":
+ [
+
+ ]
+ }
+ ],
+ "responses":
+ {
+ "200":
+ {
+ "description": "Empty"
+ },
+ "204":
+ {
+ "description": "Deleted"
+ },
+ "400":
+ {
+ "description": "Bad Request",
+ "schema":
+ {
+ "$ref": "#/definitions/Error"
+ }
+ },
+ "401":
+ {
+ "description": "Unauthorized request"
+ },
+ "403":
+ {
+ "description": "Forbidden"
+ },
+ "404":
+ {
+ "description": "Project not found"
+ }
+ }
+ }
+ }
+ },
+ "definitions":
+ {
+ "ProjectList":
+ {
+ "type": "object",
+ "required":
+ [
+ "contents"
+ ],
+ "properties":
+ {
+ "contents":
+ {
+ "type": "array",
+ "items":
+ {
+ "$ref": "#/definitions/ProjectEntity"
+ }
+ }
+ }
+ },
+ "ProjectEntity":
+ {
+ "type": "object",
+ "required":
+ [
+ "id"
+ ],
+ "properties":
+ {
+ "id":
+ {
+ "type": "integer",
+ "format": "int32"
+ },
+ "kind":
+ {
+ "type": "string",
+ "enum":
+ [
+ "project"
+ ]
+ },
+ "thumbnail_url":
+ {
+ "type": "string"
+ },
+ "name":
+ {
+ "type": "string"
+ },
+ "state":
+ {
+ "type": "string"
+ },
+ "meta":
+ {
+ "type": "object"
+ },
+ "location":
+ {
+ "type": "object",
+ "properties":
+ {
+ "lat":
+ {
+ "type": "number",
+ "format": "float"
+ },
+ "lon":
+ {
+ "type": "number",
+ "format": "float"
+ }
+ }
+ },
+ "created_at":
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at":
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ "published_at":
+ {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/.swagger-codegen-ignore b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/.swagger-codegen-ignore
new file mode 100644
index 00000000000..19d3377182e
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/api.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/api.ts
new file mode 100644
index 00000000000..6a1cfed4d79
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/api.ts
@@ -0,0 +1,594 @@
+import request = require('request');
+import http = require('http');
+import Promise = require('bluebird');
+
+let defaultBasePath = 'http://petstore.swagger.io/v1';
+
+// ===============================================
+// This file is autogenerated - Please do not edit
+// ===============================================
+
+/* tslint:disable:no-unused-variable */
+
+export class Category {
+ 'id': number;
+ 'name': string;
+}
+
+export class Pet {
+ 'id': number;
+ 'category': Category;
+ 'name': string;
+}
+
+
+export interface Authentication {
+ /**
+ * Apply authentication settings to header and query params.
+ */
+ applyToRequest(requestOptions: request.Options): void;
+}
+
+export class HttpBasicAuth implements Authentication {
+ public username: string;
+ public password: string;
+ applyToRequest(requestOptions: request.Options): void {
+ requestOptions.auth = {
+ username: this.username, password: this.password
+ }
+ }
+}
+
+export class ApiKeyAuth implements Authentication {
+ public apiKey: string;
+
+ constructor(private location: string, private paramName: string) {
+ }
+
+ applyToRequest(requestOptions: request.Options): void {
+ if (this.location == "query") {
+ (requestOptions.qs)[this.paramName] = this.apiKey;
+ } else if (this.location == "header") {
+ requestOptions.headers[this.paramName] = this.apiKey;
+ }
+ }
+}
+
+export class OAuth implements Authentication {
+ public accessToken: string;
+
+ applyToRequest(requestOptions: request.Options): void {
+ requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
+ }
+}
+
+export class VoidAuth implements Authentication {
+ public username: string;
+ public password: string;
+ applyToRequest(requestOptions: request.Options): void {
+ // Do nothing
+ }
+}
+
+export enum PetApiApiKeys {
+}
+
+export class PetApi {
+ protected basePath = defaultBasePath;
+ protected defaultHeaders : any = {};
+
+ protected authentications = {
+ 'default': new VoidAuth(),
+ }
+
+ constructor(basePath?: string);
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
+ if (password) {
+ if (basePath) {
+ this.basePath = basePath;
+ }
+ } else {
+ if (basePathOrUsername) {
+ this.basePath = basePathOrUsername
+ }
+ }
+ }
+
+ public setApiKey(key: PetApiApiKeys, value: string) {
+ this.authentications[PetApiApiKeys[key]].apiKey = value;
+ }
+ private extendObj(objA: T1, objB: T2) {
+ for(let key in objB){
+ if(objB.hasOwnProperty(key)){
+ objA[key] = objB[key];
+ }
+ }
+ return objA;
+ }
+ /**
+ * Add a new pet to the store
+ *
+ * @param body Pet object that needs to be added to the store
+ */
+ public addPet (body?: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> {
+ const localVarPath = this.basePath + '/pet';
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'POST',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ body: body,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+ /**
+ * Deletes a pet
+ *
+ * @param petId Pet id to delete
+ * @param apiKey
+ */
+ public deletePet (petId: number, apiKey?: string) : Promise<{ response: http.ClientResponse; body?: any; }> {
+ const localVarPath = this.basePath + '/pet/{petId}'
+ .replace('{' + 'petId' + '}', String(petId));
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ // verify required parameter 'petId' is not null or undefined
+ if (petId === null || petId === undefined) {
+ throw new Error('Required parameter petId was null or undefined when calling deletePet.');
+ }
+
+ headerParams['api_key'] = apiKey;
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'DELETE',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+ /**
+ * Find pet by ID
+ * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ * @param petId ID of pet that needs to be fetched
+ */
+ public getPetById (petId: number) : Promise<{ response: http.ClientResponse; body: Pet; }> {
+ const localVarPath = this.basePath + '/pet/{petId}'
+ .replace('{' + 'petId' + '}', String(petId));
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ // verify required parameter 'petId' is not null or undefined
+ if (petId === null || petId === undefined) {
+ throw new Error('Required parameter petId was null or undefined when calling getPetById.');
+ }
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'GET',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body: Pet; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+ /**
+ * Update an existing pet
+ *
+ * @param body Pet object that needs to be added to the store
+ */
+ public updatePet (body?: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> {
+ const localVarPath = this.basePath + '/pet';
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'PUT',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ body: body,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+ /**
+ * Updates a pet in the store with form data
+ *
+ * @param petId ID of pet that needs to be updated
+ * @param name Updated name of the pet
+ * @param status Updated status of the pet
+ */
+ public updatePetWithForm (petId: string, name?: string, status?: string) : Promise<{ response: http.ClientResponse; body?: any; }> {
+ const localVarPath = this.basePath + '/pet/{petId}'
+ .replace('{' + 'petId' + '}', String(petId));
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ // verify required parameter 'petId' is not null or undefined
+ if (petId === null || petId === undefined) {
+ throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
+ }
+
+ let useFormData = false;
+
+ if (name !== undefined) {
+ formParams['name'] = name;
+ }
+
+ if (status !== undefined) {
+ formParams['status'] = status;
+ }
+
+ let requestOptions: request.Options = {
+ method: 'POST',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+}
+export enum StoreApiApiKeys {
+}
+
+export class StoreApi {
+ protected basePath = defaultBasePath;
+ protected defaultHeaders : any = {};
+
+ protected authentications = {
+ 'default': new VoidAuth(),
+ }
+
+ constructor(basePath?: string);
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
+ if (password) {
+ if (basePath) {
+ this.basePath = basePath;
+ }
+ } else {
+ if (basePathOrUsername) {
+ this.basePath = basePathOrUsername
+ }
+ }
+ }
+
+ public setApiKey(key: StoreApiApiKeys, value: string) {
+ this.authentications[StoreApiApiKeys[key]].apiKey = value;
+ }
+ private extendObj(objA: T1, objB: T2) {
+ for(let key in objB){
+ if(objB.hasOwnProperty(key)){
+ objA[key] = objB[key];
+ }
+ }
+ return objA;
+ }
+ /**
+ * Delete purchase order by ID
+ * 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
+ */
+ public deleteOrder (orderId: string) : Promise<{ response: http.ClientResponse; body?: any; }> {
+ const localVarPath = this.basePath + '/store/order/{orderId}'
+ .replace('{' + 'orderId' + '}', String(orderId));
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ // verify required parameter 'orderId' is not null or undefined
+ if (orderId === null || orderId === undefined) {
+ throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
+ }
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'DELETE',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ */
+ public getInventory () : Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }> {
+ const localVarPath = this.basePath + '/store/inventory';
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'GET',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+ /**
+ * Find purchase order by ID
+ * 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
+ */
+ public getOrderById (orderId: string) : Promise<{ response: http.ClientResponse; body: Order; }> {
+ const localVarPath = this.basePath + '/store/order/{orderId}'
+ .replace('{' + 'orderId' + '}', String(orderId));
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ // verify required parameter 'orderId' is not null or undefined
+ if (orderId === null || orderId === undefined) {
+ throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
+ }
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'GET',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+ /**
+ * Place an order for a pet
+ *
+ * @param body order placed for purchasing the pet
+ */
+ public placeOrder (body?: Order) : Promise<{ response: http.ClientResponse; body: Order; }> {
+ const localVarPath = this.basePath + '/store/order';
+ let queryParameters: any = {};
+ let headerParams: any = this.extendObj({}, this.defaultHeaders);
+ let formParams: any = {};
+
+
+ let useFormData = false;
+
+ let requestOptions: request.Options = {
+ method: 'POST',
+ qs: queryParameters,
+ headers: headerParams,
+ uri: localVarPath,
+ json: true,
+ body: body,
+ };
+
+ this.authentications.default.applyToRequest(requestOptions);
+
+ if (Object.keys(formParams).length) {
+ if (useFormData) {
+ (requestOptions).formData = formParams;
+ } else {
+ requestOptions.form = formParams;
+ }
+ }
+ return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
+ request(requestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject({ response: response, body: body });
+ }
+ }
+ });
+ });
+ }
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/git_push.sh b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/git_push.sh
new file mode 100644
index 00000000000..6ca091b49d9
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/git_push.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id=""
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id=""
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note=""
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/package.json
new file mode 100644
index 00000000000..960338ff787
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "node-es6-test",
+ "version": "1.0.3",
+ "description": "NodeJS client for node-es6-test",
+ "main": "api.js",
+ "scripts": {
+ "build": "typings install && tsc"
+ },
+ "author": "Swagger Codegen Contributors",
+ "license": "MIT",
+ "dependencies": {
+ "bluebird": "^3.3.5",
+ "request": "^2.72.0"
+ },
+ "devDependencies": {
+ "typescript": "^1.8.10",
+ "typings": "^0.8.1"
+ }
+}
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/tsconfig.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/tsconfig.json
new file mode 100644
index 00000000000..2dd166566e9
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "noImplicitAny": false,
+ "suppressImplicitAnyIndexErrors": true,
+ "target": "ES5",
+ "moduleResolution": "node",
+ "removeComments": true,
+ "sourceMap": true,
+ "noLib": false,
+ "declaration": true
+ },
+ "files": [
+ "api.ts",
+ "typings/main.d.ts"
+ ]
+}
+
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/typings.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/typings.json
new file mode 100644
index 00000000000..76c4cc8e6af
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/typings.json
@@ -0,0 +1,10 @@
+{
+ "ambientDependencies": {
+ "bluebird": "registry:dt/bluebird#2.0.0+20160319051630",
+ "core-js": "registry:dt/core-js#0.0.0+20160317120654",
+ "node": "registry:dt/node#4.0.0+20160423143914"
+ },
+ "dependencies": {
+ "request": "registry:npm/request#2.69.0+20160304121250"
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-spec.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-spec.json
new file mode 100644
index 00000000000..2bf01d61584
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-spec.json
@@ -0,0 +1,418 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "description": "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters",
+ "version": "1.0.0",
+ "title": "Swagger Petstore",
+ "termsOfService": "http://helloreverb.com/terms/",
+ "contact": {
+ "email": "apiteam@wordnik.com"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "host": "petstore.swagger.io",
+ "basePath": "/v1",
+ "schemes": [
+ "http"
+ ],
+ "paths": {
+ "/pet": {
+ "post": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Add a new pet to the store",
+ "description": "",
+ "operationId": "addPet",
+ "consumes": [
+ "application/json",
+ "application/xml"
+ ],
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "Pet object that needs to be added to the store",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/Pet"
+ }
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Invalid input"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ },
+ "put": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Update an existing pet",
+ "description": "",
+ "operationId": "updatePet",
+ "consumes": [
+ "application/json",
+ "application/xml"
+ ],
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "Pet object that needs to be added to the store",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/Pet"
+ }
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Validation exception"
+ },
+ "404": {
+ "description": "Pet not found"
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ }
+ },
+ "/pet/{petId}": {
+ "get": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Find pet by ID",
+ "description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions",
+ "operationId": "getPetById",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "ID of pet that needs to be fetched",
+ "required": true,
+ "type": "integer",
+ "format": "int64"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "Pet not found"
+ },
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/Pet"
+ }
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ },
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Updates a pet in the store with form data",
+ "description": "",
+ "operationId": "updatePetWithForm",
+ "consumes": [
+ "application/x-www-form-urlencoded"
+ ],
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "name",
+ "in": "formData",
+ "description": "Updated name of the pet",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "status",
+ "in": "formData",
+ "description": "Updated status of the pet",
+ "required": false,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "405": {
+ "description": "Invalid input"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "pet"
+ ],
+ "summary": "Deletes a pet",
+ "description": "",
+ "operationId": "deletePet",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "name": "api_key",
+ "in": "header",
+ "description": "",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "Pet id to delete",
+ "required": true,
+ "type": "integer",
+ "format": "int64"
+ }
+ ],
+ "responses": {
+ "400": {
+ "description": "Invalid pet value"
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+ }
+ },
+ "/store/inventory": {
+ "get": {
+ "tags": [
+ "store"
+ ],
+ "summary": "Returns pet inventories by status",
+ "description": "Returns a map of status codes to quantities",
+ "operationId": "getInventory",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/store/order": {
+ "post": {
+ "tags": [
+ "store"
+ ],
+ "summary": "Place an order for a pet",
+ "description": "",
+ "operationId": "placeOrder",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "order placed for purchasing the pet",
+ "required": false,
+ "schema": {
+ "$ref": "#/definitions/Order"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/Order"
+ }
+ },
+ "400": {
+ "description": "Invalid Order"
+ }
+ }
+ }
+ },
+ "/store/order/{orderId}": {
+ "get": {
+ "tags": [
+ "store"
+ ],
+ "summary": "Find purchase order by ID",
+ "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
+ "operationId": "getOrderById",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "name": "orderId",
+ "in": "path",
+ "description": "ID of pet that needs to be fetched",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "Order not found"
+ },
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/Order"
+ }
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "store"
+ ],
+ "summary": "Delete purchase order by ID",
+ "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
+ "operationId": "deleteOrder",
+ "produces": [
+ "application/json",
+ "application/xml"
+ ],
+ "parameters": [
+ {
+ "name": "orderId",
+ "in": "path",
+ "description": "ID of the order that needs to be deleted",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "404": {
+ "description": "Order not found"
+ },
+ "400": {
+ "description": "Invalid ID supplied"
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "Category": {
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "Pet": {
+ "required": [
+ "name",
+ "photoUrls"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "category": {
+ "$ref": "#/definitions/Category"
+ },
+ "name": {
+ "type": "string",
+ "example": "doggie"
+ }
+ }
+ }
+ }
+}
diff --git a/pom.xml b/pom.xml
index ea45c11fa19..4dfd8c6fdcd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -438,6 +438,78 @@
samples/server/petstore/jaxrs
+
+ typescript-fetch-client-tests-default
+
+
+ env
+ java
+
+
+
+ samples/client/petstore/typescript-fetch/tests/default
+
+
+
+ typescript-fetch-client-builds-default
+
+
+ env
+ java
+
+
+
+ samples/client/petstore/typescript-fetch/builds/default
+
+
+
+ typescript-fetch-client-builds-es6-target
+
+
+ env
+ java
+
+
+
+ samples/client/petstore/typescript-fetch/builds/es6-target
+
+
+
+ typescript-fetch-client-builds-with-npm-version
+
+
+ env
+ java
+
+
+
+ samples/client/petstore/typescript-fetch/builds/with-npm-version
+
+
+
+ typescript-angular-client
+
+
+ env
+ java
+
+
+
+ samples/client/petstore/typescript-angular/npm
+
+
+
+ typescript-node-npm-client
+
+
+ env
+ java
+
+
+
+ samples/client/petstore/typescript-node/npm
+
+
ruby-client
@@ -471,6 +543,15 @@
+
+
+ samples/client/petstore/ruby
+ samples/client/petstore/typescript-angular
+ samples/client/petstore/typescript-node/npm
samples/client/petstore/android/volley
samples/client/petstore/clojure
samples/client/petstore/java/default
@@ -483,7 +564,6 @@
samples/client/petstore/javascript
samples/client/petstore/scala
samples/server/petstore/spring-mvc
- samples/client/petstore/ruby
samples/server/petstore/jaxrs
samples/server/petstore/jaxrs-resteasy
diff --git a/samples/client/petstore/android/httpclient/gradlew.bat b/samples/client/petstore/android/httpclient/gradlew.bat
index 72d362dafd8..5f192121eb4 100644
--- a/samples/client/petstore/android/httpclient/gradlew.bat
+++ b/samples/client/petstore/android/httpclient/gradlew.bat
@@ -1,90 +1,90 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/android/httpclient/src/main/java/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/android/httpclient/src/main/java/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..008a64a2444
--- /dev/null
+++ b/samples/client/petstore/android/httpclient/src/main/java/gradle/wrapper/gradle-wrapper.jar
@@ -0,0 +1,53 @@
+" zip.vim version v27
+" Browsing zipfile /Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.jar
+" Select a file with cursor and press ENTER
+
+META-INF/
+META-INF/MANIFEST.MF
+org/
+org/gradle/
+org/gradle/wrapper/
+org/gradle/wrapper/Download$1.class
+org/gradle/wrapper/Download$SystemPropertiesProxyAuthenticator.class
+org/gradle/wrapper/IDownload.class
+org/gradle/wrapper/GradleUserHomeLookup.class
+org/gradle/wrapper/ExclusiveFileAccessManager.class
+org/gradle/wrapper/WrapperConfiguration.class
+org/gradle/wrapper/SystemPropertiesHandler.class
+org/gradle/wrapper/Logger.class
+org/gradle/wrapper/PathAssembler.class
+org/gradle/wrapper/Install.class
+org/gradle/wrapper/BootstrapMainStarter.class
+org/gradle/wrapper/WrapperExecutor.class
+org/gradle/wrapper/GradleWrapperMain.class
+org/gradle/wrapper/Install$1.class
+org/gradle/wrapper/PathAssembler$LocalDistribution.class
+org/gradle/wrapper/Download.class
+gradle-wrapper-classpath.properties
+build-receipt.properties
+org/gradle/cli/
+org/gradle/cli/AbstractCommandLineConverter.class
+org/gradle/cli/CommandLineParser$1.class
+org/gradle/cli/CommandLineParser$MissingOptionArgState.class
+org/gradle/cli/CommandLineParser$OptionStringComparator.class
+org/gradle/cli/CommandLineArgumentException.class
+org/gradle/cli/CommandLineParser$KnownOptionParserState.class
+org/gradle/cli/CommandLineParser$OptionComparator.class
+org/gradle/cli/CommandLineParser$UnknownOptionParserState.class
+org/gradle/cli/CommandLineOption.class
+org/gradle/cli/CommandLineParser$OptionParserState.class
+org/gradle/cli/ParsedCommandLine.class
+org/gradle/cli/ProjectPropertiesCommandLineConverter.class
+org/gradle/cli/CommandLineParser$CaseInsensitiveStringComparator.class
+org/gradle/cli/CommandLineParser.class
+org/gradle/cli/CommandLineParser$AfterOptions.class
+org/gradle/cli/CommandLineParser$OptionString.class
+org/gradle/cli/AbstractPropertiesCommandLineConverter.class
+org/gradle/cli/ParsedCommandLineOption.class
+org/gradle/cli/CommandLineParser$OptionAwareParserState.class
+org/gradle/cli/CommandLineConverter.class
+org/gradle/cli/CommandLineParser$BeforeFirstSubCommand.class
+org/gradle/cli/SystemPropertiesCommandLineConverter.class
+org/gradle/cli/CommandLineParser$ParserState.class
+org/gradle/cli/CommandLineParser$AfterFirstSubCommand.class
+gradle-cli-classpath.properties
diff --git a/samples/client/petstore/android/httpclient/src/main/java/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/android/httpclient/src/main/java/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..fa452523ac0
--- /dev/null
+++ b/samples/client/petstore/android/httpclient/src/main/java/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon May 16 21:00:11 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/android/volley/gradlew.bat b/samples/client/petstore/android/volley/gradlew.bat
index 72d362dafd8..5f192121eb4 100644
--- a/samples/client/petstore/android/volley/gradlew.bat
+++ b/samples/client/petstore/android/volley/gradlew.bat
@@ -1,90 +1,90 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/android/volley/src/main/java/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/android/volley/src/main/java/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..126985b8a44
--- /dev/null
+++ b/samples/client/petstore/android/volley/src/main/java/gradle/wrapper/gradle-wrapper.jar
@@ -0,0 +1,53 @@
+" zip.vim version v27
+" Browsing zipfile /Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.jar
+" Select a file with cursor and press ENTER
+
+META-INF/
+META-INF/MANIFEST.MF
+org/
+org/gradle/
+org/gradle/wrapper/
+org/gradle/wrapper/Download$1.class
+org/gradle/wrapper/Download$SystemPropertiesProxyAuthenticator.class
+org/gradle/wrapper/IDownload.class
+org/gradle/wrapper/GradleUserHomeLookup.class
+org/gradle/wrapper/ExclusiveFileAccessManager.class
+org/gradle/wrapper/WrapperConfiguration.class
+org/gradle/wrapper/SystemPropertiesHandler.class
+org/gradle/wrapper/Logger.class
+org/gradle/wrapper/PathAssembler.class
+org/gradle/wrapper/Install.class
+org/gradle/wrapper/BootstrapMainStarter.class
+org/gradle/wrapper/WrapperExecutor.class
+org/gradle/wrapper/GradleWrapperMain.class
+org/gradle/wrapper/Install$1.class
+org/gradle/wrapper/PathAssembler$LocalDistribution.class
+org/gradle/wrapper/Download.class
+gradle-wrapper-classpath.properties
+build-receipt.properties
+org/gradle/cli/
+org/gradle/cli/AbstractCommandLineConverter.class
+org/gradle/cli/CommandLineParser$1.class
+org/gradle/cli/CommandLineParser$MissingOptionArgState.class
+org/gradle/cli/CommandLineParser$OptionStringComparator.class
+org/gradle/cli/CommandLineArgumentException.class
+org/gradle/cli/CommandLineParser$KnownOptionParserState.class
+org/gradle/cli/CommandLineParser$OptionComparator.class
+org/gradle/cli/CommandLineParser$UnknownOptionParserState.class
+org/gradle/cli/CommandLineOption.class
+org/gradle/cli/CommandLineParser$OptionParserState.class
+org/gradle/cli/ParsedCommandLine.class
+org/gradle/cli/ProjectPropertiesCommandLineConverter.class
+org/gradle/cli/CommandLineParser$CaseInsensitiveStringComparator.class
+org/gradle/cli/CommandLineParser.class
+org/gradle/cli/CommandLineParser$AfterOptions.class
+org/gradle/cli/CommandLineParser$OptionString.class
+org/gradle/cli/AbstractPropertiesCommandLineConverter.class
+org/gradle/cli/ParsedCommandLineOption.class
+org/gradle/cli/CommandLineParser$OptionAwareParserState.class
+org/gradle/cli/CommandLineConverter.class
+org/gradle/cli/CommandLineParser$BeforeFirstSubCommand.class
+org/gradle/cli/SystemPropertiesCommandLineConverter.class
+org/gradle/cli/CommandLineParser$ParserState.class
+org/gradle/cli/CommandLineParser$AfterFirstSubCommand.class
+gradle-cli-classpath.properties
diff --git a/samples/client/petstore/android/volley/src/main/java/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/android/volley/src/main/java/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..1bbc424ca7e
--- /dev/null
+++ b/samples/client/petstore/android/volley/src/main/java/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon May 16 21:00:31 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/csharp/SwaggerClient/.swagger-codegen-ignore b/samples/client/petstore/csharp/SwaggerClient/.swagger-codegen-ignore
new file mode 100644
index 00000000000..19d3377182e
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
index cdf88075dfa..d6a0243de57 100644
--- a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
+++ b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
@@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{1293D07E-F404-42B9-8BC7-0A4DAD18E83B}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{098D14FD-4F35-417E-9B8E-67875ACD0AD3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject
@@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
-{1293D07E-F404-42B9-8BC7-0A4DAD18E83B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-{1293D07E-F404-42B9-8BC7-0A4DAD18E83B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-{1293D07E-F404-42B9-8BC7-0A4DAD18E83B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-{1293D07E-F404-42B9-8BC7-0A4DAD18E83B}.Release|Any CPU.Build.0 = Release|Any CPU
+{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Release|Any CPU.Build.0 = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md
index a929fbd5db6..7cd00026612 100644
--- a/samples/client/petstore/csharp/SwaggerClient/README.md
+++ b/samples/client/petstore/csharp/SwaggerClient/README.md
@@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
- API version: 1.0.0
- SDK version: 1.0.0
-- Build date: 2016-05-16T15:24:50.194+08:00
+- Build date: 2016-05-21T22:36:46.367+08:00
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
## Frameworks supported
@@ -112,6 +112,7 @@ Class | Method | HTTP request | Description
## Documentation for Models
+ - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [Model.Animal](docs/Animal.md)
- [Model.AnimalFarm](docs/AnimalFarm.md)
- [Model.ApiResponse](docs/ApiResponse.md)
@@ -121,11 +122,13 @@ Class | Method | HTTP request | Description
- [Model.EnumClass](docs/EnumClass.md)
- [Model.EnumTest](docs/EnumTest.md)
- [Model.FormatTest](docs/FormatTest.md)
+ - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model.Model200Response](docs/Model200Response.md)
- [Model.ModelReturn](docs/ModelReturn.md)
- [Model.Name](docs/Name.md)
- [Model.Order](docs/Order.md)
- [Model.Pet](docs/Pet.md)
+ - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.SpecialModelName](docs/SpecialModelName.md)
- [Model.Tag](docs/Tag.md)
- [Model.User](docs/User.md)
diff --git a/samples/client/petstore/go/go-petstore/docs/ApiResponse.md b/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md
similarity index 59%
rename from samples/client/petstore/go/go-petstore/docs/ApiResponse.md
rename to samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md
index 3653b42ba24..e9922fe6e91 100644
--- a/samples/client/petstore/go/go-petstore/docs/ApiResponse.md
+++ b/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md
@@ -1,12 +1,8 @@
-# ApiResponse
-
+# IO.Swagger.Model.AdditionalPropertiesClass
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**Code** | **int32** | | [optional] [default to null]
-**Type_** | **string** | | [optional] [default to null]
-**Message** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
index 65b04a12ccb..e4325274999 100644
--- a/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
+++ b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
@@ -84,8 +84,8 @@ No authorization required
### HTTP request headers
- - **Content-Type**: Not defined
- - **Accept**: application/xml, application/json
+ - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
+ - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 00000000000..0db3f9ee52d
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,10 @@
+# IO.Swagger.Model.MixedPropertiesAndAdditionalPropertiesClass
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Uuid** | **Guid?** | | [optional]
+**DateTime** | **DateTime?** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp/SwaggerClient/docs/ReadOnlyFirst.md
new file mode 100644
index 00000000000..b5f8d484869
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/docs/ReadOnlyFirst.md
@@ -0,0 +1,10 @@
+# IO.Swagger.Model.ReadOnlyFirst
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Bar** | **string** | | [optional]
+**Baz** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj
index 231c0ab87ad..a2f1f209fa3 100644
--- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj
+++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj
@@ -1,5 +1,5 @@
-
+
Debug
AnyCPU
@@ -38,43 +38,36 @@
- $(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
- ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
- ..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
- ..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
+ $(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
+ ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
+ ..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
+ ..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll
- $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll
- ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll
- ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll
- ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll
+ $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll
+ ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll
+ ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll
+ ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll
- $(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll
- ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
- ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
- ..\..\vendor\NUnit.2.6.3\lib\nunit.framework.dll
+ $(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll
+ ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+ ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+ ..\..\vendor\NUnit.2.6.3\lib\nunit.framework.dll
-
-
-
+
-
+
-
- {1293D07E-F404-42B9-8BC7-0A4DAD18E83B}
- IO.Swagger
-
-
-
-
-
-
-
+
+ {098D14FD-4F35-417E-9B8E-67875ACD0AD3}
+ IO.Swagger
+
+
diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/AdditionalPropertiesClassTests.cs
new file mode 100644
index 00000000000..fca6d20d0dc
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/AdditionalPropertiesClassTests.cs
@@ -0,0 +1,56 @@
+using NUnit.Framework;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using IO.Swagger.Api;
+using IO.Swagger.Model;
+using IO.Swagger.Client;
+using System.Reflection;
+
+namespace IO.Swagger.Test
+{
+ ///
+ /// Class for testing AdditionalPropertiesClass
+ ///
+ ///
+ /// This file is automatically generated by Swagger Codegen.
+ /// Please update the test case below to test the model.
+ ///
+ [TestFixture]
+ public class AdditionalPropertiesClassTests
+ {
+ private AdditionalPropertiesClass instance;
+
+ ///
+ /// Setup before each test
+ ///
+ [SetUp]
+ public void Init()
+ {
+ instance = new AdditionalPropertiesClass();
+ }
+
+ ///
+ /// Clean up after each test
+ ///
+ [TearDown]
+ public void Cleanup()
+ {
+
+ }
+
+ ///
+ /// Test an instance of AdditionalPropertiesClass
+ ///
+ [Test]
+ public void AdditionalPropertiesClassInstanceTest()
+ {
+ Assert.IsInstanceOf (instance, "instance is a AdditionalPropertiesClass");
+ }
+
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs
new file mode 100644
index 00000000000..e21779241db
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs
@@ -0,0 +1,72 @@
+using NUnit.Framework;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using IO.Swagger.Api;
+using IO.Swagger.Model;
+using IO.Swagger.Client;
+using System.Reflection;
+
+namespace IO.Swagger.Test
+{
+ ///
+ /// Class for testing MixedPropertiesAndAdditionalPropertiesClass
+ ///
+ ///
+ /// This file is automatically generated by Swagger Codegen.
+ /// Please update the test case below to test the model.
+ ///
+ [TestFixture]
+ public class MixedPropertiesAndAdditionalPropertiesClassTests
+ {
+ private MixedPropertiesAndAdditionalPropertiesClass instance;
+
+ ///
+ /// Setup before each test
+ ///
+ [SetUp]
+ public void Init()
+ {
+ instance = new MixedPropertiesAndAdditionalPropertiesClass();
+ }
+
+ ///
+ /// Clean up after each test
+ ///
+ [TearDown]
+ public void Cleanup()
+ {
+
+ }
+
+ ///
+ /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass
+ ///
+ [Test]
+ public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest()
+ {
+ Assert.IsInstanceOf (instance, "instance is a MixedPropertiesAndAdditionalPropertiesClass");
+ }
+
+ ///
+ /// Test the property 'Uuid'
+ ///
+ [Test]
+ public void UuidTest()
+ {
+ // TODO: unit test for the property 'Uuid'
+ }
+ ///
+ /// Test the property 'DateTime'
+ ///
+ [Test]
+ public void DateTimeTest()
+ {
+ // TODO: unit test for the property 'DateTime'
+ }
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReadOnlyFirstTests.cs
new file mode 100644
index 00000000000..9aa3cec42b2
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReadOnlyFirstTests.cs
@@ -0,0 +1,72 @@
+using NUnit.Framework;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using IO.Swagger.Api;
+using IO.Swagger.Model;
+using IO.Swagger.Client;
+using System.Reflection;
+
+namespace IO.Swagger.Test
+{
+ ///
+ /// Class for testing ReadOnlyFirst
+ ///
+ ///
+ /// This file is automatically generated by Swagger Codegen.
+ /// Please update the test case below to test the model.
+ ///
+ [TestFixture]
+ public class ReadOnlyFirstTests
+ {
+ private ReadOnlyFirst instance;
+
+ ///
+ /// Setup before each test
+ ///
+ [SetUp]
+ public void Init()
+ {
+ instance = new ReadOnlyFirst();
+ }
+
+ ///
+ /// Clean up after each test
+ ///
+ [TearDown]
+ public void Cleanup()
+ {
+
+ }
+
+ ///
+ /// Test an instance of ReadOnlyFirst
+ ///
+ [Test]
+ public void ReadOnlyFirstInstanceTest()
+ {
+ Assert.IsInstanceOf (instance, "instance is a ReadOnlyFirst");
+ }
+
+ ///
+ /// Test the property 'Bar'
+ ///
+ [Test]
+ public void BarTest()
+ {
+ // TODO: unit test for the property 'Bar'
+ }
+ ///
+ /// Test the property 'Baz'
+ ///
+ [Test]
+ public void BazTest()
+ {
+ // TODO: unit test for the property 'Baz'
+ }
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs
index 8b9fe2e52c8..ce3c07d74a5 100644
--- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs
+++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs
@@ -10,7 +10,7 @@ namespace IO.Swagger.Api
///
/// Represents a collection of functions to interact with the API endpoints
///
- public interface IFakeApi
+ public interface IFakeApi : IApiAccessor
{
#region Synchronous Operations
///
@@ -107,7 +107,7 @@ public interface IFakeApi
///
/// Represents a collection of functions to interact with the API endpoints
///
- public class FakeApi : IFakeApi
+ public partial class FakeApi : IFakeApi
{
///
/// Initializes a new instance of the class.
@@ -157,7 +157,7 @@ public String GetBasePath()
/// Sets the base path of the API client.
///
/// The base path
- [Obsolete("SetBasePath is deprecated, please do 'Configuraiton.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
+ [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
public void SetBasePath(String basePath)
{
// do nothing
@@ -255,13 +255,15 @@ public ApiResponse
\ No newline at end of file
+
diff --git a/samples/client/petstore/java/default/.gitignore b/samples/client/petstore/java/default/.gitignore
index 32858aad3c3..7cf39af816c 100644
--- a/samples/client/petstore/java/default/.gitignore
+++ b/samples/client/petstore/java/default/.gitignore
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/samples/client/petstore/java/default/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/default/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/samples/client/petstore/java/default/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/default/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/default/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..b7a36473955
--- /dev/null
+++ b/samples/client/petstore/java/default/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:08:05 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/default/gradlew b/samples/client/petstore/java/default/gradlew
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/samples/client/petstore/java/default/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/default/gradlew.bat b/samples/client/petstore/java/default/gradlew.bat
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/samples/client/petstore/java/default/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/feign/.gitignore b/samples/client/petstore/java/feign/.gitignore
index 32858aad3c3..7cf39af816c 100644
--- a/samples/client/petstore/java/feign/.gitignore
+++ b/samples/client/petstore/java/feign/.gitignore
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..5c639c12740
--- /dev/null
+++ b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:03:29 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/feign/gradlew b/samples/client/petstore/java/feign/gradlew
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/samples/client/petstore/java/feign/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/feign/gradlew.bat b/samples/client/petstore/java/feign/gradlew.bat
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/samples/client/petstore/java/feign/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/jersey2/.gitignore b/samples/client/petstore/java/jersey2/.gitignore
index 32858aad3c3..7cf39af816c 100644
--- a/samples/client/petstore/java/jersey2/.gitignore
+++ b/samples/client/petstore/java/jersey2/.gitignore
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..73377e009b0
--- /dev/null
+++ b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:03:46 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/jersey2/gradlew b/samples/client/petstore/java/jersey2/gradlew
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/samples/client/petstore/java/jersey2/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/jersey2/gradlew.bat b/samples/client/petstore/java/jersey2/gradlew.bat
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/samples/client/petstore/java/jersey2/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/okhttp-gson/.gitignore b/samples/client/petstore/java/okhttp-gson/.gitignore
index 32858aad3c3..7cf39af816c 100644
--- a/samples/client/petstore/java/okhttp-gson/.gitignore
+++ b/samples/client/petstore/java/okhttp-gson/.gitignore
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..6b40dc13def
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:04:14 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/okhttp-gson/gradlew b/samples/client/petstore/java/okhttp-gson/gradlew
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/okhttp-gson/gradlew.bat b/samples/client/petstore/java/okhttp-gson/gradlew.bat
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/retrofit/.gitignore b/samples/client/petstore/java/retrofit/.gitignore
index 32858aad3c3..7cf39af816c 100644
--- a/samples/client/petstore/java/retrofit/.gitignore
+++ b/samples/client/petstore/java/retrofit/.gitignore
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..0c81b118d92
--- /dev/null
+++ b/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:04:28 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/retrofit/gradlew b/samples/client/petstore/java/retrofit/gradlew
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/samples/client/petstore/java/retrofit/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/retrofit/gradlew.bat b/samples/client/petstore/java/retrofit/gradlew.bat
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/samples/client/petstore/java/retrofit/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/retrofit2/.gitignore b/samples/client/petstore/java/retrofit2/.gitignore
index 32858aad3c3..7cf39af816c 100644
--- a/samples/client/petstore/java/retrofit2/.gitignore
+++ b/samples/client/petstore/java/retrofit2/.gitignore
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..77483e70e76
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:04:50 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/retrofit2/gradlew b/samples/client/petstore/java/retrofit2/gradlew
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/retrofit2/gradlew.bat b/samples/client/petstore/java/retrofit2/gradlew.bat
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/retrofit2rx/.gitignore b/samples/client/petstore/java/retrofit2rx/.gitignore
index 32858aad3c3..7cf39af816c 100644
--- a/samples/client/petstore/java/retrofit2rx/.gitignore
+++ b/samples/client/petstore/java/retrofit2rx/.gitignore
@@ -8,5 +8,8 @@
*.war
*.ear
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
diff --git a/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000000..2c6137b8789
Binary files /dev/null and b/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000000..d28218b9a14
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:05:31 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/retrofit2rx/gradlew b/samples/client/petstore/java/retrofit2rx/gradlew
new file mode 100755
index 00000000000..9d82f789151
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2rx/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/retrofit2rx/gradlew.bat b/samples/client/petstore/java/retrofit2rx/gradlew.bat
new file mode 100644
index 00000000000..72d362dafd8
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2rx/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md
index 9da8dacc922..25596bbd7d9 100644
--- a/samples/client/petstore/php/SwaggerClient-php/README.md
+++ b/samples/client/petstore/php/SwaggerClient-php/README.md
@@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
- API version: 1.0.0
- Package version:
-- Build date: 2016-05-14T13:02:51.476+02:00
+- Build date: 2016-05-20T17:45:19.363+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements
@@ -112,6 +112,7 @@ Class | Method | HTTP request | Description
## Documentation For Models
+ - [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md)
- [Animal](docs/Model/Animal.md)
- [AnimalFarm](docs/Model/AnimalFarm.md)
- [ApiResponse](docs/Model/ApiResponse.md)
@@ -121,6 +122,7 @@ Class | Method | HTTP request | Description
- [EnumClass](docs/Model/EnumClass.md)
- [EnumTest](docs/Model/EnumTest.md)
- [FormatTest](docs/Model/FormatTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](docs/Model/Model200Response.md)
- [ModelReturn](docs/Model/ModelReturn.md)
- [Name](docs/Model/Name.md)
@@ -134,6 +136,12 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
+## api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
## petstore_auth
- **Type**: OAuth
@@ -143,12 +151,6 @@ Class | Method | HTTP request | Description
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
-## api_key
-
-- **Type**: API key
-- **API key parameter name**: api_key
-- **Location**: HTTP header
-
## Author
diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md
index 06f5dbf3b09..bf07517eac1 100644
--- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md
+++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md
@@ -68,8 +68,8 @@ No authorization required
### HTTP request headers
- - **Content-Type**: Not defined
- - **Accept**: application/xml, application/json
+ - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
+ - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php
index 63abb0c94b6..b8d5c48f552 100644
--- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php
+++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php
@@ -216,11 +216,11 @@ public function testEndpointParametersWithHttpInfo($number, $double, $string, $b
$queryParams = array();
$headerParams = array();
$formParams = array();
- $_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
+ $_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml; charset=utf-8', 'application/json; charset=utf-8'));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
- $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
+ $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/xml; charset=utf-8','application/json; charset=utf-8'));
diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php
index 6d656ac2b97..19165ad7bb3 100644
--- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php
+++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php
@@ -256,7 +256,7 @@ public static function deserialize($data, $class, $httpHeaders = null, $discrimi
} else {
return null;
}
- } elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
+ } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
settype($data, $class);
return $data;
} elseif ($class === '\SplFileObject') {
diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php
index 3433afad97e..a872ffe6c7e 100644
--- a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php
+++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php
@@ -67,6 +67,8 @@ public static function tearDownAfterClass()
*/
public function testEnumClass()
{
-
+ $this->assertSame(Swagger\Client\Model\EnumClass::ABC, "_abc");
+ $this->assertSame(Swagger\Client\Model\EnumClass::EFG, "-efg");
+ $this->assertSame(Swagger\Client\Model\EnumClass::XYZ, "(xyz)");
}
}
diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php
index ca6c82e10ac..2cf9956b8b4 100644
--- a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php
+++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php
@@ -67,6 +67,11 @@ public static function tearDownAfterClass()
*/
public function testEnumTest()
{
-
+ $this->assertSame(Swagger\Client\Model\EnumTest::ENUM_STRING_UPPER, "UPPER");
+ $this->assertSame(Swagger\Client\Model\EnumTest::ENUM_STRING_LOWER, "lower");
+ $this->assertSame(Swagger\Client\Model\EnumTest::ENUM_INTEGER_1, 1);
+ $this->assertSame(Swagger\Client\Model\EnumTest::ENUM_INTEGER_MINUS_1, -1);
+ $this->assertSame(Swagger\Client\Model\EnumTest::ENUM_NUMBER_1_DOT_1, 1.1);
+ $this->assertSame(Swagger\Client\Model\EnumTest::ENUM_NUMBER_MINUS_1_DOT_2, -1.2);
}
}
diff --git a/samples/client/petstore/ruby/.gitignore b/samples/client/petstore/ruby/.gitignore
index a8b1cda23f8..522134fcdd3 100644
--- a/samples/client/petstore/ruby/.gitignore
+++ b/samples/client/petstore/ruby/.gitignore
@@ -1,3 +1,17 @@
+# Generated by: https://github.com/swagger-api/swagger-codegen.git
+#
+# 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.
+
*.gem
*.rbc
/.config
diff --git a/samples/client/petstore/ruby/.swagger-codegen-ignore b/samples/client/petstore/ruby/.swagger-codegen-ignore
new file mode 100644
index 00000000000..19d3377182e
--- /dev/null
+++ b/samples/client/petstore/ruby/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/ruby/LICENSE b/samples/client/petstore/ruby/LICENSE
new file mode 100644
index 00000000000..8dada3edaf5
--- /dev/null
+++ b/samples/client/petstore/ruby/LICENSE
@@ -0,0 +1,201 @@
+ 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/ruby/README.md b/samples/client/petstore/ruby/README.md
index 1ff27c5eb29..1c3d604f206 100644
--- a/samples/client/petstore/ruby/README.md
+++ b/samples/client/petstore/ruby/README.md
@@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
- API version: 1.0.0
- Package version: 1.0.0
-- Build date: 2016-05-11T16:13:11.464+08:00
+- Build date: 2016-05-24T23:13:57.542+08:00
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
## Installation
@@ -116,6 +116,7 @@ Class | Method | HTTP request | Description
## Documentation for Models
+ - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [Petstore::Animal](docs/Animal.md)
- [Petstore::AnimalFarm](docs/AnimalFarm.md)
- [Petstore::ApiResponse](docs/ApiResponse.md)
@@ -125,11 +126,13 @@ Class | Method | HTTP request | Description
- [Petstore::EnumClass](docs/EnumClass.md)
- [Petstore::EnumTest](docs/EnumTest.md)
- [Petstore::FormatTest](docs/FormatTest.md)
+ - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Petstore::Model200Response](docs/Model200Response.md)
- [Petstore::ModelReturn](docs/ModelReturn.md)
- [Petstore::Name](docs/Name.md)
- [Petstore::Order](docs/Order.md)
- [Petstore::Pet](docs/Pet.md)
+ - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Petstore::SpecialModelName](docs/SpecialModelName.md)
- [Petstore::Tag](docs/Tag.md)
- [Petstore::User](docs/User.md)
@@ -138,6 +141,12 @@ Class | Method | HTTP request | Description
## Documentation for Authorization
+### api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
### petstore_auth
- **Type**: OAuth
@@ -147,9 +156,3 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account
- read:pets: read your pets
-### api_key
-
-- **Type**: API key
-- **API key parameter name**: api_key
-- **Location**: HTTP header
-
diff --git a/samples/client/petstore/ruby/docs/AdditionalPropertiesClass.md b/samples/client/petstore/ruby/docs/AdditionalPropertiesClass.md
new file mode 100644
index 00000000000..8c9c63a74a3
--- /dev/null
+++ b/samples/client/petstore/ruby/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,7 @@
+# Petstore::AdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+
diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md
index c0312e00f51..7b687dc67b9 100644
--- a/samples/client/petstore/ruby/docs/FakeApi.md
+++ b/samples/client/petstore/ruby/docs/FakeApi.md
@@ -75,8 +75,8 @@ No authorization required
### HTTP request headers
- - **Content-Type**: Not defined
- - **Accept**: application/xml, application/json
+ - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
+ - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
diff --git a/samples/client/petstore/ruby/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/ruby/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 00000000000..973c03c8396
--- /dev/null
+++ b/samples/client/petstore/ruby/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,9 @@
+# Petstore::MixedPropertiesAndAdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **String** | | [optional]
+**date_time** | **DateTime** | | [optional]
+
+
diff --git a/samples/client/petstore/ruby/docs/ReadOnlyFirst.md b/samples/client/petstore/ruby/docs/ReadOnlyFirst.md
new file mode 100644
index 00000000000..e49b5119478
--- /dev/null
+++ b/samples/client/petstore/ruby/docs/ReadOnlyFirst.md
@@ -0,0 +1,9 @@
+# Petstore::ReadOnlyFirst
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**baz** | **String** | | [optional]
+
+
diff --git a/samples/client/petstore/ruby/git_push.sh b/samples/client/petstore/ruby/git_push.sh
index 792320114fb..7e44b9aade1 100644
--- a/samples/client/petstore/ruby/git_push.sh
+++ b/samples/client/petstore/ruby/git_push.sh
@@ -1,4 +1,19 @@
#!/bin/sh
+#
+# Generated by: https://github.com/swagger-api/swagger-codegen.git
+#
+# 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.
+#
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb
index ce77b3d21b6..f4375e14a84 100644
--- a/samples/client/petstore/ruby/lib/petstore.rb
+++ b/samples/client/petstore/ruby/lib/petstore.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
@@ -21,6 +28,7 @@
require 'petstore/configuration'
# Models
+require 'petstore/models/additional_properties_class'
require 'petstore/models/animal'
require 'petstore/models/animal_farm'
require 'petstore/models/api_response'
@@ -30,11 +38,13 @@
require 'petstore/models/enum_class'
require 'petstore/models/enum_test'
require 'petstore/models/format_test'
+require 'petstore/models/mixed_properties_and_additional_properties_class'
require 'petstore/models/model_200_response'
require 'petstore/models/model_return'
require 'petstore/models/name'
require 'petstore/models/order'
require 'petstore/models/pet'
+require 'petstore/models/read_only_first'
require 'petstore/models/special_model_name'
require 'petstore/models/tag'
require 'petstore/models/user'
diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb
index e7e6e45c262..80f71d81b1a 100644
--- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb
+++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
@@ -131,11 +138,11 @@ def test_endpoint_parameters_with_http_info(number, double, string, byte, opts =
header_params = {}
# HTTP header 'Accept' (if needed)
- local_header_accept = ['application/xml', 'application/json']
+ local_header_accept = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
- local_header_content_type = []
+ local_header_content_type = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
# form parameters
diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb
index 2d7a12dfd2a..88dbcdfb662 100644
--- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb
+++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
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 2ef8b526c69..bf4ab2ec8db 100644
--- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb
+++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb
index bdecfa87ec2..3db9234ef90 100644
--- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb
+++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb
index 1723abbac42..2ecbea204f9 100644
--- a/samples/client/petstore/ruby/lib/petstore/api_client.rb
+++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb
index 95b1fc6cdb7..cf271ae8265 100644
--- a/samples/client/petstore/ruby/lib/petstore/api_error.rb
+++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb
index 0a67bae014f..92aeb4010eb 100644
--- a/samples/client/petstore/ruby/lib/petstore/configuration.rb
+++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb
@@ -1,3 +1,26 @@
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+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.
+
+=end
+
require 'uri'
module Petstore
@@ -157,13 +180,6 @@ def basic_auth_token
# Returns Auth Settings hash for api client.
def auth_settings
{
- 'petstore_auth' =>
- {
- type: 'oauth2',
- in: 'header',
- key: 'Authorization',
- value: "Bearer #{access_token}"
- },
'api_key' =>
{
type: 'api_key',
@@ -171,6 +187,13 @@ def auth_settings
key: 'api_key',
value: api_key_with_prefix('api_key')
},
+ 'petstore_auth' =>
+ {
+ type: 'oauth2',
+ in: 'header',
+ key: 'Authorization',
+ value: "Bearer #{access_token}"
+ },
}
end
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb
new file mode 100644
index 00000000000..6426f058398
--- /dev/null
+++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb
@@ -0,0 +1,188 @@
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+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.
+
+=end
+
+require 'date'
+
+module Petstore
+
+ class AdditionalPropertiesClass
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ }
+ end
+
+ # Attribute type mapping.
+ def self.swagger_types
+ {
+ }
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ return unless attributes.is_a?(Hash)
+
+ # convert string to symbol for hash key
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
+
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properies with the reasons
+ def list_invalid_properties
+ invalid_properties = Array.new
+ return invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Fixnum] Hash code
+ def hash
+ [].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ self.class.swagger_types.each_pair do |key, type|
+ if type =~ /^Array<(.*)>/i
+ # check to ensure the input is an array given that the the attribute
+ # is documented as an array but the input is not
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
+ end
+ elsif !attributes[self.class.attribute_map[key]].nil?
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
+ end
+
+ self
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def _deserialize(type, value)
+ case type.to_sym
+ when :DateTime
+ DateTime.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :BOOLEAN
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ temp_model = Petstore.const_get(type).new
+ temp_model.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ next if value.nil?
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map{ |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb
index 60edb0004a7..355df9f8c67 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class Animal
attr_accessor :class_name
@@ -200,4 +208,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb
index 3328854e56b..244a0ca62af 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class AnimalFarm
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
@@ -176,4 +184,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb
index 9bc6c7b7ae7..8f3c8ed3193 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class ApiResponse
attr_accessor :code
@@ -203,4 +211,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb
index 58f9bca969e..e277b6602bf 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class Cat
attr_accessor :class_name
@@ -209,4 +217,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb
index 0a0679c8e0a..da887681789 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/category.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class Category
attr_accessor :id
@@ -194,4 +202,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb
index 78738dfb323..f9db9ab7c50 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class Dog
attr_accessor :class_name
@@ -209,4 +217,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb
index b3601cc34c2..b5046df8f31 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
@@ -18,167 +25,10 @@
module Petstore
class EnumClass
- # Attribute mapping from ruby-style variable name to JSON key.
- def self.attribute_map
- {
- }
- end
-
- # Attribute type mapping.
- def self.swagger_types
- {
- }
- end
-
- # Initializes the object
- # @param [Hash] attributes Model attributes in the form of hash
- def initialize(attributes = {})
- return unless attributes.is_a?(Hash)
-
- # convert string to symbol for hash key
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
-
- end
-
- # Show invalid properties with the reasons. Usually used together with valid?
- # @return Array for valid properies with the reasons
- def list_invalid_properties
- invalid_properties = Array.new
- allowed_values = ["_abc", "-efg", "(xyz)"]
- if @EnumClass && !allowed_values.include?(EnumClass)
- invalid_properties.push("invalid value for 'EnumClass', must be one of #{allowed_values}.")
- end
-
- return invalid_properties
- end
-
- # Check to see if the all the properties in the model are valid
- # @return true if the model is valid
- def valid?
- end
-
- # Checks equality by comparing each attribute.
- # @param [Object] Object to be compared
- def ==(o)
- return true if self.equal?(o)
- self.class == o.class
- end
-
- # @see the `==` method
- # @param [Object] Object to be compared
- def eql?(o)
- self == o
- end
-
- # Calculates hash code according to all attributes.
- # @return [Fixnum] Hash code
- def hash
- [].hash
- end
-
- # Builds the object from hash
- # @param [Hash] attributes Model attributes in the form of hash
- # @return [Object] Returns the model itself
- def build_from_hash(attributes)
- return nil unless attributes.is_a?(Hash)
- self.class.swagger_types.each_pair do |key, type|
- if type =~ /^Array<(.*)>/i
- # check to ensure the input is an array given that the the attribute
- # is documented as an array but the input is not
- if attributes[self.class.attribute_map[key]].is_a?(Array)
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
- end
- elsif !attributes[self.class.attribute_map[key]].nil?
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
- end # or else data not found in attributes(hash), not an issue as the data can be optional
- end
-
- self
- end
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def _deserialize(type, value)
- case type.to_sym
- when :DateTime
- DateTime.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :BOOLEAN
- if value.to_s =~ /^(true|t|yes|y|1)$/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- temp_model = Petstore.const_get(type).new
- temp_model.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_hash
- end
-
- # Returns the object in the form of hash
- # @return [Hash] Returns the object in the form of hash
- def to_hash
- hash = {}
- self.class.attribute_map.each_pair do |attr, param|
- value = self.send(attr)
- next if value.nil?
- hash[param] = _to_hash(value)
- end
- hash
- end
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map{ |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
-
+
+ ABC = "_abc".freeze
+ EFG = "-efg".freeze
+ XYZ = "(xyz)".freeze
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb
index 31a75aebb8b..f4d85b99357 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class EnumTest
attr_accessor :enum_string
@@ -245,4 +253,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb
index bd6a02d4a73..63107bd2128 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class FormatTest
attr_accessor :integer
@@ -483,4 +491,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb
new file mode 100644
index 00000000000..8208fc64638
--- /dev/null
+++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb
@@ -0,0 +1,206 @@
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+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.
+
+=end
+
+require 'date'
+
+module Petstore
+
+ class MixedPropertiesAndAdditionalPropertiesClass
+ attr_accessor :uuid
+
+ attr_accessor :date_time
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'uuid' => :'uuid',
+ :'date_time' => :'dateTime'
+ }
+ end
+
+ # Attribute type mapping.
+ def self.swagger_types
+ {
+ :'uuid' => :'String',
+ :'date_time' => :'DateTime'
+ }
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ return unless attributes.is_a?(Hash)
+
+ # convert string to symbol for hash key
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
+
+ if attributes.has_key?(:'uuid')
+ self.uuid = attributes[:'uuid']
+ end
+
+ if attributes.has_key?(:'dateTime')
+ self.date_time = attributes[:'dateTime']
+ end
+
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properies with the reasons
+ def list_invalid_properties
+ invalid_properties = Array.new
+ return invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ uuid == o.uuid &&
+ date_time == o.date_time
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Fixnum] Hash code
+ def hash
+ [uuid, date_time].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ self.class.swagger_types.each_pair do |key, type|
+ if type =~ /^Array<(.*)>/i
+ # check to ensure the input is an array given that the the attribute
+ # is documented as an array but the input is not
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
+ end
+ elsif !attributes[self.class.attribute_map[key]].nil?
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
+ end
+
+ self
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def _deserialize(type, value)
+ case type.to_sym
+ when :DateTime
+ DateTime.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :BOOLEAN
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ temp_model = Petstore.const_get(type).new
+ temp_model.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ next if value.nil?
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map{ |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb
index 15675e5dd22..186f46f6b3f 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
@@ -186,4 +193,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb
index 06150419de3..595b1c76bec 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
@@ -186,4 +193,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb
index 01d3910b948..d063138e41b 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/name.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
@@ -217,4 +224,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb
index 4aefb422eb6..5dd15cbe92d 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/order.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class Order
attr_accessor :id
@@ -247,4 +255,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb
index b2432b09e5e..81330cf5c56 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class Pet
attr_accessor :id
@@ -257,4 +265,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb
new file mode 100644
index 00000000000..4f8b79f225e
--- /dev/null
+++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb
@@ -0,0 +1,206 @@
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+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.
+
+=end
+
+require 'date'
+
+module Petstore
+
+ class ReadOnlyFirst
+ attr_accessor :bar
+
+ attr_accessor :baz
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'bar' => :'bar',
+ :'baz' => :'baz'
+ }
+ end
+
+ # Attribute type mapping.
+ def self.swagger_types
+ {
+ :'bar' => :'String',
+ :'baz' => :'String'
+ }
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ return unless attributes.is_a?(Hash)
+
+ # convert string to symbol for hash key
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
+
+ if attributes.has_key?(:'bar')
+ self.bar = attributes[:'bar']
+ end
+
+ if attributes.has_key?(:'baz')
+ self.baz = attributes[:'baz']
+ end
+
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properies with the reasons
+ def list_invalid_properties
+ invalid_properties = Array.new
+ return invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ bar == o.bar &&
+ baz == o.baz
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Fixnum] Hash code
+ def hash
+ [bar, baz].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ self.class.swagger_types.each_pair do |key, type|
+ if type =~ /^Array<(.*)>/i
+ # check to ensure the input is an array given that the the attribute
+ # is documented as an array but the input is not
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
+ end
+ elsif !attributes[self.class.attribute_map[key]].nil?
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
+ end
+
+ self
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def _deserialize(type, value)
+ case type.to_sym
+ when :DateTime
+ DateTime.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :BOOLEAN
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ temp_model = Petstore.const_get(type).new
+ temp_model.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ next if value.nil?
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map{ |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb
index caf84588f22..d888b01cd05 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class SpecialModelName
attr_accessor :special_property_name
@@ -185,4 +193,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb
index b47fc2f86e9..bc587aabb83 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class Tag
attr_accessor :id
@@ -194,4 +202,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb
index da720b1f559..fa311a5b123 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/user.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb
@@ -7,16 +7,24 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
require 'date'
module Petstore
+
class User
attr_accessor :id
@@ -249,4 +257,5 @@ def _to_hash(value)
end
end
+
end
diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb
index e5c868d3d09..58d992d9c27 100644
--- a/samples/client/petstore/ruby/lib/petstore/version.rb
+++ b/samples/client/petstore/ruby/lib/petstore/version.rb
@@ -7,10 +7,17 @@
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
-License: Apache 2.0
-http://www.apache.org/licenses/LICENSE-2.0.html
+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
-Terms of Service: http://swagger.io/terms/
+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.
=end
diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec
index 66258d1ff5c..f52a27ba00f 100644
--- a/samples/client/petstore/ruby/petstore.gemspec
+++ b/samples/client/petstore/ruby/petstore.gemspec
@@ -1,4 +1,28 @@
# -*- encoding: utf-8 -*-
+#
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+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.
+
+=end
+
$:.push File.expand_path("../lib", __FILE__)
require "petstore/version"
diff --git a/samples/client/petstore/ruby/spec/.spec_helper.rb b/samples/client/petstore/ruby/spec/.spec_helper.rb
new file mode 100644
index 00000000000..50702c439b7
--- /dev/null
+++ b/samples/client/petstore/ruby/spec/.spec_helper.rb
@@ -0,0 +1,71 @@
+require 'rubygems'
+require 'bundler/setup'
+require 'petstore'
+require 'vcr'
+require 'typhoeus'
+require 'json'
+require 'yaml'
+require 'rspec'
+
+RSpec.configure do |config|
+ # some (optional) config here
+ config.expect_with :rspec do |c|
+ c.syntax = :should
+ end
+ config.mock_with :rspec do |c|
+ c.syntax = :should
+ end
+end
+
+
+WebMock.allow_net_connect! if defined? WebMock
+
+def help
+ puts "\nOh noes! You gotta stuff your swagger credentials in ~/.swagger.yml like so:\n\n"
+ puts "api_key: '12345abcdefg'"
+ puts "username: 'fumanchu'"
+ puts "password: 'kalamazoo'\n\n"
+ exit
+end
+
+# no longer reading credentials (not used) from file (20150413)
+# Parse ~/.swagger.yml for user credentials
+#begin
+# CREDENTIALS = YAML::load_file(File.join(ENV['HOME'], ".swagger.yml")).symbolize_keys
+#rescue
+# help
+#end
+
+API_CLIENT = Petstore::ApiClient.new(Petstore::Configuration.new)
+
+def random_id
+ rand(1000000) + 20000
+end
+
+# create a random pet, return its id
+def prepare_pet(pet_api)
+ pet_id = random_id
+ category = Petstore::Category.new('id' => 20002, 'name' => 'category test')
+ tag = Petstore::Tag.new('id' => 30002, 'name' => 'tag test')
+ pet = Petstore::Pet.new('id' => pet_id, 'name' => "RUBY UNIT TESTING", 'photo_urls' => 'photo url',
+ 'category' => category, 'tags' => [tag], 'status' => 'pending')
+ pet_api.add_pet(pet)
+ return pet_id
+end
+
+# create a random order, return its id
+def prepare_store(store_api)
+ order_id = 5
+ order = Petstore::Order.new("id" => order_id,
+ "petId" => 123,
+ "quantity" => 789,
+ "shipDate" => "2015-04-06T23:42:01.678Z",
+ "status" => "placed",
+ "complete" => false)
+ store_api.place_order(order)
+ return order_id
+end
+
+# A random string to tack onto stuff to ensure we're not seeing
+# data from a previous test run
+RAND = ("a".."z").to_a.sample(8).join
diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb
new file mode 100644
index 00000000000..edf0371b127
--- /dev/null
+++ b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb
@@ -0,0 +1,40 @@
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+License: Apache 2.0
+http://www.apache.org/licenses/LICENSE-2.0.html
+
+Terms of Service: http://swagger.io/terms/
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for Petstore::AdditionalPropertiesClass
+# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
+# Please update as you see appropriate
+describe 'AdditionalPropertiesClass' do
+ before do
+ # run before each test
+ @instance = Petstore::AdditionalPropertiesClass.new
+ end
+
+ after do
+ # run after each test
+ end
+
+ describe 'test an instance of AdditionalPropertiesClass' do
+ it 'should create an instact of AdditionalPropertiesClass' do
+ expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass)
+ end
+ end
+end
+
diff --git a/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb
new file mode 100644
index 00000000000..f1f9c33d78f
--- /dev/null
+++ b/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb
@@ -0,0 +1,52 @@
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+License: Apache 2.0
+http://www.apache.org/licenses/LICENSE-2.0.html
+
+Terms of Service: http://swagger.io/terms/
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for Petstore::MixedPropertiesAndAdditionalPropertiesClass
+# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
+# Please update as you see appropriate
+describe 'MixedPropertiesAndAdditionalPropertiesClass' do
+ before do
+ # run before each test
+ @instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new
+ end
+
+ after do
+ # run after each test
+ end
+
+ describe 'test an instance of MixedPropertiesAndAdditionalPropertiesClass' do
+ it 'should create an instact of MixedPropertiesAndAdditionalPropertiesClass' do
+ expect(@instance).to be_instance_of(Petstore::MixedPropertiesAndAdditionalPropertiesClass)
+ end
+ end
+ describe 'test attribute "uuid"' do
+ it 'should work' do
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
+ end
+ end
+
+ describe 'test attribute "date_time"' do
+ it 'should work' do
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
+ end
+ end
+
+end
+
diff --git a/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb
new file mode 100644
index 00000000000..ab631729310
--- /dev/null
+++ b/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb
@@ -0,0 +1,52 @@
+=begin
+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
+Generated by: https://github.com/swagger-api/swagger-codegen.git
+
+License: Apache 2.0
+http://www.apache.org/licenses/LICENSE-2.0.html
+
+Terms of Service: http://swagger.io/terms/
+
+=end
+
+require 'spec_helper'
+require 'json'
+require 'date'
+
+# Unit tests for Petstore::ReadOnlyFirst
+# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
+# Please update as you see appropriate
+describe 'ReadOnlyFirst' do
+ before do
+ # run before each test
+ @instance = Petstore::ReadOnlyFirst.new
+ end
+
+ after do
+ # run after each test
+ end
+
+ describe 'test an instance of ReadOnlyFirst' do
+ it 'should create an instact of ReadOnlyFirst' do
+ expect(@instance).to be_instance_of(Petstore::ReadOnlyFirst)
+ end
+ end
+ describe 'test attribute "bar"' do
+ it 'should work' do
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
+ end
+ end
+
+ describe 'test attribute "baz"' do
+ it 'should work' do
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
+ end
+ end
+
+end
+
diff --git a/samples/client/petstore/swift-promisekit/.gitignore b/samples/client/petstore/swift-promisekit/.gitignore
new file mode 100644
index 00000000000..5e5d5cebcf4
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/.gitignore
@@ -0,0 +1,63 @@
+# Xcode
+#
+# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
+
+## Build generated
+build/
+DerivedData
+
+## Various settings
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata
+
+## Other
+*.xccheckout
+*.moved-aside
+*.xcuserstate
+*.xcscmblueprint
+
+## Obj-C/Swift specific
+*.hmap
+*.ipa
+
+## Playgrounds
+timeline.xctimeline
+playground.xcworkspace
+
+# Swift Package Manager
+#
+# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
+# Packages/
+.build/
+
+# CocoaPods
+#
+# We recommend against adding the Pods directory to your .gitignore. However
+# you should judge for yourself, the pros and cons are mentioned at:
+# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
+#
+# Pods/
+
+# Carthage
+#
+# Add this line if you want to avoid checking in source code from Carthage dependencies.
+# Carthage/Checkouts
+
+Carthage/Build
+
+# fastlane
+#
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# screenshots whenever they are needed.
+# For more information about the recommended setup visit:
+# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
+
+fastlane/report.xml
+fastlane/screenshots
diff --git a/samples/client/petstore/swift-promisekit/Cartfile b/samples/client/petstore/swift-promisekit/Cartfile
new file mode 100644
index 00000000000..5e4bd352eef
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/Cartfile
@@ -0,0 +1,2 @@
+github "Alamofire/Alamofire" >= 3.1.0
+github "mxcl/PromiseKit" >=1.5.3
diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient.podspec b/samples/client/petstore/swift-promisekit/PetstoreClient.podspec
new file mode 100644
index 00000000000..b4eccbce888
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/PetstoreClient.podspec
@@ -0,0 +1,14 @@
+Pod::Spec.new do |s|
+ s.name = 'PetstoreClient'
+ s.ios.deployment_target = '8.0'
+ s.osx.deployment_target = '10.9'
+ s.version = '0.0.1'
+ s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' }
+ s.authors =
+ s.license = 'Apache License, Version 2.0'
+ s.homepage = 'https://github.com/swagger-api/swagger-codegen'
+ s.summary = 'PetstoreClient'
+ s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
+ s.dependency 'PromiseKit', '~> 3.1.1'
+ s.dependency 'Alamofire', '~> 3.1.5'
+end
diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift
new file mode 100644
index 00000000000..7041709f365
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift
@@ -0,0 +1,39 @@
+// APIHelper.swift
+//
+// Generated by swagger-codegen
+// https://github.com/swagger-api/swagger-codegen
+//
+
+class APIHelper {
+ static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? {
+ var destination = [String:AnyObject]()
+ for (key, nillableValue) in source {
+ if let value: AnyObject = nillableValue {
+ destination[key] = value
+ }
+ }
+
+ if destination.isEmpty {
+ return nil
+ }
+ return destination
+ }
+
+ static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject] {
+ var destination = [String:AnyObject]()
+ let theTrue = NSNumber(bool: true)
+ let theFalse = NSNumber(bool: false)
+ if (source != nil) {
+ for (key, value) in source! {
+ switch value {
+ case let x where x === theTrue || x === theFalse:
+ destination[key] = "\(value as! Bool)"
+ default:
+ destination[key] = value
+ }
+ }
+ }
+ return destination
+ }
+
+}
diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs.swift
new file mode 100644
index 00000000000..96eead0d8dd
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs.swift
@@ -0,0 +1,73 @@
+// APIs.swift
+//
+// Generated by swagger-codegen
+// https://github.com/swagger-api/swagger-codegen
+//
+
+import Foundation
+
+public class PetstoreClientAPI {
+ public static var basePath = "http://petstore.swagger.io/v2"
+ public static var credential: NSURLCredential?
+ public static var customHeaders: [String:String] = [:]
+ static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory()
+}
+
+public class APIBase {
+ func toParameters(encodable: JSONEncodable?) -> [String: AnyObject]? {
+ let encoded: AnyObject? = encodable?.encodeToJSON()
+
+ if encoded! is [AnyObject] {
+ var dictionary = [String:AnyObject]()
+ for (index, item) in (encoded as! [AnyObject]).enumerate() {
+ dictionary["\(index)"] = item
+ }
+ return dictionary
+ } else {
+ return encoded as? [String:AnyObject]
+ }
+ }
+}
+
+public class RequestBuilder {
+ var credential: NSURLCredential?
+ var headers: [String:String] = [:]
+ let parameters: [String:AnyObject]?
+ let isBody: Bool
+ let method: String
+ let URLString: String
+
+ required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool) {
+ self.method = method
+ self.URLString = URLString
+ self.parameters = parameters
+ self.isBody = isBody
+
+ addHeaders(PetstoreClientAPI.customHeaders)
+ }
+
+ public func addHeaders(aHeaders:[String:String]) {
+ for (header, value) in aHeaders {
+ headers[header] = value
+ }
+ }
+
+ public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { }
+
+ public func addHeader(name name: String, value: String) -> Self {
+ if !value.isEmpty {
+ headers[name] = value
+ }
+ return self
+ }
+
+ public func addCredential() -> Self {
+ self.credential = PetstoreClientAPI.credential
+ return self
+ }
+}
+
+protocol RequestBuilderFactory {
+ func getBuilder() -> RequestBuilder.Type
+}
+
diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift
new file mode 100644
index 00000000000..27000da5417
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift
@@ -0,0 +1,592 @@
+//
+// PetAPI.swift
+//
+// Generated by swagger-codegen
+// https://github.com/swagger-api/swagger-codegen
+//
+
+import Alamofire
+import PromiseKit
+
+
+
+public class PetAPI: APIBase {
+ /**
+ Add a new pet to the store
+
+ - parameter body: (body) Pet object that needs to be added to the store (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) {
+ addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Add a new pet to the store
+
+ - parameter body: (body) Pet object that needs to be added to the store (optional)
+ - returns: Promise
+ */
+ public class func addPet(body body: Pet? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ addPet(body: body) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Add a new pet to the store
+ - POST /pet
+ -
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+
+ - parameter body: (body) Pet object that needs to be added to the store (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder {
+ let path = "/pet"
+ let URLString = PetstoreClientAPI.basePath + path
+ let parameters = body?.encodeToJSON() as? [String:AnyObject]
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Deletes a pet
+
+ - parameter petId: (path) Pet id to delete
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func deletePet(petId petId: Int64, completion: ((error: ErrorType?) -> Void)) {
+ deletePetWithRequestBuilder(petId: petId).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Deletes a pet
+
+ - parameter petId: (path) Pet id to delete
+ - returns: Promise
+ */
+ public class func deletePet(petId petId: Int64) -> Promise {
+ let deferred = Promise.pendingPromise()
+ deletePet(petId: petId) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Deletes a pet
+ - DELETE /pet/{petId}
+ -
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+
+ - parameter petId: (path) Pet id to delete
+
+ - returns: RequestBuilder
+ */
+ public class func deletePetWithRequestBuilder(petId petId: Int64) -> RequestBuilder {
+ var path = "/pet/{petId}"
+ path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [:]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Finds Pets by status
+
+ - parameter status: (query) Status values that need to be considered for filter (optional, default to available)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) {
+ findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Finds Pets by status
+
+ - parameter status: (query) Status values that need to be considered for filter (optional, default to available)
+ - returns: Promise<[Pet]>
+ */
+ public class func findPetsByStatus(status status: [String]? = nil) -> Promise<[Pet]> {
+ let deferred = Promise<[Pet]>.pendingPromise()
+ findPetsByStatus(status: status) { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Finds Pets by status
+ - GET /pet/findByStatus
+ - Multiple status values can be provided with comma seperated strings
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+ - examples: [{contentType=application/json, example={
+ "name" : "Puma",
+ "type" : "Dog",
+ "color" : "Black",
+ "gender" : "Female",
+ "breed" : "Mixed"
+}}]
+
+ - parameter status: (query) Status values that need to be considered for filter (optional, default to available)
+
+ - returns: RequestBuilder<[Pet]>
+ */
+ public class func findPetsByStatusWithRequestBuilder(status status: [String]? = nil) -> RequestBuilder<[Pet]> {
+ let path = "/pet/findByStatus"
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [
+ "status": status
+ ]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false)
+ }
+
+ /**
+ Finds Pets by tags
+
+ - parameter tags: (query) Tags to filter by (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) {
+ findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Finds Pets by tags
+
+ - parameter tags: (query) Tags to filter by (optional)
+ - returns: Promise<[Pet]>
+ */
+ public class func findPetsByTags(tags tags: [String]? = nil) -> Promise<[Pet]> {
+ let deferred = Promise<[Pet]>.pendingPromise()
+ findPetsByTags(tags: tags) { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Finds Pets by tags
+ - GET /pet/findByTags
+ - Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+ - examples: [{contentType=application/json, example=[ {
+ "photoUrls" : [ "aeiou" ],
+ "name" : "doggie",
+ "id" : 123456789,
+ "category" : {
+ "name" : "aeiou",
+ "id" : 123456789
+ },
+ "tags" : [ {
+ "name" : "aeiou",
+ "id" : 123456789
+ } ],
+ "status" : "aeiou"
+} ]}, {contentType=application/xml, example=
+ 123456
+ doggie
+
+ string
+
+
+
+ string
+}]
+ - examples: [{contentType=application/json, example=[ {
+ "photoUrls" : [ "aeiou" ],
+ "name" : "doggie",
+ "id" : 123456789,
+ "category" : {
+ "name" : "aeiou",
+ "id" : 123456789
+ },
+ "tags" : [ {
+ "name" : "aeiou",
+ "id" : 123456789
+ } ],
+ "status" : "aeiou"
+} ]}, {contentType=application/xml, example=
+ 123456
+ doggie
+
+ string
+
+
+
+ string
+}]
+
+ - parameter tags: (query) Tags to filter by (optional)
+
+ - returns: RequestBuilder<[Pet]>
+ */
+ public class func findPetsByTagsWithRequestBuilder(tags tags: [String]? = nil) -> RequestBuilder<[Pet]> {
+ let path = "/pet/findByTags"
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [
+ "tags": tags
+ ]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false)
+ }
+
+ /**
+ Find pet by ID
+
+ - parameter petId: (path) ID of pet that needs to be fetched
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) {
+ getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Find pet by ID
+
+ - parameter petId: (path) ID of pet that needs to be fetched
+ - returns: Promise
+ */
+ public class func getPetById(petId petId: Int64) -> Promise {
+ let deferred = Promise.pendingPromise()
+ getPetById(petId: petId) { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Find pet by ID
+ - GET /pet/{petId}
+ - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+ - API Key:
+ - type: apiKey api_key
+ - name: api_key
+ - examples: [{contentType=application/json, example={
+ "photoUrls" : [ "aeiou" ],
+ "name" : "doggie",
+ "id" : 123456789,
+ "category" : {
+ "name" : "aeiou",
+ "id" : 123456789
+ },
+ "tags" : [ {
+ "name" : "aeiou",
+ "id" : 123456789
+ } ],
+ "status" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ doggie
+
+ string
+
+
+
+ string
+}]
+ - examples: [{contentType=application/json, example={
+ "photoUrls" : [ "aeiou" ],
+ "name" : "doggie",
+ "id" : 123456789,
+ "category" : {
+ "name" : "aeiou",
+ "id" : 123456789
+ },
+ "tags" : [ {
+ "name" : "aeiou",
+ "id" : 123456789
+ } ],
+ "status" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ doggie
+
+ string
+
+
+
+ string
+}]
+
+ - parameter petId: (path) ID of pet that needs to be fetched
+
+ - returns: RequestBuilder
+ */
+ public class func getPetByIdWithRequestBuilder(petId petId: Int64) -> RequestBuilder {
+ var path = "/pet/{petId}"
+ path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [:]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Update an existing pet
+
+ - parameter body: (body) Pet object that needs to be added to the store (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) {
+ updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Update an existing pet
+
+ - parameter body: (body) Pet object that needs to be added to the store (optional)
+ - returns: Promise
+ */
+ public class func updatePet(body body: Pet? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ updatePet(body: body) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Update an existing pet
+ - PUT /pet
+ -
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+
+ - parameter body: (body) Pet object that needs to be added to the store (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder {
+ let path = "/pet"
+ let URLString = PetstoreClientAPI.basePath + path
+ let parameters = body?.encodeToJSON() as? [String:AnyObject]
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Updates a pet in the store with form data
+
+ - parameter petId: (path) ID of pet that needs to be updated
+ - parameter name: (form) Updated name of the pet (optional)
+ - parameter status: (form) Updated status of the pet (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) {
+ updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Updates a pet in the store with form data
+
+ - parameter petId: (path) ID of pet that needs to be updated
+ - parameter name: (form) Updated name of the pet (optional)
+ - parameter status: (form) Updated status of the pet (optional)
+ - returns: Promise
+ */
+ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ updatePetWithForm(petId: petId, name: name, status: status) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Updates a pet in the store with form data
+ - POST /pet/{petId}
+ -
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+
+ - parameter petId: (path) ID of pet that needs to be updated
+ - parameter name: (form) Updated name of the pet (optional)
+ - parameter status: (form) Updated status of the pet (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func updatePetWithFormWithRequestBuilder(petId petId: String, name: String? = nil, status: String? = nil) -> RequestBuilder {
+ var path = "/pet/{petId}"
+ path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [
+ "name": name,
+ "status": status
+ ]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false)
+ }
+
+ /**
+ uploads an image
+
+ - parameter petId: (path) ID of pet to update
+ - parameter additionalMetadata: (form) Additional data to pass to server (optional)
+ - parameter file: (form) file to upload (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) {
+ uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ uploads an image
+
+ - parameter petId: (path) ID of pet to update
+ - parameter additionalMetadata: (form) Additional data to pass to server (optional)
+ - parameter file: (form) file to upload (optional)
+ - returns: Promise
+ */
+ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ uploads an image
+ - POST /pet/{petId}/uploadImage
+ -
+ - OAuth:
+ - type: oauth2
+ - name: petstore_auth
+
+ - parameter petId: (path) ID of pet to update
+ - parameter additionalMetadata: (form) Additional data to pass to server (optional)
+ - parameter file: (form) file to upload (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func uploadFileWithRequestBuilder(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil) -> RequestBuilder {
+ var path = "/pet/{petId}/uploadImage"
+ path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [
+ "additionalMetadata": additionalMetadata,
+ "file": file
+ ]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false)
+ }
+
+}
diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift
new file mode 100644
index 00000000000..da40486b292
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift
@@ -0,0 +1,294 @@
+//
+// StoreAPI.swift
+//
+// Generated by swagger-codegen
+// https://github.com/swagger-api/swagger-codegen
+//
+
+import Alamofire
+import PromiseKit
+
+
+
+public class StoreAPI: APIBase {
+ /**
+ Delete purchase order by ID
+
+ - parameter orderId: (path) ID of the order that needs to be deleted
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) {
+ deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Delete purchase order by ID
+
+ - parameter orderId: (path) ID of the order that needs to be deleted
+ - returns: Promise
+ */
+ public class func deleteOrder(orderId orderId: String) -> Promise {
+ let deferred = Promise.pendingPromise()
+ deleteOrder(orderId: orderId) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Delete purchase order by ID
+ - DELETE /store/order/{orderId}
+ - 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
+
+ - returns: RequestBuilder
+ */
+ public class func deleteOrderWithRequestBuilder(orderId orderId: String) -> RequestBuilder {
+ var path = "/store/order/{orderId}"
+ path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [:]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Returns pet inventories by status
+
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func getInventory(completion: ((data: [String:Int32]?, error: ErrorType?) -> Void)) {
+ getInventoryWithRequestBuilder().execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Returns pet inventories by status
+
+ - returns: Promise<[String:Int32]>
+ */
+ public class func getInventory() -> Promise<[String:Int32]> {
+ let deferred = Promise<[String:Int32]>.pendingPromise()
+ getInventory() { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Returns pet inventories by status
+ - GET /store/inventory
+ - Returns a map of status codes to quantities
+ - API Key:
+ - type: apiKey api_key
+ - name: api_key
+ - examples: [{contentType=application/json, example={
+ "key" : 123
+}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
+ - examples: [{contentType=application/json, example={
+ "key" : 123
+}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}]
+
+ - returns: RequestBuilder<[String:Int32]>
+ */
+ public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> {
+ let path = "/store/inventory"
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [:]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Find purchase order by ID
+
+ - parameter orderId: (path) ID of pet that needs to be fetched
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) {
+ getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Find purchase order by ID
+
+ - parameter orderId: (path) ID of pet that needs to be fetched
+ - returns: Promise
+ */
+ public class func getOrderById(orderId orderId: String) -> Promise {
+ let deferred = Promise.pendingPromise()
+ getOrderById(orderId: orderId) { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Find purchase order by ID
+ - GET /store/order/{orderId}
+ - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ - examples: [{contentType=application/json, example={
+ "petId" : 123456789,
+ "quantity" : 123,
+ "id" : 123456789,
+ "shipDate" : "2000-01-23T04:56:07.000+0000",
+ "complete" : true,
+ "status" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ 123456
+ 0
+ 2000-01-23T04:56:07.000Z
+ string
+ true
+}]
+ - examples: [{contentType=application/json, example={
+ "petId" : 123456789,
+ "quantity" : 123,
+ "id" : 123456789,
+ "shipDate" : "2000-01-23T04:56:07.000+0000",
+ "complete" : true,
+ "status" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ 123456
+ 0
+ 2000-01-23T04:56:07.000Z
+ string
+ true
+}]
+
+ - parameter orderId: (path) ID of pet that needs to be fetched
+
+ - returns: RequestBuilder
+ */
+ public class func getOrderByIdWithRequestBuilder(orderId orderId: String) -> RequestBuilder {
+ var path = "/store/order/{orderId}"
+ path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [:]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Place an order for a pet
+
+ - parameter body: (body) order placed for purchasing the pet (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) {
+ placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Place an order for a pet
+
+ - parameter body: (body) order placed for purchasing the pet (optional)
+ - returns: Promise
+ */
+ public class func placeOrder(body body: Order? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ placeOrder(body: body) { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Place an order for a pet
+ - POST /store/order
+ -
+ - examples: [{contentType=application/json, example={
+ "petId" : 123456789,
+ "quantity" : 123,
+ "id" : 123456789,
+ "shipDate" : "2000-01-23T04:56:07.000+0000",
+ "complete" : true,
+ "status" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ 123456
+ 0
+ 2000-01-23T04:56:07.000Z
+ string
+ true
+}]
+ - examples: [{contentType=application/json, example={
+ "petId" : 123456789,
+ "quantity" : 123,
+ "id" : 123456789,
+ "shipDate" : "2000-01-23T04:56:07.000+0000",
+ "complete" : true,
+ "status" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ 123456
+ 0
+ 2000-01-23T04:56:07.000Z
+ string
+ true
+}]
+
+ - parameter body: (body) order placed for purchasing the pet (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder {
+ let path = "/store/order"
+ let URLString = PetstoreClientAPI.basePath + path
+ let parameters = body?.encodeToJSON() as? [String:AnyObject]
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+}
diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift
new file mode 100644
index 00000000000..98afec0c80a
--- /dev/null
+++ b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift
@@ -0,0 +1,482 @@
+//
+// UserAPI.swift
+//
+// Generated by swagger-codegen
+// https://github.com/swagger-api/swagger-codegen
+//
+
+import Alamofire
+import PromiseKit
+
+
+
+public class UserAPI: APIBase {
+ /**
+ Create user
+
+ - parameter body: (body) Created user object (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) {
+ createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Create user
+
+ - parameter body: (body) Created user object (optional)
+ - returns: Promise
+ */
+ public class func createUser(body body: User? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ createUser(body: body) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Create user
+ - POST /user
+ - This can only be done by the logged in user.
+
+ - parameter body: (body) Created user object (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder {
+ let path = "/user"
+ let URLString = PetstoreClientAPI.basePath + path
+ let parameters = body?.encodeToJSON() as? [String:AnyObject]
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Creates list of users with given input array
+
+ - parameter body: (body) List of user object (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) {
+ createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Creates list of users with given input array
+
+ - parameter body: (body) List of user object (optional)
+ - returns: Promise
+ */
+ public class func createUsersWithArrayInput(body body: [User]? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ createUsersWithArrayInput(body: body) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Creates list of users with given input array
+ - POST /user/createWithArray
+ -
+
+ - parameter body: (body) List of user object (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder {
+ let path = "/user/createWithArray"
+ let URLString = PetstoreClientAPI.basePath + path
+ let parameters = body?.encodeToJSON() as? [String:AnyObject]
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Creates list of users with given input array
+
+ - parameter body: (body) List of user object (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) {
+ createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Creates list of users with given input array
+
+ - parameter body: (body) List of user object (optional)
+ - returns: Promise
+ */
+ public class func createUsersWithListInput(body body: [User]? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ createUsersWithListInput(body: body) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Creates list of users with given input array
+ - POST /user/createWithList
+ -
+
+ - parameter body: (body) List of user object (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder {
+ let path = "/user/createWithList"
+ let URLString = PetstoreClientAPI.basePath + path
+ let parameters = body?.encodeToJSON() as? [String:AnyObject]
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Delete user
+
+ - parameter username: (path) The name that needs to be deleted
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) {
+ deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Delete user
+
+ - parameter username: (path) The name that needs to be deleted
+ - returns: Promise
+ */
+ public class func deleteUser(username username: String) -> Promise {
+ let deferred = Promise.pendingPromise()
+ deleteUser(username: username) { error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill()
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Delete user
+ - DELETE /user/{username}
+ - This can only be done by the logged in user.
+
+ - parameter username: (path) The name that needs to be deleted
+
+ - returns: RequestBuilder
+ */
+ public class func deleteUserWithRequestBuilder(username username: String) -> RequestBuilder {
+ var path = "/user/{username}"
+ path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [:]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Get user by user name
+
+ - parameter username: (path) The name that needs to be fetched. Use user1 for testing.
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) {
+ getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Get user by user name
+
+ - parameter username: (path) The name that needs to be fetched. Use user1 for testing.
+ - returns: Promise
+ */
+ public class func getUserByName(username username: String) -> Promise {
+ let deferred = Promise.pendingPromise()
+ getUserByName(username: username) { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Get user by user name
+ - GET /user/{username}
+ -
+ - examples: [{contentType=application/json, example={
+ "firstName" : "aeiou",
+ "lastName" : "aeiou",
+ "password" : "aeiou",
+ "userStatus" : 123,
+ "phone" : "aeiou",
+ "id" : 123456789,
+ "email" : "aeiou",
+ "username" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ string
+ string
+ string
+ string
+ string
+ string
+ 0
+}]
+ - examples: [{contentType=application/json, example={
+ "firstName" : "aeiou",
+ "lastName" : "aeiou",
+ "password" : "aeiou",
+ "userStatus" : 123,
+ "phone" : "aeiou",
+ "id" : 123456789,
+ "email" : "aeiou",
+ "username" : "aeiou"
+}}, {contentType=application/xml, example=
+ 123456
+ string
+ string
+ string
+ string
+ string
+ string
+ 0
+}]
+
+ - parameter username: (path) The name that needs to be fetched. Use user1 for testing.
+
+ - returns: RequestBuilder
+ */
+ public class func getUserByNameWithRequestBuilder(username username: String) -> RequestBuilder {
+ var path = "/user/{username}"
+ path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil)
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [:]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true)
+ }
+
+ /**
+ Logs user into the system
+
+ - parameter username: (query) The user name for login (optional)
+ - parameter password: (query) The password for login in clear text (optional)
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) {
+ loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in
+ completion(data: response?.body, error: error);
+ }
+ }
+
+ /**
+ Logs user into the system
+
+ - parameter username: (query) The user name for login (optional)
+ - parameter password: (query) The password for login in clear text (optional)
+ - returns: Promise
+ */
+ public class func loginUser(username username: String? = nil, password: String? = nil) -> Promise {
+ let deferred = Promise.pendingPromise()
+ loginUser(username: username, password: password) { data, error in
+ if let error = error {
+ deferred.reject(error)
+ } else {
+ deferred.fulfill(data!)
+ }
+ }
+ return deferred.promise
+ }
+
+ /**
+ Logs user into the system
+ - GET /user/login
+ -
+ - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
+ - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}]
+
+ - parameter username: (query) The user name for login (optional)
+ - parameter password: (query) The password for login in clear text (optional)
+
+ - returns: RequestBuilder
+ */
+ public class func loginUserWithRequestBuilder(username username: String? = nil, password: String? = nil) -> RequestBuilder {
+ let path = "/user/login"
+ let URLString = PetstoreClientAPI.basePath + path
+
+ let nillableParameters: [String:AnyObject?] = [
+ "username": username,
+ "password": password
+ ]
+
+ let parameters = APIHelper.rejectNil(nillableParameters)
+
+ let convertedParameters = APIHelper.convertBoolToString(parameters)
+
+ let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
+
+ return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false)
+ }
+
+ /**
+ Logs out current logged in user session
+
+ - parameter completion: completion handler to receive the data and the error objects
+ */
+ public class func logoutUser(completion: ((error: ErrorType?) -> Void)) {
+ logoutUserWithRequestBuilder().execute { (response, error) -> Void in
+ completion(error: error);
+ }
+ }
+
+ /**
+ Logs out current logged in user session
+
+ - returns: Promise
+ */
+ public class func logoutUser() -> Promise {
+ let deferred = Promise