diff --git a/bin/groovy-petstore.sh b/bin/groovy-petstore.sh new file mode 100755 index 00000000000..6afb14a7f09 --- /dev/null +++ b/bin/groovy-petstore.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l groovy -o samples/client/petstore/groovy -DhideGenerationTimestamp=true" +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-petstore.sh b/bin/javascript-petstore.sh index 11fadd17d49..2eb26210e0a 100755 --- a/bin/javascript-petstore.sh +++ b/bin/javascript-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l javascript -o samples/client/petstore/javascript" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples/client/petstore/javascript" java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java index 945388b2588..ccea2ee070e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java @@ -20,7 +20,7 @@ public class CodegenModel { public List requiredVars = new ArrayList(); // a list of required properties public List optionalVars = new ArrayList(); // a list of optional properties public List allVars; - public List allowableValues; + public Map allowableValues; // Sorted sets of required parameters. public Set mandatory = new TreeSet(); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 9f13b0fdb01..db000e9c63e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -133,6 +133,161 @@ public class DefaultCodegen { return objs; } + /** + * post process enum defined in model's properties + * + * @param objs Map of models + * @return maps of models with better enum support + */ + public Map postProcessModelsEnum(Map objs) { + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + + // for enum model + if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { + Map allowableValues = cm.allowableValues; + + List values = (List) allowableValues.get("values"); + List> enumVars = new ArrayList>(); + String commonPrefix = findCommonPrefixOfVars(values); + int truncateIdx = commonPrefix.length(); + for (Object value : values) { + Map enumVar = new HashMap(); + String enumName; + if (truncateIdx == 0) { + enumName = value.toString(); + } else { + enumName = value.toString().substring(truncateIdx); + if ("".equals(enumName)) { + enumName = value.toString(); + } + } + enumVar.put("name", toEnumVarName(enumName, cm.dataType)); + enumVar.put("value", toEnumValue(value.toString(), cm.dataType)); + enumVars.add(enumVar); + } + cm.allowableValues.put("enumVars", enumVars); + } + + // for enum model's properties + for (CodegenProperty var : cm.vars) { + Map allowableValues = var.allowableValues; + + // handle ArrayProperty + if (var.items != null) { + allowableValues = var.items.allowableValues; + } + + if (allowableValues == null) { + continue; + } + //List values = (List) allowableValues.get("values"); + List values = (List) allowableValues.get("values"); + if (values == null) { + continue; + } + + // put "enumVars" map into `allowableValues", including `name` and `value` + List> enumVars = new ArrayList>(); + String commonPrefix = findCommonPrefixOfVars(values); + int truncateIdx = commonPrefix.length(); + for (Object value : values) { + Map enumVar = new HashMap(); + String enumName; + if (truncateIdx == 0) { + enumName = value.toString(); + } else { + enumName = value.toString().substring(truncateIdx); + if ("".equals(enumName)) { + enumName = value.toString(); + } + } + enumVar.put("name", toEnumVarName(enumName, var.datatype)); + enumVar.put("value", toEnumValue(value.toString(), var.datatype)); + enumVars.add(enumVar); + } + allowableValues.put("enumVars", enumVars); + // handle default value for enum, e.g. available => StatusEnum.AVAILABLE + if (var.defaultValue != null) { + String enumName = null; + for (Map enumVar : enumVars) { + if (toEnumValue(var.defaultValue, var.datatype).equals(enumVar.get("value"))) { + enumName = enumVar.get("name"); + break; + } + } + if (enumName != null) { + var.defaultValue = toEnumDefaultValue(enumName, var.datatypeWithEnum); + } + } + } + } + return objs; + } + + /** + * Returns the common prefix of variables for enum naming + * + * @param vars List of variable names + * @return the common prefix for naming + */ + public String findCommonPrefixOfVars(List vars) { + try { + String[] listStr = vars.toArray(new String[vars.size()]); + + String prefix = StringUtils.getCommonPrefix(listStr); + // exclude trailing characters that should be part of a valid variable + // e.g. ["status-on", "status-off"] => "status-" (not "status-o") + return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); + } catch (ArrayStoreException e) { + return ""; + } + } + + /** + * Return the enum default value in the language specifed format + * + * @param value enum variable name + * @param datatype data type + * @return the default value for the enum + */ + public String toEnumDefaultValue(String value, String datatype) { + return datatype + "." + value; + } + + /** + * Return the enum value in the language specifed format + * e.g. status becomes "status" + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized value for enum + */ + public String toEnumValue(String value, String datatype) { + if ("number".equalsIgnoreCase(datatype)) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + + /** + * Return the sanitized variable name for enum + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized variable name for enum + */ + public String toEnumVarName(String value, String datatype) { + String var = value.replaceAll("\\W+", "_").toUpperCase(); + if (var.matches("\\d.*")) { + return "_" + var; + } else { + return var; + } + } // override with any special post-processing @SuppressWarnings("static-method") @@ -456,7 +611,7 @@ public class DefaultCodegen { /** * Return the Enum name (e.g. StatusEnum given 'status') * - * @param property Codegen property object + * @param property Codegen property * @return the Enum name */ @SuppressWarnings("static-method") @@ -1012,7 +1167,9 @@ public class DefaultCodegen { ModelImpl impl = (ModelImpl) model; if(impl.getEnum() != null && impl.getEnum().size() > 0) { m.isEnum = true; - m.allowableValues = impl.getEnum(); + // comment out below as allowableValues is not set in post processing model enum + m.allowableValues = new HashMap(); + m.allowableValues.put("values", impl.getEnum()); Property p = PropertyBuilder.build(impl.getType(), impl.getFormat(), null); m.dataType = getSwaggerType(p); } @@ -1144,7 +1301,8 @@ public class DefaultCodegen { } } - if (p instanceof BaseIntegerProperty) { + // type is integer and without format + if (p instanceof BaseIntegerProperty && !(p instanceof IntegerProperty) && !(p instanceof LongProperty)) { BaseIntegerProperty sp = (BaseIntegerProperty) p; property.isInteger = true; /*if (sp.getEnum() != null) { @@ -1210,7 +1368,8 @@ public class DefaultCodegen { property.isByteArray = true; } - if (p instanceof DecimalProperty) { + // type is number and without format + if (p instanceof DecimalProperty && !(p instanceof DoubleProperty) && !(p instanceof FloatProperty)) { DecimalProperty sp = (DecimalProperty) p; property.isFloat = true; /*if (sp.getEnum() != null) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index df23c1f2275..e9d6457f6f0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -88,7 +88,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co "Int32", "Int64", "Float", - "Guid", + "Guid?", "System.IO.Stream", // not really a primitive, we include it to avoid model import "Object") ); @@ -115,7 +115,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co typeMapping.put("list", "List"); typeMapping.put("map", "Dictionary"); typeMapping.put("object", "Object"); - typeMapping.put("uuid", "Guid"); + typeMapping.put("uuid", "Guid?"); } public void setReturnICollection(boolean returnICollection) { @@ -203,11 +203,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } } - @Override - public String toEnumName(CodegenProperty property) { - return StringUtils.capitalize(property.name) + "Enum?"; - } - @Override public Map postProcessModels(Map objs) { List models = (List) objs.get("models"); @@ -223,7 +218,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } } } - return objs; + // process enum in models + return postProcessModelsEnum(objs); } @Override @@ -544,4 +540,54 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co public void setSourceFolder(String sourceFolder) { this.sourceFolder = sourceFolder; } + + + @Override + public String toEnumVarName(String name, String datatype) { + String enumName = sanitizeName(name); + + enumName = enumName.replaceFirst("^_", ""); + enumName = enumName.replaceFirst("_$", ""); + + enumName = camelize(enumName) + "Enum"; + + LOGGER.info("toEnumVarName = " + enumName); + + if (enumName.matches("\\d.*")) { // starts with number + return "_" + enumName; + } else { + return enumName; + } + } + + @Override + public String toEnumName(CodegenProperty property) { + return sanitizeName(camelize(property.name)) + "Enum"; + } + + /* + @Override + public String toEnumName(CodegenProperty property) { + String enumName = sanitizeName(property.name); + if (!StringUtils.isEmpty(modelNamePrefix)) { + enumName = modelNamePrefix + "_" + enumName; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + enumName = enumName + "_" + modelNameSuffix; + } + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(enumName)) { + LOGGER.warn(enumName + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + enumName)); + enumName = "model_" + enumName; // e.g. return => ModelReturn (after camelize) + } + + if (enumName.matches("\\d.*")) { // starts with number + return "_" + enumName; + } else { + return enumName; + } + } + */ } 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 0676372e64a..b5ac095e573 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 @@ -60,6 +60,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp // mapped to String as a workaround typeMapping.put("binary", "string"); typeMapping.put("ByteArray", "string"); + typeMapping.put("UUID", "string"); cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase")); @@ -230,4 +231,59 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp } } + + @Override + public String toEnumValue(String value, String datatype) { + if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + return value; + } else { + return "\'" + escapeText(value) + "\'"; + } + } + + @Override + public String toEnumDefaultValue(String value, String datatype) { + return datatype + "_" + value; + } + + @Override + public String toEnumVarName(String name, String datatype) { + // number + if ("int".equals(datatype) || "double".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 "_" + enumName; + } else { + return enumName; + } + } + + @Override + public String toEnumName(CodegenProperty property) { + String enumName = toModelName(property.name) + "Enum"; + + if (enumName.matches("\\d.*")) { // starts with number + return "_" + enumName; + } else { + return enumName; + } + } + + @Override + public Map postProcessModels(Map objs) { + // process enum in models + return postProcessModelsEnum(objs); + } + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index b8f2b187a6a..1212795e1bb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -308,75 +308,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { @Override public Map postProcessModels(Map objMap) { - Map objs = super.postProcessModels(objMap); - - List models = (List) objs.get("models"); - for (Object _mo : models) { - Map mo = (Map) _mo; - CodegenModel cm = (CodegenModel) mo.get("model"); - for (CodegenProperty var : cm.vars) { - Map allowableValues = var.allowableValues; - - // handle ArrayProperty - if (var.items != null) { - allowableValues = var.items.allowableValues; - } - - if (allowableValues == null) { - continue; - } - List values = (List) allowableValues.get("values"); - if (values == null) { - continue; - } - - // put "enumVars" map into `allowableValues", including `name` and `value` - List> enumVars = new ArrayList>(); - String commonPrefix = findCommonPrefixOfVars(values); - int truncateIdx = commonPrefix.length(); - for (String value : values) { - Map enumVar = new HashMap(); - String enumName; - if (truncateIdx == 0) { - enumName = value; - } else { - enumName = value.substring(truncateIdx); - if ("".equals(enumName)) { - enumName = value; - } - } - enumVar.put("name", toEnumVarName(enumName)); - enumVar.put("jsonname", value); - enumVar.put("value", value); - enumVars.add(enumVar); - } - allowableValues.put("enumVars", enumVars); - // handle default value for enum, e.g. available => StatusEnum.AVAILABLE - - // HACK: strip ? from enum - if (var.datatypeWithEnum != null) { - var.vendorExtensions.put(DATA_TYPE_WITH_ENUM_EXTENSION, var.datatypeWithEnum.substring(0, var.datatypeWithEnum.length() - 1)); - } - - if (var.defaultValue != null) { - String enumName = null; - - for (Map enumVar : enumVars) { - - if (var.defaultValue.replace("\"", "").equals(enumVar.get("value"))) { - enumName = enumVar.get("name"); - break; - } - } - if (enumName != null && var.vendorExtensions.containsKey(DATA_TYPE_WITH_ENUM_EXTENSION)) { - var.defaultValue = var.vendorExtensions.get(DATA_TYPE_WITH_ENUM_EXTENSION) + "." + enumName; - } - } - - } - } - - return objs; + return super.postProcessModels(objMap); } public void setTargetFramework(String dotnetFramework) { @@ -436,18 +368,34 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { return codegenModel; } - private String findCommonPrefixOfVars(List vars) { - String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); - // exclude trailing characters that should be part of a valid variable - // e.g. ["status-on", "status-off"] => "status-" (not "status-o") - return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); + @Override + public String toEnumValue(String value, String datatype) { + if ("int?".equalsIgnoreCase(datatype) || "long?".equalsIgnoreCase(datatype) || + "double?".equalsIgnoreCase(datatype) || "float?".equalsIgnoreCase(datatype)) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } } - private String toEnumVarName(String value) { + @Override + public String toEnumVarName(String value, String datatype) { + // number + if ("int?".equals(datatype) || "long?".equals(datatype) || + "double?".equals(datatype) || "float?".equals(datatype)) { + String varName = "NUMBER_" + value; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + return varName; + } + + // string String var = value.replaceAll("_", " "); var = WordUtils.capitalizeFully(var); var = var.replaceAll("\\W+", ""); + if (var.matches("\\d.*")) { return "_" + var; } else { 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 2bd79dbf015..e607670313c 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 @@ -11,6 +11,7 @@ import io.swagger.models.parameters.Parameter; import io.swagger.models.properties.*; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.WordUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -89,6 +90,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig { instantiationTypes.put("map", "HashMap"); typeMapping.put("date", "Date"); typeMapping.put("file", "File"); + typeMapping.put("UUID", "String"); cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); @@ -651,6 +653,28 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig { return codegenModel; } + @Override + public Map postProcessModelsEnum(Map objs) { + objs = super.postProcessModelsEnum(objs); + String lib = getLibrary(); + if (StringUtils.isEmpty(lib) || "feign".equals(lib) || "jersey2".equals(lib)) { + List> imports = (List>)objs.get("imports"); + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + // for enum model + if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { + cm.imports.add(importMapping.get("JsonValue")); + Map item = new HashMap(); + item.put("import", importMapping.get("JsonValue")); + imports.add(item); + } + } + } + return objs; + } + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { if(serializeBigDecimalAsString) { @@ -696,63 +720,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public Map postProcessModels(Map objs) { - List models = (List) objs.get("models"); - for (Object _mo : models) { - Map mo = (Map) _mo; - CodegenModel cm = (CodegenModel) mo.get("model"); - - for (CodegenProperty var : cm.vars) { - Map allowableValues = var.allowableValues; - - // handle ArrayProperty - if (var.items != null) { - allowableValues = var.items.allowableValues; - } - - if (allowableValues == null) { - continue; - } - List values = (List) allowableValues.get("values"); - if (values == null) { - continue; - } - - // put "enumVars" map into `allowableValues", including `name` and `value` - List> enumVars = new ArrayList>(); - String commonPrefix = findCommonPrefixOfVars(values); - int truncateIdx = commonPrefix.length(); - for (String value : values) { - Map enumVar = new HashMap(); - String enumName; - if (truncateIdx == 0) { - enumName = value; - } else { - enumName = value.substring(truncateIdx); - if ("".equals(enumName)) { - enumName = value; - } - } - enumVar.put("name", toEnumVarName(enumName)); - enumVar.put("value", value); - enumVars.add(enumVar); - } - allowableValues.put("enumVars", enumVars); - // handle default value for enum, e.g. available => StatusEnum.AVAILABLE - if (var.defaultValue != null) { - String enumName = null; - for (Map enumVar : enumVars) { - if (var.defaultValue.equals(enumVar.get("value"))) { - enumName = enumVar.get("name"); - break; - } - } - if (enumName != null) { - var.defaultValue = var.datatypeWithEnum + "." + enumName; - } - } - } - } - return objs; + return postProcessModelsEnum(objs); } @Override @@ -848,16 +816,35 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig { protected boolean needToImport(String type) { return super.needToImport(type) && type.indexOf(".") < 0; } - - private static String findCommonPrefixOfVars(List vars) { +/* + @Override + public String findCommonPrefixOfVars(List vars) { String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); // exclude trailing characters that should be part of a valid variable // e.g. ["status-on", "status-off"] => "status-" (not "status-o") return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); } +*/ - private static String toEnumVarName(String value) { - String var = value.replaceAll("\\W+", "_").toUpperCase(); + @Override + public String toEnumName(CodegenProperty property) { + return sanitizeName(camelize(property.name)) + "Enum"; + } + + @Override + public String toEnumVarName(String value, String datatype) { + // number + if ("Integer".equals(datatype) || "Long".equals(datatype) || + "Float".equals(datatype) || "Double".equals(datatype)) { + String varName = "NUMBER_" + value; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + return varName; + } + + // string + String var = value.replaceAll("\\W+", "_").replaceAll("_+", "_").toUpperCase(); if (var.matches("\\d.*")) { return "_" + var; } else { @@ -865,6 +852,16 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig { } } + @Override + public String toEnumValue(String value, String datatype) { + if ("Integer".equals(datatype) || "Long".equals(datatype) || + "Float".equals(datatype) || "Double".equals(datatype)) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { // This generator uses inline classes to define enums, which breaks when // dealing with models that have subTypes. To clean this up, we will analyze diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 175f3eab0c1..feec76d8de2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -136,6 +136,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo // binary not supported in JavaScript client right now, using String as a workaround typeMapping.put("ByteArray", "String"); // I don't see ByteArray defined in the Swagger docs. typeMapping.put("binary", "String"); + typeMapping.put("UUID", "String"); importMapping.clear(); @@ -870,7 +871,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo if (allowableValues == null) { continue; } - List values = (List) allowableValues.get("values"); + List values = (List) allowableValues.get("values"); if (values == null) { continue; } @@ -879,19 +880,19 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo List> enumVars = new ArrayList>(); String commonPrefix = findCommonPrefixOfVars(values); int truncateIdx = commonPrefix.length(); - for (String value : values) { + for (Object value : values) { Map enumVar = new HashMap(); String enumName; if (truncateIdx == 0) { - enumName = value; + enumName = value.toString(); } else { - enumName = value.substring(truncateIdx); + enumName = value.toString().substring(truncateIdx); if ("".equals(enumName)) { - enumName = value; + enumName = value.toString(); } } - enumVar.put("name", toEnumVarName(enumName)); - enumVar.put("value", value); + enumVar.put("name", toEnumVarName(enumName, var.datatype)); + enumVar.put("value",toEnumValue(value.toString(), var.datatype)); enumVars.add(enumVar); } allowableValues.put("enumVars", enumVars); @@ -928,22 +929,15 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type); } - - private static String findCommonPrefixOfVars(List vars) { +/* + @Override + public String findCommonPrefixOfVars(List vars) { String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); // exclude trailing characters that should be part of a valid variable // e.g. ["status-on", "status-off"] => "status-" (not "status-o") return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); } - - private static String toEnumVarName(String value) { - String var = value.replaceAll("\\W+", "_").toUpperCase(); - if (var.matches("\\d.*")) { - return "_" + var; - } else { - return var; - } - } +*/ private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { // This generator uses inline classes to define enums, which breaks when @@ -1002,4 +996,41 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return packageName; } + @Override + public String toEnumName(CodegenProperty property) { + return sanitizeName(camelize(property.name)) + "Enum"; + } + + @Override + public String toEnumVarName(String value, String datatype) { + return value; + /* + // number + if ("Integer".equals(datatype) || "Number".equals(datatype)) { + String varName = "NUMBER_" + value; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + return varName; + } + + // string + String var = value.replaceAll("\\W+", "_").replaceAll("_+", "_").toUpperCase(); + if (var.matches("\\d.*")) { + return "_" + var; + } else { + return var; + } + */ + } + + @Override + public String toEnumValue(String value, String datatype) { + if ("Integer".equals(datatype) || "Number".equals(datatype)) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java index 0aed793fc09..91346cad696 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java @@ -4,6 +4,7 @@ import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConstants; 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; @@ -12,6 +13,7 @@ import io.swagger.models.properties.*; import java.io.File; import java.util.Arrays; import java.util.HashMap; +import java.util.Map; import java.util.HashSet; import java.util.regex.Matcher; @@ -111,6 +113,7 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("object", "object"); typeMapping.put("binary", "string"); typeMapping.put("ByteArray", "string"); + typeMapping.put("UUID", "string"); cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); @@ -566,4 +569,57 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig { p.example = example; } + @Override + public String toEnumValue(String value, String datatype) { + if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + return value; + } else { + return "\'" + escapeText(value) + "\'"; + } + } + + @Override + public String toEnumDefaultValue(String value, String datatype) { + return datatype + "_" + value; + } + + @Override + public String toEnumVarName(String name, String datatype) { + // number + if ("int".equals(datatype) || "double".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 "_" + enumName; + } else { + return enumName; + } + } + + @Override + public String toEnumName(CodegenProperty property) { + String enumName = underscore(toModelName(property.name)).toUpperCase(); + + if (enumName.matches("\\d.*")) { // starts with number + return "_" + enumName; + } else { + return enumName; + } + } + + @Override + public Map postProcessModels(Map objs) { + // process enum in models + return postProcessModelsEnum(objs); + } } 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 e81aa717262..f9c0990c182 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 @@ -117,6 +117,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("file", "File"); typeMapping.put("binary", "String"); typeMapping.put("ByteArray", "String"); + typeMapping.put("UUID", "String"); // remove modelPackage and apiPackage added by default Iterator itr = cliOptions.iterator(); 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 93d7e3c2f64..7b6bf8fbdc3 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 @@ -335,8 +335,10 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { swiftEnums.add(map); } codegenProperty.allowableValues.put("values", swiftEnums); - codegenProperty.datatypeWithEnum = - StringUtils.left(codegenProperty.datatypeWithEnum, codegenProperty.datatypeWithEnum.length() - "Enum".length()); + codegenProperty.datatypeWithEnum = toEnumName(codegenProperty); + //codegenProperty.datatypeWithEnum = + // StringUtils.left(codegenProperty.datatypeWithEnum, codegenProperty.datatypeWithEnum.length() - "Enum".length()); + // 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 @@ -483,4 +485,59 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { public void setResponseAs(String[] responseAs) { this.responseAs = responseAs; } + + @Override + public String toEnumValue(String value, String datatype) { + if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + return value; + } else { + return "\'" + escapeText(value) + "\'"; + } + } + + @Override + public String toEnumDefaultValue(String value, String datatype) { + return datatype + "_" + value; + } + + @Override + public String toEnumVarName(String name, String datatype) { + // number + if ("int".equals(datatype) || "double".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 "_" + enumName; + } else { + return enumName; + } + } + + @Override + public String toEnumName(CodegenProperty property) { + String enumName = underscore(toModelName(property.name)).toUpperCase(); + + if (enumName.matches("\\d.*")) { // starts with number + return "_" + enumName; + } else { + return enumName; + } + } + + @Override + public Map postProcessModels(Map objs) { + // process enum in models + return postProcessModelsEnum(objs); + } + } diff --git a/modules/swagger-codegen/src/main/resources/Java/enumClass.mustache b/modules/swagger-codegen/src/main/resources/Java/enumClass.mustache deleted file mode 100644 index 6010e26704f..00000000000 --- a/modules/swagger-codegen/src/main/resources/Java/enumClass.mustache +++ /dev/null @@ -1,17 +0,0 @@ - - public enum {{{datatypeWithEnum}}} { - {{#allowableValues}}{{#enumVars}}{{{name}}}("{{{value}}}"){{^-last}}, - {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} - - private String value; - - {{{datatypeWithEnum}}}(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return value; - } - } diff --git a/modules/swagger-codegen/src/main/resources/Java/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/Java/enumOuterClass.mustache deleted file mode 100644 index 7aea7b92f22..00000000000 --- a/modules/swagger-codegen/src/main/resources/Java/enumOuterClass.mustache +++ /dev/null @@ -1,3 +0,0 @@ -public enum {{classname}} { - {{#allowableValues}}{{.}}{{^-last}}, {{/-last}}{{/allowableValues}} -} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/common/modelInnerEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/common/modelInnerEnum.mustache new file mode 100644 index 00000000000..30ebf3febb6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/common/modelInnerEnum.mustache @@ -0,0 +1,20 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}}@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{datatype}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{datatype}} value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enumClass.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enumClass.mustache deleted file mode 100644 index 0fed02b67a3..00000000000 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enumClass.mustache +++ /dev/null @@ -1,17 +0,0 @@ -public enum {{{datatypeWithEnum}}} { - {{#allowableValues}}{{#enumVars}}@SerializedName("{{{value}}}") - {{{name}}}("{{{value}}}"){{^-last}}, - - {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} - - private String value; - - {{{datatypeWithEnum}}}(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } -} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache index a7e706eba4e..b5370c1360b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/enum_outer_doc.mustache @@ -4,4 +4,4 @@ {{#allowableValues}}{{#enumVars}} * `{{name}}` (value: `{{value}}`) -{{#enumVars}}{{/allowableValues}} +{{/enumVars}}{{/allowableValues}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model.mustache index 0b544b9e06c..4bd6d5638b4 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/model.mustache @@ -8,78 +8,7 @@ import com.google.gson.annotations.SerializedName; {{#serializableModel}}import java.io.Serializable;{{/serializableModel}} {{#models}} - -{{#model}}{{#description}} -/** - * {{description}} - **/{{/description}} -{{#description}}@ApiModel(description = "{{{description}}}"){{/description}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { - {{#vars}}{{#isEnum}} - -{{>libraries/okhttp-gson/enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} - -{{>libraries/okhttp-gson/enumClass}}{{/items}}{{/items.isEnum}} - @SerializedName("{{baseName}}") - private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}}; - {{/vars}} - - {{#vars}} - /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} - **/ - @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") - public {{{datatypeWithEnum}}} {{getter}}() { - return {{name}}; - }{{^isReadOnly}} - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { - this.{{name}} = {{name}}; - }{{/isReadOnly}} - - {{/vars}} - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - }{{#hasVars}} - {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && - {{/hasMore}}{{/vars}}{{#parent}} && - super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} - return true;{{/hasVars}} - } - - @Override - public int hashCode() { - return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class {{classname}} {\n"); - {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} - {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); - {{/vars}}sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}} {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/modelEnum.mustache new file mode 100644 index 00000000000..f7af4c89f2f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/modelEnum.mustache @@ -0,0 +1,20 @@ +/** + * {{^description}}Gets or Sets {{name}}{{/description}}{{#description}}{{description}}{{/description}} + */ +public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}}@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{dataType}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } +} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/modelInnerEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/modelInnerEnum.mustache new file mode 100644 index 00000000000..30ebf3febb6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/modelInnerEnum.mustache @@ -0,0 +1,20 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}}@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{datatype}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{datatype}} value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache new file mode 100644 index 00000000000..b20499078a2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache @@ -0,0 +1,71 @@ +/** + * {{#description}}{{description}}{{/description}}{{^description}}{{classname}}{{/description}} + */{{#description}} +@ApiModel(description = "{{{description}}}"){{/description}} +public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { + {{#vars}}{{#isEnum}} + +{{>libraries/common/modelInnerEnum}}{{/isEnum}}{{#items.isEnum}}{{#items}} + +{{>libraries/common/modelInnerEnum}}{{/items}}{{/items.isEnum}} + @SerializedName("{{baseName}}") + private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}}; + {{/vars}} + + {{#vars}} + /**{{#description}} + * {{{description}}}{{/description}}{{#minimum}} + * minimum: {{minimum}}{{/minimum}}{{#maximum}} + * maximum: {{maximum}}{{/maximum}} + **/ + @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{^isReadOnly}} + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + }{{/isReadOnly}} + + {{/vars}} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + {{/hasMore}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return true;{{/hasVars}} + } + + @Override + public int hashCode() { + return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/model.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/model.mustache index 779a56fedb7..1de150a9237 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/model.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/model.mustache @@ -17,9 +17,9 @@ import com.google.gson.annotations.SerializedName; public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}} -{{>libraries/okhttp-gson/enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} +{{>libraries/common/modelInnerEnum}}{{/isEnum}}{{#items.isEnum}}{{#items}} -{{>libraries/okhttp-gson/enumClass}}{{/items}}{{/items.isEnum}} +{{>libraries/common/modelInnerEnum}}{{/items}}{{/items.isEnum}} @SerializedName("{{baseName}}") private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}}; {{/vars}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/model.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/model.mustache index 779a56fedb7..1de150a9237 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/model.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/model.mustache @@ -17,9 +17,9 @@ import com.google.gson.annotations.SerializedName; public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}} -{{>libraries/okhttp-gson/enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} +{{>libraries/common/modelInnerEnum}}{{/isEnum}}{{#items.isEnum}}{{#items}} -{{>libraries/okhttp-gson/enumClass}}{{/items}}{{/items.isEnum}} +{{>libraries/common/modelInnerEnum}}{{/items}}{{/items.isEnum}} @SerializedName("{{baseName}}") private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}}; {{/vars}} diff --git a/modules/swagger-codegen/src/main/resources/Java/model.mustache b/modules/swagger-codegen/src/main/resources/Java/model.mustache index b9512d2b83c..66ba76bcbc5 100644 --- a/modules/swagger-codegen/src/main/resources/Java/model.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/model.mustache @@ -6,11 +6,7 @@ import java.util.Objects; {{#serializableModel}}import java.io.Serializable;{{/serializableModel}} {{#models}} -{{#model}}{{#description}} -/** - * {{description}} - **/{{/description}} -{{#isEnum}}{{>enumOuterClass}}{{/isEnum}} -{{^isEnum}}{{>pojo}}{{/isEnum}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}} {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache new file mode 100644 index 00000000000..f93504c4a98 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache @@ -0,0 +1,19 @@ +/** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ +public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}}{{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{dataType}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } +} diff --git a/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache new file mode 100644 index 00000000000..54a97faab35 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache @@ -0,0 +1,19 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}}{{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{datatype}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{datatype}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache index 1a1f455ed31..f250035a422 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache @@ -1,11 +1,14 @@ -{{#description}}@ApiModel(description = "{{{description}}}"){{/description}} +/** + * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + */{{#description}} +@ApiModel(description = "{{{description}}}"){{/description}} {{>generatedAnnotation}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}} -{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} +{{>modelInnerEnum}}{{/isEnum}}{{#items.isEnum}}{{#items}} -{{>enumClass}}{{/items}}{{/items.isEnum}} +{{>modelInnerEnum}}{{/items}}{{/items.isEnum}} private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}} {{#vars}}{{^isReadOnly}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/enumClass.mustache index 6010e26704f..a9f78081ce5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/enumClass.mustache @@ -1,17 +1,24 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, - public enum {{{datatypeWithEnum}}} { - {{#allowableValues}}{{#enumVars}}{{{name}}}("{{{value}}}"){{^-last}}, - {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/-last}}{{#-last}}; + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + private {{datatype}} value; - private String value; - - {{{datatypeWithEnum}}}(String value) { + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{datatype}} value) { this.value = value; } @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache index 6010e26704f..a9f78081ce5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache @@ -1,17 +1,24 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, - public enum {{{datatypeWithEnum}}} { - {{#allowableValues}}{{#enumVars}}{{{name}}}("{{{value}}}"){{^-last}}, - {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/-last}}{{#-last}}; + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + private {{datatype}} value; - private String value; - - {{{datatypeWithEnum}}}(String value) { + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{datatype}} value) { this.value = value; } @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/modules/swagger-codegen/src/main/resources/Javascript/enumClass.mustache b/modules/swagger-codegen/src/main/resources/Javascript/enumClass.mustache index d245084042a..fb1e228577c 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/enumClass.mustache @@ -3,11 +3,17 @@ * @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%> * @readonly */{{/emitJSDoc}} - exports.{{datatypeWithEnum}} = { {{#allowableValues}}{{#enumVars}} -{{#emitJSDoc}} /** - * value: {{value}} + exports.{{datatypeWithEnum}} = { + {{#allowableValues}} + {{#enumVars}} +{{#emitJSDoc}} + /** + * value: {{{value}}} * @const */ -{{/emitJSDoc}} {{name}}: "{{value}}"{{^-last}}, - {{/-last}}{{/enumVars}}{{/allowableValues}} - }; \ No newline at end of file +{{/emitJSDoc}} + "{{name}}": {{{value}}}{{^-last}}, + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + }; diff --git a/modules/swagger-codegen/src/main/resources/Javascript/model.mustache b/modules/swagger-codegen/src/main/resources/Javascript/model.mustache index 11b9ec74e0b..db480f05b1d 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/model.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/model.mustache @@ -15,91 +15,6 @@ }(this, function(ApiClient{{#imports}}, {{import}}{{/imports}}) { 'use strict'; -{{#models}}{{#model}}{{#emitJSDoc}} /** - * The {{classname}} model module. - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} - * @version {{projectVersion}} - */ - - /** - * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} - * @class{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{.}}{{/vendorExtensions.x-all-required}} - */ -{{/emitJSDoc}} var exports = function({{#vendorExtensions.x-all-required}}{{.}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { - var _this = this; -{{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}} _this = new Array(); - Object.setPrototypeOf(_this, exports); -{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}} {{classname}}.call(_this{{#vendorExtensions.x-all-required}}, {{.}}{{/vendorExtensions.x-all-required}});{{/parentModel}} -{{#interfaceModels}} {{classname}}.call(_this{{#vendorExtensions.x-all-required}}, {{.}}{{/vendorExtensions.x-all-required}}); -{{/interfaceModels}}{{/useInheritance}}{{#vars}}{{#required}} _this['{{baseName}}'] = {{name}};{{/required}} -{{/vars}}{{#parent}}{{^parentModel}} return _this; -{{/parentModel}}{{/parent}} }; - -{{#emitJSDoc}} /** - * Constructs a {{classname}} from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> obj Optional instance to populate. - * @return {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> The populated {{classname}} instance. - */ -{{/emitJSDoc}} exports.constructFromObject = function(data, obj) { - if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} { - obj = obj || new exports(); -{{#parent}}{{^parentModel}} ApiClient.constructFromObject(data, obj, {{vendorExtensions.x-itemType}}); -{{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}} {{classname}}.constructFromObject(data, obj);{{/parentModel}} -{{#interfaces}} {{.}}.constructFromObject(data, obj); -{{/interfaces}}{{/useInheritance}}{{#vars}} if (data.hasOwnProperty('{{baseName}}')) { - obj['{{baseName}}']{{{defaultValueWithParam}}} - } -{{/vars}} } - return obj; - } -{{#useInheritance}}{{#parentModel}} - exports.prototype = Object.create({{classname}}.prototype); - exports.prototype.constructor = exports; -{{/parentModel}}{{/useInheritance}} -{{#vars}}{{#emitJSDoc}} - /**{{#description}} - * {{{description}}}{{/description}} - * @member {{{vendorExtensions.x-jsdoc-type}}} {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} - */ -{{/emitJSDoc}} exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; -{{/vars}}{{#useInheritance}}{{#interfaceModels}} - // Implement {{classname}} interface:{{#allVars}}{{#emitJSDoc}} - /**{{#description}} - * {{{description}}}{{/description}} - * @member {{{vendorExtensions.x-jsdoc-type}}} {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} - */ -{{/emitJSDoc}} exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; -{{/allVars}}{{/interfaceModels}}{{/useInheritance}} -{{#emitModelMethods}}{{#vars}}{{#emitJSDoc}} /**{{#description}} - * Returns {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} - * @return {{{vendorExtensions.x-jsdoc-type}}} - */ -{{/emitJSDoc}} exports.prototype.{{getter}} = function() { - return this['{{baseName}}']; - } - -{{#emitJSDoc}} /**{{#description}} - * Sets {{{description}}}{{/description}} - * @param {{{vendorExtensions.x-jsdoc-type}}} {{name}}{{#description}} {{{description}}}{{/description}} - */ -{{/emitJSDoc}} exports.prototype.{{setter}} = function({{name}}) { - this['{{baseName}}'] = {{name}}; - } - -{{/vars}}{{/emitModelMethods}} -{{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} -{{>enumClass}}{{/items}}*/{{/items.isEnum}}{{/vars}} - - return exports; -{{/model}}{{/models}}})); +{{#models}}{{#model}} +{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_enum_class.mustache b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_enum_class.mustache new file mode 100644 index 00000000000..c7d18d35841 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_enum_class.mustache @@ -0,0 +1,24 @@ +{{#emitJSDoc}} + /** + * Enum class {{classname}}. + * @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%> + * @readonly + */ +{{/emitJSDoc}} + exports.{{classname}} = { + {{#allowableValues}} + {{#values}} +{{#emitJSDoc}} + /** + * value: {{{.}}} + * @const + */ +{{/emitJSDoc}} + "{{{.}}}": "{{{.}}}"{{^-last}}, + {{/-last}} + {{/values}} + {{/allowableValues}} + }; + + return exports; +})); diff --git a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache new file mode 100644 index 00000000000..d8a9d250a4a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache @@ -0,0 +1,103 @@ + +{{#models}}{{#model}} +{{#emitJSDoc}} + /** + * The {{classname}} model module. + * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @version {{projectVersion}} + */ + + /** + * Constructs a new {{classname}}.{{#description}} + * {{description}}{{/description}} + * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @class{{#useInheritance}}{{#parent}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{.}}{{/vendorExtensions.x-all-required}} + */ +{{/emitJSDoc}} + var exports = function({{#vendorExtensions.x-all-required}}{{.}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { + var _this = this; +{{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}} _this = new Array(); + Object.setPrototypeOf(_this, exports); +{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}} {{classname}}.call(_this{{#vendorExtensions.x-all-required}}, {{.}}{{/vendorExtensions.x-all-required}});{{/parentModel}} +{{#interfaceModels}} {{classname}}.call(_this{{#vendorExtensions.x-all-required}}, {{.}}{{/vendorExtensions.x-all-required}}); +{{/interfaceModels}}{{/useInheritance}}{{#vars}}{{#required}} _this['{{baseName}}'] = {{name}};{{/required}} +{{/vars}}{{#parent}}{{^parentModel}} return _this; +{{/parentModel}}{{/parent}} }; + +{{#emitJSDoc}} + /** + * Constructs a {{classname}} from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> obj Optional instance to populate. + * @return {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> The populated {{classname}} instance. + */ +{{/emitJSDoc}} + exports.constructFromObject = function(data, obj) { + if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} { + obj = obj || new exports(); +{{#parent}}{{^parentModel}} ApiClient.constructFromObject(data, obj, {{vendorExtensions.x-itemType}}); +{{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}} {{classname}}.constructFromObject(data, obj);{{/parentModel}} +{{#interfaces}} {{.}}.constructFromObject(data, obj); +{{/interfaces}}{{/useInheritance}}{{#vars}} if (data.hasOwnProperty('{{baseName}}')) { + obj['{{baseName}}']{{{defaultValueWithParam}}} + } +{{/vars}} } + return obj; + } +{{#useInheritance}}{{#parentModel}} + exports.prototype = Object.create({{classname}}.prototype); + exports.prototype.constructor = exports; +{{/parentModel}}{{/useInheritance}} +{{#vars}} +{{#emitJSDoc}} + /**{{#description}} + * {{{description}}}{{/description}} + * @member {{{vendorExtensions.x-jsdoc-type}}} {{baseName}}{{#defaultValue}} + * @default {{{defaultValue}}}{{/defaultValue}} + */ +{{/emitJSDoc}} + exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{/vars}}{{#useInheritance}}{{#interfaceModels}} + // Implement {{classname}} interface:{{#allVars}} +{{#emitJSDoc}} + /**{{#description}} + * {{{description}}}{{/description}} + * @member {{{vendorExtensions.x-jsdoc-type}}} {{baseName}}{{#defaultValue}} + * @default {{{defaultValue}}}{{/defaultValue}} + */ +{{/emitJSDoc}} +exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{/allVars}}{{/interfaceModels}}{{/useInheritance}} +{{#emitModelMethods}}{{#vars}} +{{#emitJSDoc}} + /**{{#description}} + * Returns {{{description}}}{{/description}}{{#minimum}} + * minimum: {{minimum}}{{/minimum}}{{#maximum}} + * maximum: {{maximum}}{{/maximum}} + * @return {{{vendorExtensions.x-jsdoc-type}}} + */ +{{/emitJSDoc}} + exports.prototype.{{getter}} = function() { + return this['{{baseName}}']; + } + +{{#emitJSDoc}} + /**{{#description}} + * Sets {{{description}}}{{/description}} + * @param {{{vendorExtensions.x-jsdoc-type}}} {{name}}{{#description}} {{{description}}}{{/description}} + */ +{{/emitJSDoc}} + exports.prototype.{{setter}} = function({{name}}) { + this['{{baseName}}'] = {{name}}; + } + +{{/vars}}{{/emitModelMethods}} +{{#vars}}{{#isEnum}}{{>partial_model_inner_enum}}{{/isEnum}}{{#items.isEnum}}{{#items}} +{{>partial_model_inner_enum}}{{/items}}*/{{/items.isEnum}}{{/vars}} + + return exports; +{{/model}}{{/models}}})); diff --git a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_inner_enum.mustache b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_inner_enum.mustache new file mode 100644 index 00000000000..a8b981316d1 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_inner_enum.mustache @@ -0,0 +1,21 @@ +{{#emitJSDoc}} + /** + * Allowed values for the {{baseName}} property. + * @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%> + * @readonly + */ +{{/emitJSDoc}} + exports.{{datatypeWithEnum}} = { + {{#allowableValues}} + {{#enumVars}} +{{#emitJSDoc}} + /** + * value: {{{value}}} + * @const + */ +{{/emitJSDoc}} + "{{name}}": {{{value}}}{{^-last}}, + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + }; diff --git a/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache b/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache index d882e33595c..5249d754577 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache @@ -1,6 +1,15 @@ - public enum {{vendorExtensions.plainDatatypeWithEnum}} { + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{#description}} + /// {{{description}}}{{/description}} + [JsonConverter(typeof(StringEnumConverter))] + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + { {{#allowableValues}}{{#enumVars}} - [EnumMember(Value = "{{jsonname}}")] - {{name}}{{^-last}}, - {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}{{/allowableValues}} + /// + /// Enum {{name}} for {{{value}}} + /// + [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] + {{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + {{/-last}}{{/enumVars}}{{/allowableValues}} } diff --git a/modules/swagger-codegen/src/main/resources/csharp/model.mustache b/modules/swagger-codegen/src/main/resources/csharp/model.mustache index 6d087895847..6c6ae8fdbb6 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/model.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/model.mustache @@ -13,145 +13,7 @@ using Newtonsoft.Json.Converters; {{#model}} namespace {{packageName}}.Model { - /// - /// {{description}} - /// - [DataContract] - public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}} - - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// {{#description}} - /// {{{description}}}{{/description}} - [JsonConverter(typeof(StringEnumConverter))] -{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} -{{>enumClass}}{{/items}}{{/items.isEnum}}{{/vars}} - {{#vars}}{{#isEnum}} - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// {{#description}} - /// {{{description}}}{{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] - public {{{datatypeWithEnum}}} {{name}} { get; set; } - {{/isEnum}}{{/vars}} - /// - /// Initializes a new instance of the class. - /// Initializes a new instance of the class. - /// -{{#vars}}{{^isReadOnly}} /// {{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. -{{/isReadOnly}}{{/vars}} - public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}} {{name}} = null{{/isReadOnly}}{{#hasMoreNonReadOnly}}, {{/hasMoreNonReadOnly}}{{/vars}}) - { - {{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null) - if ({{name}} == null) - { - throw new InvalidDataException("{{name}} is a required property for {{classname}} and cannot be null"); - } - else - { - this.{{name}} = {{name}}; - } - {{/required}}{{/isReadOnly}}{{/vars}}{{#vars}}{{^isReadOnly}}{{^required}}{{#defaultValue}}// use default value if no "{{name}}" provided - if ({{name}} == null) - { - this.{{name}} = {{{defaultValue}}}; - } - else - { - this.{{name}} = {{name}}; - } - {{/defaultValue}}{{^defaultValue}}this.{{name}} = {{name}}; - {{/defaultValue}}{{/required}}{{/isReadOnly}}{{/vars}} - } - - {{#vars}}{{^isEnum}} - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} - /// {{#description}} - /// {{description}}{{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] - public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } - {{/isEnum}}{{/vars}} - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); -{{#vars}} - sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); -{{/vars}} - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public {{#parent}} new {{/parent}}string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as {{classname}}); - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return {{#vars}}{{#isNotContainer}} - ( - this.{{name}} == other.{{name}} || - this.{{name}} != null && - this.{{name}}.Equals(other.{{name}}) - ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{^isNotContainer}} - ( - this.{{name}} == other.{{name}} || - this.{{name}} != null && - this.{{name}}.SequenceEqual(other.{{name}}) - ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{/vars}}{{^vars}}false{{/vars}}; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - {{#vars}} - if (this.{{name}} != null) - hash = hash * 59 + this.{{name}}.GetHashCode(); - {{/vars}} - return hash; - } - } - - } +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}} {{/model}} {{/models}} } diff --git a/modules/swagger-codegen/src/main/resources/csharp/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/csharp/modelEnum.mustache new file mode 100644 index 00000000000..ff38385c785 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/modelEnum.mustache @@ -0,0 +1,15 @@ + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{#description}} + /// {{{description}}}{{/description}} + [JsonConverter(typeof(StringEnumConverter))] + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + { + {{#allowableValues}}{{#enumVars}} + /// + /// Enum {{name}} for {{{value}}} + /// + [EnumMember(Value = {{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}})] + {{name}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + {{/-last}}{{/enumVars}}{{/allowableValues}} + } diff --git a/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache new file mode 100644 index 00000000000..6c5da5e4f56 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache @@ -0,0 +1,150 @@ + /// + /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// + [DataContract] + public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> + { + {{#vars}} + {{#isEnum}} +{{>modelInnerEnum}} + {{/isEnum}} + {{#items.isEnum}} + {{#items}} +{{>modelInnerEnum}} + {{/items}} + {{/items.isEnum}} + {{/vars}} + {{#vars}} + {{#isEnum}} + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{#description}} + /// {{{description}}}{{/description}} + [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] + public {{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} { get; set; } + {{/isEnum}} + {{/vars}} + /// + /// Initializes a new instance of the class. + /// + {{#vars}} + {{^isReadOnly}} + /// {{#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{{#hasMore}}, {{/hasMore}}{{/isReadOnly}}{{/vars}}) + { + {{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null) + if ({{name}} == null) + { + throw new InvalidDataException("{{name}} is a required property for {{classname}} and cannot be null"); + } + else + { + this.{{name}} = {{name}}; + } + {{/required}}{{/isReadOnly}}{{/vars}} + {{#vars}}{{^isReadOnly}}{{^required}} + {{#defaultValue}}// use default value if no "{{name}}" provided + if ({{name}} == null) + { + this.{{name}} = {{{defaultValue}}}; + } + else + { + this.{{name}} = {{name}}; + } + {{/defaultValue}} + {{^defaultValue}} + this.{{name}} = {{name}}; + {{/defaultValue}} + {{/required}}{{/isReadOnly}}{{/vars}} + } + + {{#vars}} + {{^isEnum}} + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{#description}} + /// {{description}}{{/description}} + [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] + public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + {{/isEnum}} + {{/vars}} + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + {{#vars}}sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/vars}} + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public {{#parent}} new {{/parent}}string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as {{classname}}); + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return {{#vars}}{{#isNotContainer}} + ( + this.{{name}} == other.{{name}} || + this.{{name}} != null && + this.{{name}}.Equals(other.{{name}}) + ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{^isNotContainer}} + ( + this.{{name}} == other.{{name}} || + this.{{name}} != null && + this.{{name}}.SequenceEqual(other.{{name}}) + ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{/vars}}{{^vars}}false{{/vars}}; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + {{#vars}} + if (this.{{name}} != null) + hash = hash * 59 + this.{{name}}.GetHashCode(); + {{/vars}} + return hash; + } + } + } diff --git a/modules/swagger-codegen/src/main/resources/csharp/modelInnerEnum.mustache b/modules/swagger-codegen/src/main/resources/csharp/modelInnerEnum.mustache new file mode 100644 index 00000000000..5249d754577 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/modelInnerEnum.mustache @@ -0,0 +1,15 @@ + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{#description}} + /// {{{description}}}{{/description}} + [JsonConverter(typeof(StringEnumConverter))] + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + { + {{#allowableValues}}{{#enumVars}} + /// + /// Enum {{name}} for {{{value}}} + /// + [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] + {{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + {{/-last}}{{/enumVars}}{{/allowableValues}} + } diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index ef3585a1069..6ca3a39324f 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -2,149 +2,121 @@ package {{packageName}} {{#operations}} import ( - "strings" - "fmt" - "errors" -{{#imports}} "{{import}}" + "strings" + "fmt" + "errors" + {{#imports}}"{{import}}" {{/imports}} ) type {{classname}} struct { - Configuration Configuration + Configuration Configuration } -func New{{classname}}() *{{classname}}{ - configuration := NewConfiguration() - return &{{classname}} { - Configuration: *configuration, - } +func New{{classname}}() *{{classname}} { + configuration := NewConfiguration() + return &{{classname}}{ + Configuration: *configuration, + } } -func New{{classname}}WithBasePath(basePath string) *{{classname}}{ - configuration := NewConfiguration() - configuration.BasePath = basePath - - return &{{classname}} { - Configuration: *configuration, - } -} +func New{{classname}}WithBasePath(basePath string) *{{classname}} { + configuration := NewConfiguration() + configuration.BasePath = basePath + return &{{classname}}{ + Configuration: *configuration, + } +} {{#operation}} + /** - * {{summary}} - * {{notes}} + * {{summary}}{{#notes}} + * {{notes}}{{/notes}} + * {{#allParams}} * @param {{paramName}} {{description}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ -func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}*{{{returnType}}}, {{/returnType}}*APIResponse, error) { +func (a {{classname}}) {{nickname}}({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}APIResponse, error) { - var httpMethod = "{{httpMethod}}" - // create path and map variables - path := a.Configuration.BasePath + "{{path}}" -{{#pathParams}} path = strings.Replace(path, "{" + "{{baseName}}" + "}", fmt.Sprintf("%v", {{paramName}}), -1) -{{/pathParams}} + var httpMethod = "{{httpMethod}}" + // create path and map variables + path := a.Configuration.BasePath + "{{path}}"{{#pathParams}} + path = strings.Replace(path, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}} +{{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + if &{{paramName}} == nil { + return {{#returnType}}*new({{{returnType}}}), {{/returnType}}*NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") + }{{/required}}{{/allParams}} - {{#allParams}} - {{#required}} - // verify the required parameter '{{paramName}}' is set - if &{{paramName}} == nil { - return {{#returnType}}new({{{returnType}}}), {{/returnType}}nil, errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") - } - {{/required}} - {{/allParams}} + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte +{{#authMethods}} + // authentication ({{name}}) required +{{#isApiKey}}{{#isKeyInHeader}} + // set key with prefix in header + headerParams["{{keyParamName}}"] = a.Configuration.GetAPIKeyWithPrefix("{{keyParamName}}") +{{/isKeyInHeader}}{{#isKeyInQuery}} + // set key with prefix in querystring{{#hasKeyParamName}} + queryParams["{{keyParamName}}"] = a.Configuration.GetAPIKeyWithPrefix("{{keyParamName}}") +{{/hasKeyParamName}}{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}} + // http basic authentication required + if a.Configuration.Username != "" || a.Configuration.Password != ""{ + headerParams["Authorization"] = "Basic " + a.Configuration.GetBasicAuthEncodedString() + }{{/isBasic}}{{#isOAuth}} + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + }{{/isOAuth}}{{/authMethods}} + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + }{{#hasQueryParams}}{{#queryParams}} - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + queryParams["{{paramName}}"] = a.Configuration.APIClient.ParameterToString({{paramName}}) + {{/queryParams}}{{/hasQueryParams}} - {{#authMethods}}// authentication ({{name}}) required - {{#isApiKey}}{{#isKeyInHeader}} - // set key with prefix in header - headerParams["{{keyParamName}}"] = a.Configuration.GetAPIKeyWithPrefix("{{keyParamName}}") - {{/isKeyInHeader}}{{#isKeyInQuery}} - // set key with prefix in querystring - {{#hasKeyParamName}} - queryParams["{{keyParamName}}"] = a.Configuration.GetAPIKeyWithPrefix("{{keyParamName}}") - {{/hasKeyParamName}} - {{/isKeyInQuery}}{{/isApiKey}} - {{#isBasic}} - // http basic authentication required - if a.Configuration.Username != "" || a.Configuration.Password != ""{ - headerParams["Authorization"] = "Basic " + a.Configuration.GetBasicAuthEncodedString() - } - {{/isBasic}} - {{#isOAuth}} - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } - {{/isOAuth}} - {{/authMethods}} + // to determine the Content-Type header + localVarHttpContentTypes := []string{ {{#consumes}}"{{mediaType}}", {{/consumes}} } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - - {{#hasQueryParams}} - {{#queryParams}} - queryParams["{{paramName}}"] = a.Configuration.APIClient.ParameterToString({{paramName}}) - {{/queryParams}} - {{/hasQueryParams}} + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + {{#produces}}"{{mediaType}}", +{{/produces}} } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - {{#consumes}} - "{{mediaType}}", - {{/consumes}} - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - {{#produces}} - "{{mediaType}}", - {{/produces}} - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } -{{#hasHeaderParams}}{{#headerParams}} // header params "{{baseName}}" - headerParams["{{baseName}}"] = {{paramName}} -{{/headerParams}}{{/hasHeaderParams}} -{{#hasFormParams}} -{{#formParams}} - {{#isFile}}fbs, _ := ioutil.ReadAll(file) - fileBytes = fbs - fileName = file.Name() - {{/isFile}} -{{^isFile}}formParams["{{paramName}}"] = {{paramName}} - {{/isFile}} -{{/formParams}} -{{/hasFormParams}}{{#hasBodyParam}}{{#bodyParams}} // body params - postBody = &{{paramName}} + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + }{{#hasHeaderParams}} + +{{#headerParams}} // header params "{{baseName}}" + headerParams["{{baseName}}"] = {{paramName}} +{{/headerParams}}{{/hasHeaderParams}}{{#hasFormParams}} +{{#formParams}}{{#isFile}} + fbs, _ := ioutil.ReadAll(file) + fileBytes = fbs + fileName = file.Name(){{/isFile}} +{{^isFile}} formParams["{{paramName}}"] = {{paramName}}{{/isFile}}{{/formParams}}{{/hasFormParams}}{{#hasBodyParam}} +{{#bodyParams}} // body params + postBody = &{{paramName}} {{/bodyParams}}{{/hasBodyParam}} -{{#returnType}} var successPayload = new({{returnType}}){{/returnType}} - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return {{#returnType}}successPayload, {{/returnType}}NewAPIResponse(httpResponse.RawResponse), err - } +{{#returnType}} var successPayload = new({{returnType}}){{/returnType}} + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return {{#returnType}}*successPayload, {{/returnType}}*NewAPIResponse(httpResponse.RawResponse), err + } {{#returnType}} - - err = json.Unmarshal(httpResponse.Body(), &successPayload) -{{/returnType}} - - return {{#returnType}}successPayload, {{/returnType}}NewAPIResponse(httpResponse.RawResponse), err + err = json.Unmarshal(httpResponse.Body(), &successPayload){{/returnType}} + return {{#returnType}}*successPayload, {{/returnType}}*NewAPIResponse(httpResponse.RawResponse), err } -{{/operation}} -{{/operations}} +{{/operation}}{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/go/api_client.mustache b/modules/swagger-codegen/src/main/resources/go/api_client.mustache index a88445656d7..88c5ce07e4e 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_client.mustache @@ -1,123 +1,120 @@ package {{packageName}} import ( - "strings" - "github.com/go-resty/resty" - "fmt" - "reflect" - "bytes" - "path/filepath" + "bytes" + "fmt" + "path/filepath" + "reflect" + "strings" + + "github.com/go-resty/resty" ) type APIClient struct { - } func (c *APIClient) SelectHeaderContentType(contentTypes []string) string { - if (len(contentTypes) == 0){ - return "" - } - if contains(contentTypes,"application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' } func (c *APIClient) SelectHeaderAccept(accepts []string) string { - if (len(accepts) == 0){ - return "" - } - if contains(accepts,"application/json"){ - return "application/json" - } - - return strings.Join(accepts,",") + if len(accepts) == 0 { + return "" + } + if contains(accepts, "application/json") { + return "application/json" + } + return strings.Join(accepts, ",") } func contains(source []string, containvalue string) bool { - for _, a := range source { - if strings.ToLower(a) == strings.ToLower(containvalue) { - return true - } - } - return false + for _, a := range source { + if strings.ToLower(a) == strings.ToLower(containvalue) { + return true + } + } + return false } - func (c *APIClient) CallAPI(path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams map[string]string, - formParams map[string]string, - fileName string, - fileBytes []byte) (*resty.Response, error) { + postBody interface{}, + headerParams map[string]string, + queryParams map[string]string, + formParams map[string]string, + fileName string, + fileBytes []byte) (*resty.Response, error) { - //set debug flag - configuration := NewConfiguration() - resty.SetDebug(configuration.GetDebug()) + //set debug flag + configuration := NewConfiguration() + resty.SetDebug(configuration.GetDebug()) - request := prepareRequest(postBody, headerParams, queryParams, formParams,fileName,fileBytes) + request := prepareRequest(postBody, headerParams, queryParams, formParams, fileName, fileBytes) - switch strings.ToUpper(method) { - case "GET": - response, err := request.Get(path) - return response, err - case "POST": - response, err := request.Post(path) - return response, err - case "PUT": - response, err := request.Put(path) - return response, err - case "PATCH": - response, err := request.Patch(path) - return response, err - case "DELETE": - response, err := request.Delete(path) - return response, err - } + switch strings.ToUpper(method) { + case "GET": + response, err := request.Get(path) + return response, err + case "POST": + response, err := request.Post(path) + return response, err + case "PUT": + response, err := request.Put(path) + return response, err + case "PATCH": + response, err := request.Patch(path) + return response, err + case "DELETE": + response, err := request.Delete(path) + return response, err + } - return nil, fmt.Errorf("invalid method %v", method) + return nil, fmt.Errorf("invalid method %v", method) } func (c *APIClient) ParameterToString(obj interface{}) string { - if reflect.TypeOf(obj).String() == "[]string" { - return strings.Join(obj.([]string), ",") - } else { - return obj.(string) - } + if reflect.TypeOf(obj).String() == "[]string" { + return strings.Join(obj.([]string), ",") + } else { + return obj.(string) + } } func prepareRequest(postBody interface{}, - headerParams map[string]string, - queryParams map[string]string, - formParams map[string]string, - fileName string, - fileBytes []byte) *resty.Request { + headerParams map[string]string, + queryParams map[string]string, + formParams map[string]string, + fileName string, + fileBytes []byte) *resty.Request { - request := resty.R() + request := resty.R() + request.SetBody(postBody) - request.SetBody(postBody) + // add header parameter, if any + if len(headerParams) > 0 { + request.SetHeaders(headerParams) + } - // add header parameter, if any - if len(headerParams) > 0 { - request.SetHeaders(headerParams) - } - - // add query parameter, if any - if len(queryParams) > 0 { - request.SetQueryParams(queryParams) - } + // add query parameter, if any + if len(queryParams) > 0 { + request.SetQueryParams(queryParams) + } - // add form parameter, if any - if len(formParams) > 0 { - request.SetFormData(formParams) - } - - if len(fileBytes) > 0 && fileName != "" { - _, fileNm := filepath.Split(fileName) - request.SetFileReader("file", fileNm, bytes.NewReader(fileBytes)) - } - return request + // add form parameter, if any + if len(formParams) > 0 { + request.SetFormData(formParams) + } + + if len(fileBytes) > 0 && fileName != "" { + _, fileNm := filepath.Split(fileName) + request.SetFileReader("file", fileNm, bytes.NewReader(fileBytes)) + } + return request } diff --git a/modules/swagger-codegen/src/main/resources/go/api_response.mustache b/modules/swagger-codegen/src/main/resources/go/api_response.mustache index 9f81de76d62..a15293f4402 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_response.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_response.mustache @@ -1,24 +1,22 @@ package {{packageName}} import ( - "net/http" + "net/http" ) - type APIResponse struct { - *http.Response - - Message string `json:"message,omitempty"` + *http.Response + Message string `json:"message,omitempty"` } func NewAPIResponse(r *http.Response) *APIResponse { - response := &APIResponse{Response: r} - return response + response := &APIResponse{Response: r} + return response } func NewAPIResponseWithError(errorMessage string) *APIResponse { - response := &APIResponse{Message: errorMessage} - return response -} \ No newline at end of file + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/modules/swagger-codegen/src/main/resources/go/configuration.mustache b/modules/swagger-codegen/src/main/resources/go/configuration.mustache index d971bf0373b..463f77c54dc 100644 --- a/modules/swagger-codegen/src/main/resources/go/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/go/configuration.mustache @@ -1,59 +1,59 @@ package {{packageName}} import ( - "encoding/base64" + "encoding/base64" ) type Configuration struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` - APIKeyPrefix map[string] string `json:"APIKeyPrefix,omitempty"` - APIKey map[string] string `json:"APIKey,omitempty"` - debug bool `json:"debug,omitempty"` - DebugFile string `json:"debugFile,omitempty"` - OAuthToken string `json:"oAuthToken,omitempty"` - Timeout int `json:"timeout,omitempty"` - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - AccessToken string `json:"accessToken,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - APIClient APIClient `json:"APIClient,omitempty"` + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` + APIKeyPrefix map[string]string `json:"APIKeyPrefix,omitempty"` + APIKey map[string]string `json:"APIKey,omitempty"` + debug bool `json:"debug,omitempty"` + DebugFile string `json:"debugFile,omitempty"` + OAuthToken string `json:"oAuthToken,omitempty"` + Timeout int `json:"timeout,omitempty"` + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + AccessToken string `json:"accessToken,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + APIClient APIClient `json:"APIClient,omitempty"` } func NewConfiguration() *Configuration { - return &Configuration{ - BasePath: "{{basePath}}", - UserName: "", - debug: false, - DefaultHeader: make(map[string]string), - APIKey: make(map[string]string), - APIKeyPrefix: make(map[string]string), - UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/go{{/httpUserAgent}}", - } + return &Configuration{ + BasePath: "{{basePath}}", + UserName: "", + debug: false, + DefaultHeader: make(map[string]string), + APIKey: make(map[string]string), + APIKeyPrefix: make(map[string]string), + UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/go{{/httpUserAgent}}", + } } func (c *Configuration) GetBasicAuthEncodedString() string { - return base64.StdEncoding.EncodeToString([]byte(c.UserName + ":" + c.Password)) + return base64.StdEncoding.EncodeToString([]byte(c.UserName + ":" + c.Password)) } func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value + c.DefaultHeader[key] = value } func (c *Configuration) GetAPIKeyWithPrefix(APIKeyIdentifier string) string { - if c.APIKeyPrefix[APIKeyIdentifier] != ""{ - return c.APIKeyPrefix[APIKeyIdentifier] + " " + c.APIKey[APIKeyIdentifier] - } - - return c.APIKey[APIKeyIdentifier] + if c.APIKeyPrefix[APIKeyIdentifier] != "" { + return c.APIKeyPrefix[APIKeyIdentifier] + " " + c.APIKey[APIKeyIdentifier] + } + + return c.APIKey[APIKeyIdentifier] } -func (c *Configuration) SetDebug(enable bool){ - c.debug = enable +func (c *Configuration) SetDebug(enable bool) { + c.debug = enable } func (c *Configuration) GetDebug() bool { - return c.debug -} \ No newline at end of file + return c.debug +} diff --git a/modules/swagger-codegen/src/main/resources/go/model.mustache b/modules/swagger-codegen/src/main/resources/go/model.mustache index 4102299c5e9..fd799a0e35d 100644 --- a/modules/swagger-codegen/src/main/resources/go/model.mustache +++ b/modules/swagger-codegen/src/main/resources/go/model.mustache @@ -1,18 +1,14 @@ package {{packageName}} - -{{#models}} -import ( -{{#imports}} "{{import}}" -{{/imports}} +{{#models}}{{#imports}} +import ({{/imports}}{{#imports}} + "{{import}}"{{/imports}}{{#imports}} ) - -{{#model}} -{{#description}}// {{{description}}}{{/description}} +{{/imports}}{{#model}}{{#description}} +// {{{description}}}{{/description}} type {{classname}} struct { - {{#vars}} - {{#description}}// {{{description}}}{{/description}} - {{name}} {{{datatype}}} `json:"{{baseName}},omitempty"` - {{/vars}} +{{#vars}}{{#description}} + // {{{description}}}{{/description}} + {{name}} {{{datatype}}} `json:"{{baseName}},omitempty"` +{{/vars}} } -{{/model}} -{{/models}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache index 7945137c664..5b8b9b21632 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache @@ -69,7 +69,7 @@ class ApiClient * Constructor of the class * @param Configuration $config config for this ApiClient */ - public function __construct(Configuration $config = null) + public function __construct(\{{invokerPackage}}\Configuration $config = null) { if ($config == null) { $config = Configuration::getDefaultConfiguration(); diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index c0401940b48..c8b16b46052 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -60,7 +60,7 @@ use \{{invokerPackage}}\ObjectSerializer; * Constructor * @param \{{invokerPackage}}\ApiClient|null $apiClient The api client to use */ - function __construct($apiClient = null) + function __construct(\{{invokerPackage}}\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -84,7 +84,7 @@ use \{{invokerPackage}}\ObjectSerializer; * @param \{{invokerPackage}}\ApiClient $apiClient set the API client * @return {{classname}} */ - public function setApiClient(ApiClient $apiClient) + public function setApiClient(\{{invokerPackage}}\ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 6f292e854af..2a7894ab860 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -62,55 +62,71 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ); - + static function swaggerTypes() { return self::$swaggerTypes{{#parent}} + parent::swaggerTypes(){{/parent}}; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ); - + static function attributeMap() { return {{#parent}}parent::attributeMap() + {{/parent}}self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( {{#vars}}'{{name}}' => '{{setter}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ); - + static function setters() { return {{#parent}}parent::setters() + {{/parent}}self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( {{#vars}}'{{name}}' => '{{getter}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ); - + static function getters() { return {{#parent}}parent::getters() + {{/parent}}self::$getters; } + {{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = {{{value}}}; + {{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}} + + {{#vars}}{{#isEnum}} + /** + * Gets allowable values of the enum + * @return string[] + */ + public function {{getter}}AllowableValues() { + return [ + {{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}} + {{/-last}}{{/enumVars}}{{/allowableValues}} + ]; + } + {{/isEnum}}{{/vars}} + {{#vars}} /** - * ${{name}} {{#description}}{{{description}}}{{/description}} - * @var {{datatype}} - */ + * ${{name}} {{#description}}{{{description}}}{{/description}} + * @var {{datatype}} + */ protected ${{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; {{/vars}} @@ -140,7 +156,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA { return $this->{{name}}; } - + /** * Sets {{name}} * @param {{datatype}} ${{name}} {{#description}}{{{description}}}{{/description}} @@ -165,7 +181,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -175,7 +191,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -186,7 +202,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -196,7 +212,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/modules/swagger-codegen/src/main/resources/php/model_enum.mustache b/modules/swagger-codegen/src/main/resources/php/model_enum.mustache new file mode 100644 index 00000000000..4598f9fdff9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php/model_enum.mustache @@ -0,0 +1,17 @@ +class {{classname}} { + {{#allowableValues}}{{#enumVars}}const {{{name}}} = {{{value}}}; + {{/enumVars}}{{/allowableValues}} + + {{#vars}}{{#isEnum}} + /** + * Gets allowable values of the enum + * @return string[] + */ + public function {{getter}}AllowableValues() { + return [ + {{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}} + {{/-last}}{{/enumVars}}{{/allowableValues}} + ]; + } + {{/isEnum}}{{/vars}} +} diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache new file mode 100644 index 00000000000..006cd09c62a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -0,0 +1,169 @@ +class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayAccess +{ + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + static $swaggerTypes = array( + {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ); + + static function swaggerTypes() { + return self::$swaggerTypes{{#parent}} + parent::swaggerTypes(){{/parent}}; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + static $attributeMap = array( + {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ); + + static function attributeMap() { + return {{#parent}}parent::attributeMap() + {{/parent}}self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + static $setters = array( + {{#vars}}'{{name}}' => '{{setter}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ); + + static function setters() { + return {{#parent}}parent::setters() + {{/parent}}self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + static $getters = array( + {{#vars}}'{{name}}' => '{{getter}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ); + + static function getters() { + return {{#parent}}parent::getters() + {{/parent}}self::$getters; + } + + {{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = {{{value}}}; + {{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}} + + {{#vars}}{{#isEnum}} + /** + * Gets allowable values of the enum + * @return string[] + */ + public function {{getter}}AllowableValues() { + return [ + {{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}} + {{/-last}}{{/enumVars}}{{/allowableValues}} + ]; + } + {{/isEnum}}{{/vars}} + + {{#vars}} + /** + * ${{name}} {{#description}}{{{description}}}{{/description}} + * @var {{datatype}} + */ + protected ${{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; + {{/vars}} + + /** + * Constructor + * @param mixed[] $data Associated array of property value initalizing the model + */ + public function __construct(array $data = null) + { + {{#parent}}parent::__construct($data);{{/parent}} + if ($data != null) { + {{#vars}}$this->{{name}} = $data["{{name}}"];{{#hasMore}} + {{/hasMore}}{{/vars}} + } + } + {{#vars}} + /** + * Gets {{name}}. + * @return {{datatype}} + */ + public function {{getter}}() + { + return $this->{{name}}; + } + + /** + * Sets {{name}}. + * @param {{datatype}} ${{name}} {{#description}}{{{description}}}{{/description}} + * @return $this + */ + public function {{setter}}(${{name}}) + { + {{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}); + if (!in_array(${{{name}}}, $allowed_values)) { + throw new \InvalidArgumentException("Invalid value for '{{name}}', must be one of {{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}"); + }{{/isEnum}} + $this->{{name}} = ${{name}}; + return $this; + } + {{/vars}} + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->$offset); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return $this->$offset; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + $this->$offset = $value; + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->$offset); + } + + /** + * Gets the string presentation of the object. + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { + return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } else { + return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this)); + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Angular/api.d.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.d.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/TypeScript-Angular/api.d.mustache rename to modules/swagger-codegen/src/main/resources/typescript-angular/api.d.mustache diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Angular/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/TypeScript-Angular/api.mustache rename to modules/swagger-codegen/src/main/resources/typescript-angular/api.mustache diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Angular/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/git_push.sh.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/TypeScript-Angular/git_push.sh.mustache rename to modules/swagger-codegen/src/main/resources/typescript-angular/git_push.sh.mustache diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Angular/model.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/model.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/TypeScript-Angular/model.mustache rename to modules/swagger-codegen/src/main/resources/typescript-angular/model.mustache diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache rename to modules/swagger-codegen/src/main/resources/typescript-node/api.mustache diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-node/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/git_push.sh.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/TypeScript-node/git_push.sh.mustache rename to modules/swagger-codegen/src/main/resources/typescript-node/git_push.sh.mustache 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 4160e59cc48..cf95a2612e2 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 @@ -899,6 +899,33 @@ definitions: format: password maxLength: 64 minLength: 10 + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + properties: + enum_string: + type: string + enum: + - UPPER + - lower + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 externalDocs: description: Find out more about Swagger url: 'http://swagger.io' diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.json b/modules/swagger-codegen/src/test/resources/2_0/petstore.json index 838b3c8b2da..24fcf4bf768 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore.json +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.json @@ -1,3 +1,4 @@ + { "swagger": "2.0", "info": { diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/FormatTestTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/FormatTestTests.cs index a6eec919779..7676fcae9b9 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/FormatTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/FormatTestTests.cs @@ -139,6 +139,14 @@ namespace IO.Swagger.Test // TODO: unit test for the property 'DateTime' } /// + /// Test the property 'Uuid' + /// + [Test] + public void UuidTest() + { + // TODO: unit test for the property 'Uuid' + } + /// /// Test the property 'Password' /// [Test] diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md index a5c2cd33359..aceb18e3396 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/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-04-21T17:22:44.115+08:00 +- Build date: 2016-04-27T22:04:12.906+08:00 - Build package: class io.swagger.codegen.languages.CSharpClientCodegen ## Frameworks supported @@ -53,20 +53,28 @@ namespace Example public void main() { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN'; - - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new FakeApi(); + var number = number_example; // string | None + var _double = 1.2; // double? | None + var _string = _string_example; // string | None + var _byte = B; // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789; // long? | None (optional) + var _float = 3.4; // float? | None (optional) + var binary = B; // byte[] | None (optional) + var date = 2013-10-20; // DateTime? | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var password = password_example; // string | None (optional) try { - // Add a new pet to the store - apiInstance.AddPet(body); + // Fake endpoint for testing various parameters + apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); } catch (Exception e) { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); } } } @@ -79,6 +87,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -108,6 +117,8 @@ Class | Method | HTTP request | Description - [IO.Swagger.Model.Cat](docs/Cat.md) - [IO.Swagger.Model.Category](docs/Category.md) - [IO.Swagger.Model.Dog](docs/Dog.md) + - [IO.Swagger.Model.EnumClass](docs/EnumClass.md) + - [IO.Swagger.Model.EnumTest](docs/EnumTest.md) - [IO.Swagger.Model.FormatTest](docs/FormatTest.md) - [IO.Swagger.Model.Model200Response](docs/Model200Response.md) - [IO.Swagger.Model.ModelReturn](docs/ModelReturn.md) diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FakeApi.md new file mode 100644 index 00000000000..ae9fd8c3d36 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FakeApi.md @@ -0,0 +1,91 @@ +# IO.Swagger.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters + + +# **TestEndpointParameters** +> void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null) + +Fake endpoint for testing various parameters + +Fake endpoint for testing various parameters + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var number = 3.4; // double? | None + var _double = 1.2; // double? | None + var _string = _string_example; // string | None + var _byte = B; // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789; // long? | None (optional) + var _float = 3.4; // float? | None (optional) + var binary = B; // byte[] | None (optional) + var date = 2013-10-20; // DateTime? | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var password = password_example; // string | None (optional) + + try + { + // Fake endpoint for testing various parameters + apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **double?**| None | + **_double** | **double?**| None | + **_string** | **string**| None | + **_byte** | **byte[]**| None | + **integer** | **int?**| None | [optional] + **int32** | **int?**| None | [optional] + **int64** | **long?**| None | [optional] + **_float** | **float?**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **DateTime?**| None | [optional] + **dateTime** | **DateTime?**| None | [optional] + **password** | **string**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md index d29dc6b5d79..c5dc3cf53f3 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md @@ -10,11 +10,11 @@ Name | Type | Description | Notes **_Float** | **float?** | | [optional] **_Double** | **double?** | | [optional] **_String** | **string** | | [optional] -**_Byte** | **byte[]** | | [optional] +**_Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] -**Date** | **DateTime?** | | [optional] +**Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] -**Password** | **string** | | [optional] +**Password** | **string** | | [[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/SwaggerClientTest/Lib/SwaggerClient/git_push.sh b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/git_push.sh index 13d463698c5..792320114fb 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/git_push.sh +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/FakeApi.cs new file mode 100644 index 00000000000..1c92dc3bbda --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/FakeApi.cs @@ -0,0 +1,418 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp; +using IO.Swagger.Client; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi + { + #region Synchronous Operations + /// + /// Fake endpoint for testing various parameters + /// + /// + /// Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null); + + /// + /// Fake endpoint for testing various parameters + /// + /// + /// Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + ApiResponse TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Fake endpoint for testing various parameters + /// + /// + /// Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null); + + /// + /// Fake endpoint for testing various parameters + /// + /// + /// Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeApi : IFakeApi + { + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(String basePath) + { + this.Configuration = new Configuration(new ApiClient(basePath)); + + // ensure API client has configuration ready + if (Configuration.ApiClient.Configuration == null) + { + this.Configuration.ApiClient.Configuration = this.Configuration; + } + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeApi(Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Configuration.Default; + else + this.Configuration = configuration; + + // ensure API client has configuration ready + if (Configuration.ApiClient.Configuration == null) + { + this.Configuration.ApiClient.Configuration = this.Configuration; + } + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// 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.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Configuration Configuration {get; set;} + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public Dictionary DefaultHeader() + { + return this.Configuration.DefaultHeader; + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Fake endpoint for testing various parameters Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + public void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null) + { + TestEndpointParametersWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + } + + /// + /// Fake endpoint for testing various parameters Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + public ApiResponse TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_string' is set + if (_string == null) + throw new ApiException(400, "Missing required parameter '_string' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "/fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + // set "format" to json by default + // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json + localVarPathParams.Add("format", "json"); + if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter + if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter + if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter + if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter + if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter + if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter + if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter + if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter + if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter + if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter + if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter + if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (localVarStatusCode >= 400) + throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content); + else if (localVarStatusCode == 0) + throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); + + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + null); + } + + /// + /// Fake endpoint for testing various parameters Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null) + { + await TestEndpointParametersAsyncWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + + } + + /// + /// Fake endpoint for testing various parameters Fake endpoint for testing various parameters + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_string' is set + if (_string == null) + throw new ApiException(400, "Missing required parameter '_string' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "/fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + // set "format" to json by default + // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json + localVarPathParams.Add("format", "json"); + if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter + if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter + if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter + if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter + if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter + if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter + if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter + if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter + if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter + if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter + if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter + if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (localVarStatusCode >= 400) + throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content); + else if (localVarStatusCode == 0) + throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); + + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + null); + } + + } +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs index b2db1964a52..f5b9a3efee0 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs @@ -12,18 +12,15 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// Animal /// [DataContract] public partial class Animal : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// ClassName (required). - public Animal(string ClassName = null) { // to ensure "ClassName" is required (not null) @@ -36,15 +33,14 @@ namespace IO.Swagger.Model this.ClassName = ClassName; } + } - - + /// /// Gets or Sets ClassName /// [DataMember(Name="className", EmitDefaultValue=false)] public string ClassName { get; set; } - /// /// Returns the string presentation of the object /// @@ -57,7 +53,7 @@ namespace IO.Swagger.Model sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -113,6 +109,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs index de8b24e69e9..8a0f40369fb 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs @@ -12,47 +12,44 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// ApiResponse /// [DataContract] public partial class ApiResponse : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Code. /// Type. /// Message. - public ApiResponse(int? Code = null, string Type = null, string Message = null) { - this.Code = Code; - this.Type = Type; - this.Message = Message; + + + this.Code = Code; + + this.Type = Type; + + this.Message = Message; } - - + /// /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] public int? Code { get; set; } - /// /// Gets or Sets Type /// [DataMember(Name="type", EmitDefaultValue=false)] public string Type { get; set; } - /// /// Gets or Sets Message /// [DataMember(Name="message", EmitDefaultValue=false)] public string Message { get; set; } - /// /// Returns the string presentation of the object /// @@ -62,12 +59,12 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); +sb.Append(" Type: ").Append(Type).Append("\n"); +sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -137,6 +134,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs index 3b05bcc0338..74bd81aee05 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs @@ -12,19 +12,16 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// Cat /// [DataContract] public partial class Cat : Animal, IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// ClassName (required). /// Declawed. - public Cat(string ClassName = null, bool? Declawed = null) { // to ensure "ClassName" is required (not null) @@ -36,23 +33,22 @@ namespace IO.Swagger.Model { this.ClassName = ClassName; } - this.Declawed = Declawed; + + + this.Declawed = Declawed; } - - + /// /// Gets or Sets ClassName /// [DataMember(Name="className", EmitDefaultValue=false)] public string ClassName { get; set; } - /// /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] public bool? Declawed { get; set; } - /// /// Returns the string presentation of the object /// @@ -62,11 +58,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); - sb.Append(" Declawed: ").Append(Declawed).Append("\n"); +sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -129,6 +125,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/CatDogTest.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/CatDogTest.cs new file mode 100644 index 00000000000..7868fef3f39 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/CatDogTest.cs @@ -0,0 +1,175 @@ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Model +{ + + /// + /// + /// + [DataContract] + public class CatDogTest : Cat, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + public CatDogTest() + { + this.CatDogInteger = 0; + + } + + + /// + /// Gets or Sets CatId + /// + [DataMember(Name="cat_id", EmitDefaultValue=false)] + public long? CatId { get; set; } + + + /// + /// Gets or Sets DogId + /// + [DataMember(Name="dog_id", EmitDefaultValue=false)] + public long? DogId { get; set; } + + + /// + /// integer property for testing allOf + /// + /// integer property for testing allOf + [DataMember(Name="CatDogInteger", EmitDefaultValue=false)] + public int? CatDogInteger { get; set; } + + + /// + /// Gets or Sets DogName + /// + [DataMember(Name="dog_name", EmitDefaultValue=false)] + public string DogName { get; set; } + + + /// + /// Gets or Sets CatName + /// + [DataMember(Name="cat_name", EmitDefaultValue=false)] + public string CatName { get; set; } + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatDogTest {\n"); + sb.Append(" CatId: ").Append(CatId).Append("\n"); + sb.Append(" DogId: ").Append(DogId).Append("\n"); + sb.Append(" CatDogInteger: ").Append(CatDogInteger).Append("\n"); + sb.Append(" DogName: ").Append(DogName).Append("\n"); + sb.Append(" CatName: ").Append(CatName).Append("\n"); + + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as CatDogTest); + } + + /// + /// Returns true if CatDogTest instances are equal + /// + /// Instance of CatDogTest to be compared + /// Boolean + public bool Equals(CatDogTest other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.CatId == other.CatId || + this.CatId != null && + this.CatId.Equals(other.CatId) + ) && + ( + this.DogId == other.DogId || + this.DogId != null && + this.DogId.Equals(other.DogId) + ) && + ( + this.CatDogInteger == other.CatDogInteger || + this.CatDogInteger != null && + this.CatDogInteger.Equals(other.CatDogInteger) + ) && + ( + this.DogName == other.DogName || + this.DogName != null && + this.DogName.Equals(other.DogName) + ) && + ( + this.CatName == other.CatName || + this.CatName != null && + this.CatName.Equals(other.CatName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + + if (this.CatId != null) + hash = hash * 57 + this.CatId.GetHashCode(); + + if (this.DogId != null) + hash = hash * 57 + this.DogId.GetHashCode(); + + if (this.CatDogInteger != null) + hash = hash * 57 + this.CatDogInteger.GetHashCode(); + + if (this.DogName != null) + hash = hash * 57 + this.DogName.GetHashCode(); + + if (this.CatName != null) + hash = hash * 57 + this.CatName.GetHashCode(); + + return hash; + } + } + + } +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs index f5dd0154fbc..51a3f971b38 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs @@ -12,39 +12,36 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// Category /// [DataContract] public partial class Category : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Name. - public Category(long? Id = null, string Name = null) { - this.Id = Id; - this.Name = Name; + + + this.Id = Id; + + this.Name = Name; } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } - /// /// Returns the string presentation of the object /// @@ -54,11 +51,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); +sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -121,6 +118,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs index 4d753963816..6ab8c9ad69f 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs @@ -12,19 +12,16 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// Dog /// [DataContract] public partial class Dog : Animal, IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// ClassName (required). /// Breed. - public Dog(string ClassName = null, string Breed = null) { // to ensure "ClassName" is required (not null) @@ -36,23 +33,22 @@ namespace IO.Swagger.Model { this.ClassName = ClassName; } - this.Breed = Breed; + + + this.Breed = Breed; } - - + /// /// Gets or Sets ClassName /// [DataMember(Name="className", EmitDefaultValue=false)] public string ClassName { get; set; } - /// /// Gets or Sets Breed /// [DataMember(Name="breed", EmitDefaultValue=false)] public string Breed { get; set; } - /// /// Returns the string presentation of the object /// @@ -62,11 +58,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); - sb.Append(" Breed: ").Append(Breed).Append("\n"); +sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -129,6 +125,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumClass.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumClass.cs new file mode 100644 index 00000000000..1fb5f0b6626 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumClass.cs @@ -0,0 +1,40 @@ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Model +{ + /// + /// Gets or Sets EnumClass + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumClass + { + + /// + /// Enum Abc for "_abc" + /// + [EnumMember(Value = "_abc")] + Abc, + + /// + /// Enum efg for "-efg" + /// + [EnumMember(Value = "-efg")] + efg, + + /// + /// Enum xyz for "(xyz)" + /// + [EnumMember(Value = "(xyz)")] + xyz + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumTest.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumTest.cs new file mode 100644 index 00000000000..f8bebd6b2d7 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumTest.cs @@ -0,0 +1,199 @@ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Model +{ + /// + /// EnumTest + /// + [DataContract] + public partial class EnumTest : IEquatable + { + /// + /// Gets or Sets EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + + /// + /// Enum Upper for "UPPER" + /// + [EnumMember(Value = "UPPER")] + Upper, + + /// + /// Enum Lower for "lower" + /// + [EnumMember(Value = "lower")] + Lower + } + + /// + /// Gets or Sets EnumInteger + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumIntegerEnum + { + + /// + /// Enum NUMBER_1 for 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for -1 + /// + [EnumMember(Value = "-1")] + NUMBER_MINUS_1 = -1 + } + + /// + /// Gets or Sets EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + + /// + /// Enum NUMBER_1_DOT_1 for 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 + } + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name="enum_string", EmitDefaultValue=false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name="enum_integer", EmitDefaultValue=false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name="enum_number", EmitDefaultValue=false)] + public EnumNumberEnum? EnumNumber { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// EnumString. + /// EnumInteger. + /// EnumNumber. + public EnumTest(EnumStringEnum? EnumString = null, EnumIntegerEnum? EnumInteger = null, EnumNumberEnum? EnumNumber = null) + { + + + this.EnumString = EnumString; + + this.EnumInteger = EnumInteger; + + this.EnumNumber = EnumNumber; + + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); +sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); +sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as EnumTest); + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.EnumString == other.EnumString || + this.EnumString != null && + this.EnumString.Equals(other.EnumString) + ) && + ( + this.EnumInteger == other.EnumInteger || + this.EnumInteger != null && + this.EnumInteger.Equals(other.EnumInteger) + ) && + ( + this.EnumNumber == other.EnumNumber || + this.EnumNumber != null && + this.EnumNumber.Equals(other.EnumNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.EnumString != null) + hash = hash * 59 + this.EnumString.GetHashCode(); + if (this.EnumInteger != null) + hash = hash * 59 + this.EnumInteger.GetHashCode(); + if (this.EnumNumber != null) + hash = hash * 59 + this.EnumNumber.GetHashCode(); + return hash; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs index 6d50426bad0..c5a99d45af0 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs @@ -12,15 +12,13 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// FormatTest /// [DataContract] public partial class FormatTest : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Integer. /// Int32. @@ -29,12 +27,11 @@ namespace IO.Swagger.Model /// _Float. /// _Double. /// _String. - /// _Byte. + /// _Byte (required). /// Binary. - /// Date. + /// Date (required). /// DateTime. - /// Password. - + /// Password (required). public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, string Password = null) { // to ensure "Number" is required (not null) @@ -46,93 +43,113 @@ namespace IO.Swagger.Model { this.Number = Number; } - this.Integer = Integer; - this.Int32 = Int32; - this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; - this._Byte = _Byte; - this.Binary = Binary; - this.Date = Date; - this.DateTime = DateTime; - this.Password = Password; + // to ensure "_Byte" is required (not null) + if (_Byte == null) + { + throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + } + else + { + this._Byte = _Byte; + } + // to ensure "Date" is required (not null) + if (Date == null) + { + throw new InvalidDataException("Date is a required property for FormatTest and cannot be null"); + } + else + { + this.Date = Date; + } + // to ensure "Password" is required (not null) + if (Password == null) + { + throw new InvalidDataException("Password is a required property for FormatTest and cannot be null"); + } + else + { + this.Password = Password; + } + + + this.Integer = Integer; + + this.Int32 = Int32; + + this.Int64 = Int64; + + this._Float = _Float; + + this._Double = _Double; + + this._String = _String; + + this.Binary = Binary; + + this.DateTime = DateTime; } - - + /// /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] public int? Integer { get; set; } - /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] public int? Int32 { get; set; } - /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] public long? Int64 { get; set; } - /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] public double? Number { get; set; } - /// /// Gets or Sets _Float /// [DataMember(Name="float", EmitDefaultValue=false)] public float? _Float { get; set; } - /// /// Gets or Sets _Double /// [DataMember(Name="double", EmitDefaultValue=false)] public double? _Double { get; set; } - /// /// Gets or Sets _String /// [DataMember(Name="string", EmitDefaultValue=false)] public string _String { get; set; } - /// /// Gets or Sets _Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] public byte[] _Byte { get; set; } - /// /// Gets or Sets Binary /// [DataMember(Name="binary", EmitDefaultValue=false)] public byte[] Binary { get; set; } - /// /// Gets or Sets Date /// [DataMember(Name="date", EmitDefaultValue=false)] public DateTime? Date { get; set; } - /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] public DateTime? DateTime { get; set; } - /// /// Gets or Sets Password /// [DataMember(Name="password", EmitDefaultValue=false)] public string Password { get; set; } - /// /// Returns the string presentation of the object /// @@ -142,21 +159,21 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); - sb.Append(" Int32: ").Append(Int32).Append("\n"); - sb.Append(" Int64: ").Append(Int64).Append("\n"); - sb.Append(" Number: ").Append(Number).Append("\n"); - sb.Append(" _Float: ").Append(_Float).Append("\n"); - sb.Append(" _Double: ").Append(_Double).Append("\n"); - sb.Append(" _String: ").Append(_String).Append("\n"); - sb.Append(" _Byte: ").Append(_Byte).Append("\n"); - sb.Append(" Binary: ").Append(Binary).Append("\n"); - sb.Append(" Date: ").Append(Date).Append("\n"); - sb.Append(" DateTime: ").Append(DateTime).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); +sb.Append(" Int32: ").Append(Int32).Append("\n"); +sb.Append(" Int64: ").Append(Int64).Append("\n"); +sb.Append(" Number: ").Append(Number).Append("\n"); +sb.Append(" _Float: ").Append(_Float).Append("\n"); +sb.Append(" _Double: ").Append(_Double).Append("\n"); +sb.Append(" _String: ").Append(_String).Append("\n"); +sb.Append(" _Byte: ").Append(_Byte).Append("\n"); +sb.Append(" Binary: ").Append(Binary).Append("\n"); +sb.Append(" Date: ").Append(Date).Append("\n"); +sb.Append(" DateTime: ").Append(DateTime).Append("\n"); +sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -289,6 +306,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/InlineResponse200.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/InlineResponse200.cs index e98ca7342cc..32d3db25e58 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/InlineResponse200.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/InlineResponse200.cs @@ -5,6 +5,7 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -12,25 +13,34 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// InlineResponse200 /// [DataContract] public partial class InlineResponse200 : IEquatable { - /// /// pet status in the store /// /// pet status in the store [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum { + public enum StatusEnum + { + /// + /// Enum Available for "available" + /// [EnumMember(Value = "available")] Available, + /// + /// Enum Pending for "pending" + /// [EnumMember(Value = "pending")] Pending, + /// + /// Enum Sold for "sold" + /// [EnumMember(Value = "sold")] Sold } @@ -47,14 +57,14 @@ namespace IO.Swagger.Model /// Initializes a new instance of the class. /// Initializes a new instance of the class. /// - /// PhotoUrls. - /// Name. + /// Tags. /// Id (required). /// Category. - /// Tags. /// pet status in the store. + /// Name. + /// PhotoUrls. - public InlineResponse200(List PhotoUrls = null, string Name = null, long? Id = null, Object Category = null, List Tags = null, StatusEnum? Status = null) + public InlineResponse200(List Tags = null, long? Id = null, Object Category = null, StatusEnum? Status = null, string Name = null, List PhotoUrls = null) { // to ensure "Id" is required (not null) if (Id == null) @@ -65,26 +75,20 @@ namespace IO.Swagger.Model { this.Id = Id; } - this.PhotoUrls = PhotoUrls; - this.Name = Name; - this.Category = Category; this.Tags = Tags; + this.Category = Category; this.Status = Status; + this.Name = Name; + this.PhotoUrls = PhotoUrls; } - + /// - /// Gets or Sets PhotoUrls + /// Gets or Sets Tags /// - [DataMember(Name="photoUrls", EmitDefaultValue=false)] - public List PhotoUrls { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } /// /// Gets or Sets Id @@ -99,10 +103,16 @@ namespace IO.Swagger.Model public Object Category { get; set; } /// - /// Gets or Sets Tags + /// Gets or Sets Name /// - [DataMember(Name="tags", EmitDefaultValue=false)] - public List Tags { get; set; } + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } /// /// Returns the string presentation of the object @@ -112,16 +122,17 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class InlineResponse200 {\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -155,14 +166,9 @@ namespace IO.Swagger.Model return ( - this.PhotoUrls == other.PhotoUrls || - this.PhotoUrls != null && - this.PhotoUrls.SequenceEqual(other.PhotoUrls) - ) && - ( - this.Name == other.Name || - this.Name != null && - this.Name.Equals(other.Name) + this.Tags == other.Tags || + this.Tags != null && + this.Tags.SequenceEqual(other.Tags) ) && ( this.Id == other.Id || @@ -174,15 +180,20 @@ namespace IO.Swagger.Model this.Category != null && this.Category.Equals(other.Category) ) && - ( - this.Tags == other.Tags || - this.Tags != null && - this.Tags.SequenceEqual(other.Tags) - ) && ( this.Status == other.Status || this.Status != null && this.Status.Equals(other.Status) + ) && + ( + this.Name == other.Name || + this.Name != null && + this.Name.Equals(other.Name) + ) && + ( + this.PhotoUrls == other.PhotoUrls || + this.PhotoUrls != null && + this.PhotoUrls.SequenceEqual(other.PhotoUrls) ); } @@ -197,21 +208,28 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) - if (this.PhotoUrls != null) - hash = hash * 59 + this.PhotoUrls.GetHashCode(); - if (this.Name != null) - hash = hash * 59 + this.Name.GetHashCode(); - if (this.Id != null) - hash = hash * 59 + this.Id.GetHashCode(); - if (this.Category != null) - hash = hash * 59 + this.Category.GetHashCode(); + if (this.Tags != null) hash = hash * 59 + this.Tags.GetHashCode(); + + if (this.Id != null) + hash = hash * 59 + this.Id.GetHashCode(); + + if (this.Category != null) + hash = hash * 59 + this.Category.GetHashCode(); + if (this.Status != null) hash = hash * 59 + this.Status.GetHashCode(); + + if (this.Name != null) + hash = hash * 59 + this.Name.GetHashCode(); + + if (this.PhotoUrls != null) + hash = hash * 59 + this.PhotoUrls.GetHashCode(); + return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs index 9199732c8e7..cec5ee75e2f 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs @@ -16,27 +16,24 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Model200Response : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Name. - public Model200Response(int? Name = null) { - this.Name = Name; + + + this.Name = Name; } - - + /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public int? Name { get; set; } - /// /// Returns the string presentation of the object /// @@ -49,7 +46,7 @@ namespace IO.Swagger.Model sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -105,6 +102,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs index a65c1430953..3cfa6c0a77e 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs @@ -16,27 +16,24 @@ namespace IO.Swagger.Model /// [DataContract] public partial class ModelReturn : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// _Return. - public ModelReturn(int? _Return = null) { - this._Return = _Return; + + + this._Return = _Return; } - - + /// /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] public int? _Return { get; set; } - /// /// Returns the string presentation of the object /// @@ -49,7 +46,7 @@ namespace IO.Swagger.Model sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -105,6 +102,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs index fe9c89588c9..b0e819fec20 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs @@ -16,15 +16,12 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Name : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// _Name (required). /// Property. - public Name(int? _Name = null, string Property = null) { // to ensure "_Name" is required (not null) @@ -36,29 +33,27 @@ namespace IO.Swagger.Model { this._Name = _Name; } - this.Property = Property; + + + this.Property = Property; } - - + /// /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] public int? _Name { get; set; } - /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] public int? SnakeCase { get; private set; } - /// /// Gets or Sets Property /// [DataMember(Name="property", EmitDefaultValue=false)] public string Property { get; set; } - /// /// Returns the string presentation of the object /// @@ -68,12 +63,12 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); - sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); - sb.Append(" Property: ").Append(Property).Append("\n"); +sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); +sb.Append(" Property: ").Append(Property).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -143,6 +138,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs index 78276f0e313..652128a33a1 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs @@ -12,40 +12,46 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// Order /// [DataContract] public partial class Order : IEquatable - { - + { /// /// Order Status /// /// Order Status [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum { + public enum StatusEnum + { + /// + /// Enum Placed for "placed" + /// [EnumMember(Value = "placed")] Placed, + /// + /// Enum Approved for "approved" + /// [EnumMember(Value = "approved")] Approved, + /// + /// Enum Delivered for "delivered" + /// [EnumMember(Value = "delivered")] Delivered } - /// /// Order Status /// /// Order Status [DataMember(Name="status", EmitDefaultValue=false)] public StatusEnum? Status { get; set; } - /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// PetId. @@ -53,14 +59,20 @@ namespace IO.Swagger.Model /// ShipDate. /// Order Status. /// Complete (default to false). - public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null) { - this.Id = Id; - this.PetId = PetId; - this.Quantity = Quantity; - this.ShipDate = ShipDate; - this.Status = Status; + + + this.Id = Id; + + this.PetId = PetId; + + this.Quantity = Quantity; + + this.ShipDate = ShipDate; + + this.Status = Status; + // use default value if no "Complete" provided if (Complete == null) { @@ -72,38 +84,32 @@ namespace IO.Swagger.Model } } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] public long? PetId { get; set; } - /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] public int? Quantity { get; set; } - /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] public DateTime? ShipDate { get; set; } - /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] public bool? Complete { get; set; } - /// /// Returns the string presentation of the object /// @@ -113,15 +119,15 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); +sb.Append(" PetId: ").Append(PetId).Append("\n"); +sb.Append(" Quantity: ").Append(Quantity).Append("\n"); +sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); +sb.Append(" Status: ").Append(Status).Append("\n"); +sb.Append(" Complete: ").Append(Complete).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -212,6 +218,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs index a878f83be04..420ab138b07 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs @@ -12,40 +12,46 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// Pet /// [DataContract] public partial class Pet : IEquatable - { - + { /// /// pet status in the store /// /// pet status in the store [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum { + public enum StatusEnum + { + /// + /// Enum Available for "available" + /// [EnumMember(Value = "available")] Available, + /// + /// Enum Pending for "pending" + /// [EnumMember(Value = "pending")] Pending, + /// + /// Enum Sold for "sold" + /// [EnumMember(Value = "sold")] Sold } - /// /// pet status in the store /// /// pet status in the store [DataMember(Name="status", EmitDefaultValue=false)] public StatusEnum? Status { get; set; } - /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Category. @@ -53,7 +59,6 @@ namespace IO.Swagger.Model /// PhotoUrls (required). /// Tags. /// pet status in the store. - public Pet(long? Id = null, Category Category = null, string Name = null, List PhotoUrls = null, List Tags = null, StatusEnum? Status = null) { // to ensure "Name" is required (not null) @@ -74,44 +79,43 @@ namespace IO.Swagger.Model { this.PhotoUrls = PhotoUrls; } - this.Id = Id; - this.Category = Category; - this.Tags = Tags; - this.Status = Status; + + + this.Id = Id; + + this.Category = Category; + + this.Tags = Tags; + + this.Status = Status; } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Category /// [DataMember(Name="category", EmitDefaultValue=false)] public Category Category { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } - /// /// Gets or Sets PhotoUrls /// [DataMember(Name="photoUrls", EmitDefaultValue=false)] public List PhotoUrls { get; set; } - /// /// Gets or Sets Tags /// [DataMember(Name="tags", EmitDefaultValue=false)] public List Tags { get; set; } - /// /// Returns the string presentation of the object /// @@ -121,15 +125,15 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); +sb.Append(" Category: ").Append(Category).Append("\n"); +sb.Append(" Name: ").Append(Name).Append("\n"); +sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); +sb.Append(" Tags: ").Append(Tags).Append("\n"); +sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -220,6 +224,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs index 7912fffa1fc..68a92724b1f 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs @@ -12,31 +12,28 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// SpecialModelName /// [DataContract] public partial class SpecialModelName : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// SpecialPropertyName. - public SpecialModelName(long? SpecialPropertyName = null) { - this.SpecialPropertyName = SpecialPropertyName; + + + this.SpecialPropertyName = SpecialPropertyName; } - - + /// /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] public long? SpecialPropertyName { get; set; } - /// /// Returns the string presentation of the object /// @@ -49,7 +46,7 @@ namespace IO.Swagger.Model sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -105,6 +102,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs index 6824a99836c..ffb42e09df9 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs @@ -12,39 +12,36 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// Tag /// [DataContract] public partial class Tag : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Name. - public Tag(long? Id = null, string Name = null) { - this.Id = Id; - this.Name = Name; + + + this.Id = Id; + + this.Name = Name; } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } - /// /// Returns the string presentation of the object /// @@ -54,11 +51,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); +sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -121,6 +118,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/TagCategoryTest.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/TagCategoryTest.cs new file mode 100644 index 00000000000..2cf870ffd77 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/TagCategoryTest.cs @@ -0,0 +1,143 @@ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Model +{ + + /// + /// + /// + [DataContract] + public class TagCategoryTest : Category, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + public TagCategoryTest() + { + this.TagCategoryInteger = 0; + + } + + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + + /// + /// integer property for testing allOf + /// + /// integer property for testing allOf + [DataMember(Name="TagCategoryInteger", EmitDefaultValue=false)] + public int? TagCategoryInteger { get; set; } + + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TagCategoryTest {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" TagCategoryInteger: ").Append(TagCategoryInteger).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as TagCategoryTest); + } + + /// + /// Returns true if TagCategoryTest instances are equal + /// + /// Instance of TagCategoryTest to be compared + /// Boolean + public bool Equals(TagCategoryTest other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.Id == other.Id || + this.Id != null && + this.Id.Equals(other.Id) + ) && + ( + this.TagCategoryInteger == other.TagCategoryInteger || + this.TagCategoryInteger != null && + this.TagCategoryInteger.Equals(other.TagCategoryInteger) + ) && + ( + this.Name == other.Name || + this.Name != null && + this.Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + + if (this.Id != null) + hash = hash * 57 + this.Id.GetHashCode(); + + if (this.TagCategoryInteger != null) + hash = hash * 57 + this.TagCategoryInteger.GetHashCode(); + + if (this.Name != null) + hash = hash * 57 + this.Name.GetHashCode(); + + return hash; + } + } + + } +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs index d8b8c491a18..3931afbf0f8 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs @@ -12,15 +12,13 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// User /// [DataContract] public partial class User : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Username. @@ -30,70 +28,69 @@ namespace IO.Swagger.Model /// Password. /// Phone. /// User Status. - public User(long? Id = null, string Username = null, string FirstName = null, string LastName = null, string Email = null, string Password = null, string Phone = null, int? UserStatus = null) { - this.Id = Id; - this.Username = Username; - this.FirstName = FirstName; - this.LastName = LastName; - this.Email = Email; - this.Password = Password; - this.Phone = Phone; - this.UserStatus = UserStatus; + + + this.Id = Id; + + this.Username = Username; + + this.FirstName = FirstName; + + this.LastName = LastName; + + this.Email = Email; + + this.Password = Password; + + this.Phone = Phone; + + this.UserStatus = UserStatus; } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Username /// [DataMember(Name="username", EmitDefaultValue=false)] public string Username { get; set; } - /// /// Gets or Sets FirstName /// [DataMember(Name="firstName", EmitDefaultValue=false)] public string FirstName { get; set; } - /// /// Gets or Sets LastName /// [DataMember(Name="lastName", EmitDefaultValue=false)] public string LastName { get; set; } - /// /// Gets or Sets Email /// [DataMember(Name="email", EmitDefaultValue=false)] public string Email { get; set; } - /// /// Gets or Sets Password /// [DataMember(Name="password", EmitDefaultValue=false)] public string Password { get; set; } - /// /// Gets or Sets Phone /// [DataMember(Name="phone", EmitDefaultValue=false)] public string Phone { get; set; } - /// /// User Status /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] public int? UserStatus { get; set; } - /// /// Returns the string presentation of the object /// @@ -103,17 +100,17 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); +sb.Append(" Username: ").Append(Username).Append("\n"); +sb.Append(" FirstName: ").Append(FirstName).Append("\n"); +sb.Append(" LastName: ").Append(LastName).Append("\n"); +sb.Append(" Email: ").Append(Email).Append("\n"); +sb.Append(" Password: ").Append(Password).Append("\n"); +sb.Append(" Phone: ").Append(Phone).Append("\n"); +sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -218,6 +215,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj index 7b777ba6a27..389c142e1bd 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj +++ b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj @@ -69,8 +69,11 @@ - + + + + diff --git a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs index 0b91bb4ae32..eb976117be8 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs +++ b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs @@ -1,28 +1,12 @@  - + - - - + + + + - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestEnum.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestEnum.cs new file mode 100644 index 00000000000..0ca6bb6c2a6 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestEnum.cs @@ -0,0 +1,39 @@ +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; +using Newtonsoft.Json; + +namespace SwaggerClientTest.TestEnum +{ + [TestFixture ()] + public class TestEnum + { + public TestEnum () + { + } + + /// + /// Test EnumClass + /// + [Test ()] + public void TestEnumClass () + { + // test serialization for string + Assert.AreEqual (Newtonsoft.Json.JsonConvert.SerializeObject(EnumClass.Abc), "\"_abc\""); + + // test serialization for number + Assert.AreEqual (Newtonsoft.Json.JsonConvert.SerializeObject(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1), "\"-1\""); + + // test cast to int + Assert.AreEqual ((int)EnumTest.EnumIntegerEnum.NUMBER_MINUS_1, -1); + + } + } +} + diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs index 6af386ff2ba..59411416a76 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs @@ -73,14 +73,14 @@ namespace SwaggerClientTest.TestOrder } - /* comment out the test case as the method is not defined in original petstore spec - * we will re-enable this after updating the petstore server - * + /* + * Skip the following test as the fake endpiont has been removed from the swagger spec + * We'll uncomment below after we update the Petstore server /// - /// Test GetInvetoryInObject + /// Test TestGetInventoryInObject /// [Test ()] - public void TestGetInventoryInObject () + public void TestGetInventoryInObject() { // set timeout to 10 seconds Configuration c1 = new Configuration (timeout: 10000); @@ -95,9 +95,18 @@ namespace SwaggerClientTest.TestOrder { Assert.IsInstanceOf (typeof(int?), Int32.Parse(entry.Value)); } + } + */ - }*/ + /// + /// Test Enum + /// + [Test ()] + public void TestEnum () + { + Assert.AreEqual (Order.StatusEnum.Approved.ToString(), "Approved"); + } } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt deleted file mode 100644 index 323cad108c6..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt +++ /dev/null @@ -1,9 +0,0 @@ -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 92a8f1b8685..9130ec599b6 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -7,7 +7,7 @@ This API client was generated by the [swagger-codegen](https://github.com/swagge - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-04-27T21:14:49.805-07:00 +- Build date: 2016-05-02T15:51:26.331+01:00 - Build package: class io.swagger.codegen.languages.GoClientCodegen ## Installation diff --git a/samples/client/petstore/go/go-petstore/api_client.go b/samples/client/petstore/go/go-petstore/api_client.go index 743b45a139d..100a36da7e1 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -1,123 +1,120 @@ package petstore import ( - "strings" - "github.com/go-resty/resty" - "fmt" - "reflect" - "bytes" - "path/filepath" + "bytes" + "fmt" + "path/filepath" + "reflect" + "strings" + + "github.com/go-resty/resty" ) type APIClient struct { - } func (c *APIClient) SelectHeaderContentType(contentTypes []string) string { - if (len(contentTypes) == 0){ - return "" - } - if contains(contentTypes,"application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' } func (c *APIClient) SelectHeaderAccept(accepts []string) string { - if (len(accepts) == 0){ - return "" - } - if contains(accepts,"application/json"){ - return "application/json" - } - - return strings.Join(accepts,",") + if len(accepts) == 0 { + return "" + } + if contains(accepts, "application/json") { + return "application/json" + } + return strings.Join(accepts, ",") } func contains(source []string, containvalue string) bool { - for _, a := range source { - if strings.ToLower(a) == strings.ToLower(containvalue) { - return true - } - } - return false + for _, a := range source { + if strings.ToLower(a) == strings.ToLower(containvalue) { + return true + } + } + return false } - func (c *APIClient) CallAPI(path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams map[string]string, - formParams map[string]string, - fileName string, - fileBytes []byte) (*resty.Response, error) { + postBody interface{}, + headerParams map[string]string, + queryParams map[string]string, + formParams map[string]string, + fileName string, + fileBytes []byte) (*resty.Response, error) { - //set debug flag - configuration := NewConfiguration() - resty.SetDebug(configuration.GetDebug()) + //set debug flag + configuration := NewConfiguration() + resty.SetDebug(configuration.GetDebug()) - request := prepareRequest(postBody, headerParams, queryParams, formParams,fileName,fileBytes) + request := prepareRequest(postBody, headerParams, queryParams, formParams, fileName, fileBytes) - switch strings.ToUpper(method) { - case "GET": - response, err := request.Get(path) - return response, err - case "POST": - response, err := request.Post(path) - return response, err - case "PUT": - response, err := request.Put(path) - return response, err - case "PATCH": - response, err := request.Patch(path) - return response, err - case "DELETE": - response, err := request.Delete(path) - return response, err - } + switch strings.ToUpper(method) { + case "GET": + response, err := request.Get(path) + return response, err + case "POST": + response, err := request.Post(path) + return response, err + case "PUT": + response, err := request.Put(path) + return response, err + case "PATCH": + response, err := request.Patch(path) + return response, err + case "DELETE": + response, err := request.Delete(path) + return response, err + } - return nil, fmt.Errorf("invalid method %v", method) + return nil, fmt.Errorf("invalid method %v", method) } func (c *APIClient) ParameterToString(obj interface{}) string { - if reflect.TypeOf(obj).String() == "[]string" { - return strings.Join(obj.([]string), ",") - } else { - return obj.(string) - } + if reflect.TypeOf(obj).String() == "[]string" { + return strings.Join(obj.([]string), ",") + } else { + return obj.(string) + } } func prepareRequest(postBody interface{}, - headerParams map[string]string, - queryParams map[string]string, - formParams map[string]string, - fileName string, - fileBytes []byte) *resty.Request { + headerParams map[string]string, + queryParams map[string]string, + formParams map[string]string, + fileName string, + fileBytes []byte) *resty.Request { - request := resty.R() + request := resty.R() + request.SetBody(postBody) - request.SetBody(postBody) + // add header parameter, if any + if len(headerParams) > 0 { + request.SetHeaders(headerParams) + } - // add header parameter, if any - if len(headerParams) > 0 { - request.SetHeaders(headerParams) - } - - // add query parameter, if any - if len(queryParams) > 0 { - request.SetQueryParams(queryParams) - } + // add query parameter, if any + if len(queryParams) > 0 { + request.SetQueryParams(queryParams) + } - // add form parameter, if any - if len(formParams) > 0 { - request.SetFormData(formParams) - } - - if len(fileBytes) > 0 && fileName != "" { - _, fileNm := filepath.Split(fileName) - request.SetFileReader("file", fileNm, bytes.NewReader(fileBytes)) - } - return request + // add form parameter, if any + if len(formParams) > 0 { + request.SetFormData(formParams) + } + + if len(fileBytes) > 0 && fileName != "" { + _, fileNm := filepath.Split(fileName) + request.SetFileReader("file", fileNm, bytes.NewReader(fileBytes)) + } + return request } diff --git a/samples/client/petstore/go/go-petstore/api_response.go b/samples/client/petstore/go/go-petstore/api_response.go index b670ad101a8..0404289f96b 100644 --- a/samples/client/petstore/go/go-petstore/api_response.go +++ b/samples/client/petstore/go/go-petstore/api_response.go @@ -1,24 +1,22 @@ package petstore import ( - "net/http" + "net/http" ) - type APIResponse struct { - *http.Response - - Message string `json:"message,omitempty"` + *http.Response + Message string `json:"message,omitempty"` } func NewAPIResponse(r *http.Response) *APIResponse { - response := &APIResponse{Response: r} - return response + response := &APIResponse{Response: r} + return response } func NewAPIResponseWithError(errorMessage string) *APIResponse { - response := &APIResponse{Message: errorMessage} - return response -} \ No newline at end of file + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/samples/client/petstore/go/go-petstore/category.go b/samples/client/petstore/go/go-petstore/category.go index eb715721978..197316d62ef 100644 --- a/samples/client/petstore/go/go-petstore/category.go +++ b/samples/client/petstore/go/go-petstore/category.go @@ -1,12 +1,8 @@ package petstore -import ( -) - - type Category struct { - - Id int64 `json:"id,omitempty"` - - Name string `json:"name,omitempty"` + + Id int64 `json:"id,omitempty"` + + Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 51aad379b42..5d7df91948e 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -1,59 +1,59 @@ package petstore import ( - "encoding/base64" + "encoding/base64" ) type Configuration struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` - APIKeyPrefix map[string] string `json:"APIKeyPrefix,omitempty"` - APIKey map[string] string `json:"APIKey,omitempty"` - debug bool `json:"debug,omitempty"` - DebugFile string `json:"debugFile,omitempty"` - OAuthToken string `json:"oAuthToken,omitempty"` - Timeout int `json:"timeout,omitempty"` - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - AccessToken string `json:"accessToken,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - APIClient APIClient `json:"APIClient,omitempty"` + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` + APIKeyPrefix map[string]string `json:"APIKeyPrefix,omitempty"` + APIKey map[string]string `json:"APIKey,omitempty"` + debug bool `json:"debug,omitempty"` + DebugFile string `json:"debugFile,omitempty"` + OAuthToken string `json:"oAuthToken,omitempty"` + Timeout int `json:"timeout,omitempty"` + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + AccessToken string `json:"accessToken,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + APIClient APIClient `json:"APIClient,omitempty"` } func NewConfiguration() *Configuration { - return &Configuration{ - BasePath: "http://petstore.swagger.io/v2", - UserName: "", - debug: false, - DefaultHeader: make(map[string]string), - APIKey: make(map[string]string), - APIKeyPrefix: make(map[string]string), - UserAgent: "Swagger-Codegen/1.0.0/go", - } + return &Configuration{ + BasePath: "http://petstore.swagger.io/v2", + UserName: "", + debug: false, + DefaultHeader: make(map[string]string), + APIKey: make(map[string]string), + APIKeyPrefix: make(map[string]string), + UserAgent: "Swagger-Codegen/1.0.0/go", + } } func (c *Configuration) GetBasicAuthEncodedString() string { - return base64.StdEncoding.EncodeToString([]byte(c.UserName + ":" + c.Password)) + return base64.StdEncoding.EncodeToString([]byte(c.UserName + ":" + c.Password)) } func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value + c.DefaultHeader[key] = value } func (c *Configuration) GetAPIKeyWithPrefix(APIKeyIdentifier string) string { - if c.APIKeyPrefix[APIKeyIdentifier] != ""{ - return c.APIKeyPrefix[APIKeyIdentifier] + " " + c.APIKey[APIKeyIdentifier] - } - - return c.APIKey[APIKeyIdentifier] + if c.APIKeyPrefix[APIKeyIdentifier] != "" { + return c.APIKeyPrefix[APIKeyIdentifier] + " " + c.APIKey[APIKeyIdentifier] + } + + return c.APIKey[APIKeyIdentifier] } -func (c *Configuration) SetDebug(enable bool){ - c.debug = enable +func (c *Configuration) SetDebug(enable bool) { + c.debug = enable } func (c *Configuration) GetDebug() bool { - return c.debug -} \ No newline at end of file + return c.debug +} diff --git a/samples/client/petstore/go/go-petstore/git_push.sh b/samples/client/petstore/go/go-petstore/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/go/go-petstore/git_push.sh +++ b/samples/client/petstore/go/go-petstore/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index 8183399abd9..774f781ee93 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -1,14 +1,10 @@ package petstore -import ( -) - - type ModelApiResponse struct { - - Code int32 `json:"code,omitempty"` - - Type_ string `json:"type,omitempty"` - - Message string `json:"message,omitempty"` + + Code int32 `json:"code,omitempty"` + + Type_ string `json:"type,omitempty"` + + Message string `json:"message,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/order.go b/samples/client/petstore/go/go-petstore/order.go index 29b6cffeba0..582d45a747f 100644 --- a/samples/client/petstore/go/go-petstore/order.go +++ b/samples/client/petstore/go/go-petstore/order.go @@ -1,21 +1,21 @@ package petstore import ( - "time" + "time" ) - type Order struct { - - Id int64 `json:"id,omitempty"` - - PetId int64 `json:"petId,omitempty"` - - Quantity int32 `json:"quantity,omitempty"` - - ShipDate time.Time `json:"shipDate,omitempty"` - // Order Status - Status string `json:"status,omitempty"` - - Complete bool `json:"complete,omitempty"` + + Id int64 `json:"id,omitempty"` + + PetId int64 `json:"petId,omitempty"` + + Quantity int32 `json:"quantity,omitempty"` + + ShipDate time.Time `json:"shipDate,omitempty"` + + // Order Status + Status string `json:"status,omitempty"` + + Complete bool `json:"complete,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/pet.go b/samples/client/petstore/go/go-petstore/pet.go index 99016d2d540..88e86af7399 100644 --- a/samples/client/petstore/go/go-petstore/pet.go +++ b/samples/client/petstore/go/go-petstore/pet.go @@ -1,20 +1,17 @@ package petstore -import ( -) - - type Pet struct { - - Id int64 `json:"id,omitempty"` - - Category Category `json:"category,omitempty"` - - Name string `json:"name,omitempty"` - - PhotoUrls []string `json:"photoUrls,omitempty"` - - Tags []Tag `json:"tags,omitempty"` - // pet status in the store - Status string `json:"status,omitempty"` + + Id int64 `json:"id,omitempty"` + + Category Category `json:"category,omitempty"` + + Name string `json:"name,omitempty"` + + PhotoUrls []string `json:"photoUrls,omitempty"` + + Tags []Tag `json:"tags,omitempty"` + + // pet status in the store + Status string `json:"status,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/pet_api.go index 6cc79073c4f..0e252159fd0 100644 --- a/samples/client/petstore/go/go-petstore/pet_api.go +++ b/samples/client/petstore/go/go-petstore/pet_api.go @@ -1,602 +1,567 @@ package petstore import ( - "strings" - "fmt" - "errors" - "os" - "io/ioutil" - "encoding/json" + "strings" + "fmt" + "errors" + "os" +"io/ioutil" +"encoding/json" ) type PetApi struct { - Configuration Configuration + Configuration Configuration } -func NewPetApi() *PetApi{ - configuration := NewConfiguration() - return &PetApi { - Configuration: *configuration, - } +func NewPetApi() *PetApi { + configuration := NewConfiguration() + return &PetApi{ + Configuration: *configuration, + } } -func NewPetApiWithBasePath(basePath string) *PetApi{ - configuration := NewConfiguration() - configuration.BasePath = basePath - - return &PetApi { - Configuration: *configuration, - } +func NewPetApiWithBasePath(basePath string) *PetApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &PetApi{ + Configuration: *configuration, + } } /** * Add a new pet to the store * + * * @param body Pet object that needs to be added to the store * @return void */ -func (a PetApi) AddPet (body Pet) (*APIResponse, error) { +func (a PetApi) AddPet(body Pet) (APIResponse, error) { - var httpMethod = "Post" - // create path and map variables - path := a.Configuration.BasePath + "/pet" + var httpMethod = "Post" + // create path and map variables + path := a.Configuration.BasePath + "/pet" - // verify the required parameter 'body' is set - if &body == nil { - return nil, errors.New("Missing required parameter 'body' when calling PetApi->AddPet") - } + // verify the required parameter 'body' is set + if &body == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling PetApi->AddPet") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (petstore_auth) required - // authentication (petstore_auth) required - - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + } + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", "application/xml", } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - "application/json", - "application/xml", - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - // body params - postBody = &body + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + // body params + postBody = &body - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Deletes a pet * + * * @param petId Pet id to delete * @param apiKey * @return void */ -func (a PetApi) DeletePet (petId int64, apiKey string) (*APIResponse, error) { +func (a PetApi) DeletePet(petId int64, apiKey string) (APIResponse, error) { - var httpMethod = "Delete" - // create path and map variables - path := a.Configuration.BasePath + "/pet/{petId}" - path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1) + var httpMethod = "Delete" + // create path and map variables + path := a.Configuration.BasePath + "/pet/{petId}" + path = strings.Replace(path, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) - // verify the required parameter 'petId' is set - if &petId == nil { - return nil, errors.New("Missing required parameter 'petId' when calling PetApi->DeletePet") - } + // verify the required parameter 'petId' is set + if &petId == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->DeletePet") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (petstore_auth) required - // authentication (petstore_auth) required - - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + } + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } - // header params "api_key" - headerParams["api_key"] = apiKey + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + + // header params "api_key" + headerParams["api_key"] = apiKey + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * * @param status Status values that need to be considered for filter * @return []Pet */ -func (a PetApi) FindPetsByStatus (status []string) (*[]Pet, *APIResponse, error) { +func (a PetApi) FindPetsByStatus(status []string) ([]Pet, APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/pet/findByStatus" + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/pet/findByStatus" - // verify the required parameter 'status' is set - if &status == nil { - return new([]Pet), nil, errors.New("Missing required parameter 'status' when calling PetApi->FindPetsByStatus") - } + // verify the required parameter 'status' is set + if &status == nil { + return *new([]Pet), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'status' when calling PetApi->FindPetsByStatus") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (petstore_auth) required - // authentication (petstore_auth) required - - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + } + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - - queryParams["status"] = a.Configuration.APIClient.ParameterToString(status) + queryParams["status"] = a.Configuration.APIClient.ParameterToString(status) + - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - var successPayload = new([]Pet) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new([]Pet) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * * @param tags Tags to filter by * @return []Pet */ -func (a PetApi) FindPetsByTags (tags []string) (*[]Pet, *APIResponse, error) { +func (a PetApi) FindPetsByTags(tags []string) ([]Pet, APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/pet/findByTags" + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/pet/findByTags" - // verify the required parameter 'tags' is set - if &tags == nil { - return new([]Pet), nil, errors.New("Missing required parameter 'tags' when calling PetApi->FindPetsByTags") - } + // verify the required parameter 'tags' is set + if &tags == nil { + return *new([]Pet), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'tags' when calling PetApi->FindPetsByTags") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (petstore_auth) required - // authentication (petstore_auth) required - - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + } + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - - queryParams["tags"] = a.Configuration.APIClient.ParameterToString(tags) + queryParams["tags"] = a.Configuration.APIClient.ParameterToString(tags) + - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - var successPayload = new([]Pet) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new([]Pet) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + /** * Find pet by ID * Returns a single pet + * * @param petId ID of pet to return * @return Pet */ -func (a PetApi) GetPetById (petId int64) (*Pet, *APIResponse, error) { +func (a PetApi) GetPetById(petId int64) (Pet, APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/pet/{petId}" - path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1) + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/pet/{petId}" + path = strings.Replace(path, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) - // verify the required parameter 'petId' is set - if &petId == nil { - return new(Pet), nil, errors.New("Missing required parameter 'petId' when calling PetApi->GetPetById") - } + // verify the required parameter 'petId' is set + if &petId == nil { + return *new(Pet), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->GetPetById") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (api_key) required - // authentication (api_key) required - - // set key with prefix in header - headerParams["api_key"] = a.Configuration.GetAPIKeyWithPrefix("api_key") - + // set key with prefix in header + headerParams["api_key"] = a.Configuration.GetAPIKeyWithPrefix("api_key") - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - var successPayload = new(Pet) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(Pet) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + /** * Update an existing pet * + * * @param body Pet object that needs to be added to the store * @return void */ -func (a PetApi) UpdatePet (body Pet) (*APIResponse, error) { +func (a PetApi) UpdatePet(body Pet) (APIResponse, error) { - var httpMethod = "Put" - // create path and map variables - path := a.Configuration.BasePath + "/pet" + var httpMethod = "Put" + // create path and map variables + path := a.Configuration.BasePath + "/pet" - // verify the required parameter 'body' is set - if &body == nil { - return nil, errors.New("Missing required parameter 'body' when calling PetApi->UpdatePet") - } + // verify the required parameter 'body' is set + if &body == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling PetApi->UpdatePet") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (petstore_auth) required - // authentication (petstore_auth) required - - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + } + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", "application/xml", } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - "application/json", - "application/xml", - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - // body params - postBody = &body + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + // body params + postBody = &body - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * 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 * @return void */ -func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (*APIResponse, error) { +func (a PetApi) UpdatePetWithForm(petId int64, name string, status string) (APIResponse, error) { - var httpMethod = "Post" - // create path and map variables - path := a.Configuration.BasePath + "/pet/{petId}" - path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1) + var httpMethod = "Post" + // create path and map variables + path := a.Configuration.BasePath + "/pet/{petId}" + path = strings.Replace(path, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) - // verify the required parameter 'petId' is set - if &petId == nil { - return nil, errors.New("Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm") - } + // verify the required parameter 'petId' is set + if &petId == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (petstore_auth) required - // authentication (petstore_auth) required - - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + } + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - "application/x-www-form-urlencoded", - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - formParams["name"] = name - formParams["status"] = status + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + formParams["name"] = name + formParams["status"] = status - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * uploads an image * + * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload * @return ModelApiResponse */ -func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.File) (*ModelApiResponse, *APIResponse, error) { +func (a PetApi) UploadFile(petId int64, additionalMetadata string, file *os.File) (ModelApiResponse, APIResponse, error) { - var httpMethod = "Post" - // create path and map variables - path := a.Configuration.BasePath + "/pet/{petId}/uploadImage" - path = strings.Replace(path, "{" + "petId" + "}", fmt.Sprintf("%v", petId), -1) + var httpMethod = "Post" + // create path and map variables + path := a.Configuration.BasePath + "/pet/{petId}/uploadImage" + path = strings.Replace(path, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) - // verify the required parameter 'petId' is set - if &petId == nil { - return new(ModelApiResponse), nil, errors.New("Missing required parameter 'petId' when calling PetApi->UploadFile") - } + // verify the required parameter 'petId' is set + if &petId == nil { + return *new(ModelApiResponse), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'petId' when calling PetApi->UploadFile") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (petstore_auth) required - // authentication (petstore_auth) required - - // oauth required - if a.Configuration.AccessToken != ""{ - headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken - } + // oauth required + if a.Configuration.AccessToken != ""{ + headerParams["Authorization"] = "Bearer " + a.Configuration.AccessToken + } + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "multipart/form-data", } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - "multipart/form-data", - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } - formParams["additionalMetadata"] = additionalMetadata - fbs, _ := ioutil.ReadAll(file) - fileBytes = fbs - fileName = file.Name() + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } - var successPayload = new(ModelApiResponse) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + formParams["additionalMetadata"] = additionalMetadata + fbs, _ := ioutil.ReadAll(file) + fileBytes = fbs + fileName = file.Name() - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + var successPayload = new(ModelApiResponse) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index 66f95d04f39..d2848305114 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -1,282 +1,264 @@ package petstore import ( - "strings" - "fmt" - "errors" - "encoding/json" + "strings" + "fmt" + "errors" + "encoding/json" ) type StoreApi struct { - Configuration Configuration + Configuration Configuration } -func NewStoreApi() *StoreApi{ - configuration := NewConfiguration() - return &StoreApi { - Configuration: *configuration, - } +func NewStoreApi() *StoreApi { + configuration := NewConfiguration() + return &StoreApi{ + Configuration: *configuration, + } } -func NewStoreApiWithBasePath(basePath string) *StoreApi{ - configuration := NewConfiguration() - configuration.BasePath = basePath - - return &StoreApi { - Configuration: *configuration, - } +func NewStoreApiWithBasePath(basePath string) *StoreApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &StoreApi{ + Configuration: *configuration, + } } /** * 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 * @return void */ -func (a StoreApi) DeleteOrder (orderId string) (*APIResponse, error) { +func (a StoreApi) DeleteOrder(orderId string) (APIResponse, error) { - var httpMethod = "Delete" - // create path and map variables - path := a.Configuration.BasePath + "/store/order/{orderId}" - path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1) + var httpMethod = "Delete" + // create path and map variables + path := a.Configuration.BasePath + "/store/order/{orderId}" + path = strings.Replace(path, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) - // verify the required parameter 'orderId' is set - if &orderId == nil { - return nil, errors.New("Missing required parameter 'orderId' when calling StoreApi->DeleteOrder") - } + // verify the required parameter 'orderId' is set + if &orderId == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'orderId' when calling StoreApi->DeleteOrder") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * * @return map[string]int32 */ -func (a StoreApi) GetInventory () (*map[string]int32, *APIResponse, error) { +func (a StoreApi) GetInventory() (map[string]int32, APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/store/inventory" + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/store/inventory" - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte + // authentication (api_key) required - // authentication (api_key) required - - // set key with prefix in header - headerParams["api_key"] = a.Configuration.GetAPIKeyWithPrefix("api_key") - + // set key with prefix in header + headerParams["api_key"] = a.Configuration.GetAPIKeyWithPrefix("api_key") - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } - var successPayload = new(map[string]int32) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(map[string]int32) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + /** * 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 * @return Order */ -func (a StoreApi) GetOrderById (orderId int64) (*Order, *APIResponse, error) { +func (a StoreApi) GetOrderById(orderId int64) (Order, APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/store/order/{orderId}" - path = strings.Replace(path, "{" + "orderId" + "}", fmt.Sprintf("%v", orderId), -1) + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/store/order/{orderId}" + path = strings.Replace(path, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) - // verify the required parameter 'orderId' is set - if &orderId == nil { - return new(Order), nil, errors.New("Missing required parameter 'orderId' when calling StoreApi->GetOrderById") - } + // verify the required parameter 'orderId' is set + if &orderId == nil { + return *new(Order), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'orderId' when calling StoreApi->GetOrderById") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - var successPayload = new(Order) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(Order) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + /** * Place an order for a pet * + * * @param body order placed for purchasing the pet * @return Order */ -func (a StoreApi) PlaceOrder (body Order) (*Order, *APIResponse, error) { +func (a StoreApi) PlaceOrder(body Order) (Order, APIResponse, error) { - var httpMethod = "Post" - // create path and map variables - path := a.Configuration.BasePath + "/store/order" + var httpMethod = "Post" + // create path and map variables + path := a.Configuration.BasePath + "/store/order" - // verify the required parameter 'body' is set - if &body == nil { - return new(Order), nil, errors.New("Missing required parameter 'body' when calling StoreApi->PlaceOrder") - } + // verify the required parameter 'body' is set + if &body == nil { + return *new(Order), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling StoreApi->PlaceOrder") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } - // body params - postBody = &body + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - var successPayload = new(Order) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + // body params + postBody = &body - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + var successPayload = new(Order) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + diff --git a/samples/client/petstore/go/go-petstore/tag.go b/samples/client/petstore/go/go-petstore/tag.go index 71bb9d198a4..ae901c30ec4 100644 --- a/samples/client/petstore/go/go-petstore/tag.go +++ b/samples/client/petstore/go/go-petstore/tag.go @@ -1,12 +1,8 @@ package petstore -import ( -) - - type Tag struct { - - Id int64 `json:"id,omitempty"` - - Name string `json:"name,omitempty"` + + Id int64 `json:"id,omitempty"` + + Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/user.go b/samples/client/petstore/go/go-petstore/user.go index 91a42e57a0e..140a94a275b 100644 --- a/samples/client/petstore/go/go-petstore/user.go +++ b/samples/client/petstore/go/go-petstore/user.go @@ -1,24 +1,21 @@ package petstore -import ( -) - - type User struct { - - Id int64 `json:"id,omitempty"` - - Username string `json:"username,omitempty"` - - FirstName string `json:"firstName,omitempty"` - - LastName string `json:"lastName,omitempty"` - - Email string `json:"email,omitempty"` - - Password string `json:"password,omitempty"` - - Phone string `json:"phone,omitempty"` - // User Status - UserStatus int32 `json:"userStatus,omitempty"` + + Id int64 `json:"id,omitempty"` + + Username string `json:"username,omitempty"` + + FirstName string `json:"firstName,omitempty"` + + LastName string `json:"lastName,omitempty"` + + Email string `json:"email,omitempty"` + + Password string `json:"password,omitempty"` + + Phone string `json:"phone,omitempty"` + + // User Status + UserStatus int32 `json:"userStatus,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/user_api.go index 3c4c530c191..ce23df39d69 100644 --- a/samples/client/petstore/go/go-petstore/user_api.go +++ b/samples/client/petstore/go/go-petstore/user_api.go @@ -1,539 +1,519 @@ package petstore import ( - "strings" - "fmt" - "errors" - "encoding/json" + "strings" + "fmt" + "errors" + "encoding/json" ) type UserApi struct { - Configuration Configuration + Configuration Configuration } -func NewUserApi() *UserApi{ - configuration := NewConfiguration() - return &UserApi { - Configuration: *configuration, - } +func NewUserApi() *UserApi { + configuration := NewConfiguration() + return &UserApi{ + Configuration: *configuration, + } } -func NewUserApiWithBasePath(basePath string) *UserApi{ - configuration := NewConfiguration() - configuration.BasePath = basePath - - return &UserApi { - Configuration: *configuration, - } +func NewUserApiWithBasePath(basePath string) *UserApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &UserApi{ + Configuration: *configuration, + } } /** * Create user * This can only be done by the logged in user. + * * @param body Created user object * @return void */ -func (a UserApi) CreateUser (body User) (*APIResponse, error) { +func (a UserApi) CreateUser(body User) (APIResponse, error) { - var httpMethod = "Post" - // create path and map variables - path := a.Configuration.BasePath + "/user" + var httpMethod = "Post" + // create path and map variables + path := a.Configuration.BasePath + "/user" - // verify the required parameter 'body' is set - if &body == nil { - return nil, errors.New("Missing required parameter 'body' when calling UserApi->CreateUser") - } + // verify the required parameter 'body' is set + if &body == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->CreateUser") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } - // body params - postBody = &body + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + // body params + postBody = &body - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Creates list of users with given input array * + * * @param body List of user object * @return void */ -func (a UserApi) CreateUsersWithArrayInput (body []User) (*APIResponse, error) { +func (a UserApi) CreateUsersWithArrayInput(body []User) (APIResponse, error) { - var httpMethod = "Post" - // create path and map variables - path := a.Configuration.BasePath + "/user/createWithArray" + var httpMethod = "Post" + // create path and map variables + path := a.Configuration.BasePath + "/user/createWithArray" - // verify the required parameter 'body' is set - if &body == nil { - return nil, errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput") - } + // verify the required parameter 'body' is set + if &body == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } - // body params - postBody = &body + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + // body params + postBody = &body - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Creates list of users with given input array * + * * @param body List of user object * @return void */ -func (a UserApi) CreateUsersWithListInput (body []User) (*APIResponse, error) { +func (a UserApi) CreateUsersWithListInput(body []User) (APIResponse, error) { - var httpMethod = "Post" - // create path and map variables - path := a.Configuration.BasePath + "/user/createWithList" + var httpMethod = "Post" + // create path and map variables + path := a.Configuration.BasePath + "/user/createWithList" - // verify the required parameter 'body' is set - if &body == nil { - return nil, errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput") - } + // verify the required parameter 'body' is set + if &body == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } - // body params - postBody = &body + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + // body params + postBody = &body - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Delete user * This can only be done by the logged in user. + * * @param username The name that needs to be deleted * @return void */ -func (a UserApi) DeleteUser (username string) (*APIResponse, error) { +func (a UserApi) DeleteUser(username string) (APIResponse, error) { - var httpMethod = "Delete" - // create path and map variables - path := a.Configuration.BasePath + "/user/{username}" - path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1) + var httpMethod = "Delete" + // create path and map variables + path := a.Configuration.BasePath + "/user/{username}" + path = strings.Replace(path, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) - // verify the required parameter 'username' is set - if &username == nil { - return nil, errors.New("Missing required parameter 'username' when calling UserApi->DeleteUser") - } + // verify the required parameter 'username' is set + if &username == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->DeleteUser") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Get user by user name * + * * @param username The name that needs to be fetched. Use user1 for testing. * @return User */ -func (a UserApi) GetUserByName (username string) (*User, *APIResponse, error) { +func (a UserApi) GetUserByName(username string) (User, APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/user/{username}" - path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1) + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/user/{username}" + path = strings.Replace(path, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) - // verify the required parameter 'username' is set - if &username == nil { - return new(User), nil, errors.New("Missing required parameter 'username' when calling UserApi->GetUserByName") - } + // verify the required parameter 'username' is set + if &username == nil { + return *new(User), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->GetUserByName") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - var successPayload = new(User) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) - - - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(User) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + /** * Logs user into the system * + * * @param username The user name for login * @param password The password for login in clear text * @return string */ -func (a UserApi) LoginUser (username string, password string) (*string, *APIResponse, error) { +func (a UserApi) LoginUser(username string, password string) (string, APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/user/login" + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/user/login" - // verify the required parameter 'username' is set - if &username == nil { - return new(string), nil, errors.New("Missing required parameter 'username' when calling UserApi->LoginUser") - } - // verify the required parameter 'password' is set - if &password == nil { - return new(string), nil, errors.New("Missing required parameter 'password' when calling UserApi->LoginUser") - } + // verify the required parameter 'username' is set + if &username == nil { + return *new(string), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->LoginUser") + } + // verify the required parameter 'password' is set + if &password == nil { + return *new(string), *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'password' when calling UserApi->LoginUser") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - - queryParams["username"] = a.Configuration.APIClient.ParameterToString(username) - queryParams["password"] = a.Configuration.APIClient.ParameterToString(password) + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + queryParams["username"] = a.Configuration.APIClient.ParameterToString(username) + + queryParams["password"] = a.Configuration.APIClient.ParameterToString(password) + - var successPayload = new(string) - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } - if err != nil { - return successPayload, NewAPIResponse(httpResponse.RawResponse), err - } - - err = json.Unmarshal(httpResponse.Body(), &successPayload) - - return successPayload, NewAPIResponse(httpResponse.RawResponse), err + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(string) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err + } + err = json.Unmarshal(httpResponse.Body(), &successPayload) + return *successPayload, *NewAPIResponse(httpResponse.RawResponse), err } + /** * Logs out current logged in user session * + * * @return void */ -func (a UserApi) LogoutUser () (*APIResponse, error) { +func (a UserApi) LogoutUser() (APIResponse, error) { - var httpMethod = "Get" - // create path and map variables - path := a.Configuration.BasePath + "/user/logout" + var httpMethod = "Get" + // create path and map variables + path := a.Configuration.BasePath + "/user/logout" - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + /** * Updated user * This can only be done by the logged in user. + * * @param username name that need to be deleted * @param body Updated user object * @return void */ -func (a UserApi) UpdateUser (username string, body User) (*APIResponse, error) { +func (a UserApi) UpdateUser(username string, body User) (APIResponse, error) { - var httpMethod = "Put" - // create path and map variables - path := a.Configuration.BasePath + "/user/{username}" - path = strings.Replace(path, "{" + "username" + "}", fmt.Sprintf("%v", username), -1) + var httpMethod = "Put" + // create path and map variables + path := a.Configuration.BasePath + "/user/{username}" + path = strings.Replace(path, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) - // verify the required parameter 'username' is set - if &username == nil { - return nil, errors.New("Missing required parameter 'username' when calling UserApi->UpdateUser") - } - // verify the required parameter 'body' is set - if &body == nil { - return nil, errors.New("Missing required parameter 'body' when calling UserApi->UpdateUser") - } + // verify the required parameter 'username' is set + if &username == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'username' when calling UserApi->UpdateUser") + } + // verify the required parameter 'body' is set + if &body == nil { + return *NewAPIResponseWithError("400 - Bad Request"), errors.New("Missing required parameter 'body' when calling UserApi->UpdateUser") + } - headerParams := make(map[string]string) - queryParams := make(map[string]string) - formParams := make(map[string]string) - var postBody interface{} - var fileName string - var fileBytes []byte + headerParams := make(map[string]string) + queryParams := make(map[string]string) + formParams := make(map[string]string) + var postBody interface{} + var fileName string + var fileBytes []byte - - // add default headers if any - for key := range a.Configuration.DefaultHeader { - headerParams[key] = a.Configuration.DefaultHeader[key] - } - + // add default headers if any + for key := range a.Configuration.DefaultHeader { + headerParams[key] = a.Configuration.DefaultHeader[key] + } - // to determine the Content-Type header - localVarHttpContentTypes := []string { - } - //set Content-Type header - localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - headerParams["Content-Type"] = localVarHttpContentType - } - // to determine the Accept header - localVarHttpHeaderAccepts := []string { - "application/xml", - "application/json", - } - //set Accept header - localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - headerParams["Accept"] = localVarHttpHeaderAccept - } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } - // body params - postBody = &body + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + headerParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/xml", +"application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + headerParams["Accept"] = localVarHttpHeaderAccept + } + // body params + postBody = &body - httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + httpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + if err != nil { + return *NewAPIResponse(httpResponse.RawResponse), err + } - - if err != nil { - return NewAPIResponse(httpResponse.RawResponse), err - } - - return NewAPIResponse(httpResponse.RawResponse), err + return *NewAPIResponse(httpResponse.RawResponse), err } + diff --git a/samples/client/petstore/go/user_api_test.go b/samples/client/petstore/go/user_api_test.go new file mode 100644 index 00000000000..8ea2c29042a --- /dev/null +++ b/samples/client/petstore/go/user_api_test.go @@ -0,0 +1,162 @@ +package main + +import ( + sw "./go-petstore" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestCreateUser(t *testing.T) { + s := sw.NewUserApi() + newUser := sw.User{ + Id: 1000, + FirstName: "gopher", + LastName : "lang", + Username : "gopher", + Password : "lang", + Email : "lang@test.com", + Phone : "5101112222", + UserStatus: 1} + + apiResponse, err := s.CreateUser(newUser) + + if err != nil { + t.Errorf("Error while adding user") + t.Log(err) + } + if apiResponse.Response.StatusCode != 200 { + t.Log(apiResponse.Response) + } +} + +//adding x to skip the test, currently it is failing +func TestCreateUsersWithArrayInput(t *testing.T) { + s := sw.NewUserApi() + newUsers := []sw.User{ + sw.User { + Id: int64(1001), + FirstName: "gopher1", + LastName : "lang1", + Username : "gopher1", + Password : "lang1", + Email : "lang1@test.com", + Phone : "5101112222", + UserStatus: int32(1), + }, + sw.User { + Id: int64(1002), + FirstName: "gopher2", + LastName : "lang2", + Username : "gopher2", + Password : "lang2", + Email : "lang2@test.com", + Phone : "5101112222", + UserStatus: int32(1), + }, + } + + apiResponse, err := s.CreateUsersWithArrayInput(newUsers) + + if err != nil { + t.Errorf("Error while adding users") + t.Log(err) + } + if apiResponse.Response.StatusCode != 200 { + t.Log(apiResponse.Response) + } + + //tear down + _, err1 := s.DeleteUser("gopher1") + if(err1 != nil){ + t.Errorf("Error while deleting user") + t.Log(err1) + } + + _, err2 := s.DeleteUser("gopher2") + if(err2 != nil){ + t.Errorf("Error while deleting user") + t.Log(err2) + } +} + +func TestGetUserByName(t *testing.T) { + assert := assert.New(t) + + s := sw.NewUserApi() + resp, apiResponse, err := s.GetUserByName("gopher") + if err != nil { + t.Errorf("Error while getting user by id") + t.Log(err) + } else { + assert.Equal(resp.Id, int64(1000), "User id should be equal") + assert.Equal(resp.Username, "gopher", "User name should be gopher") + assert.Equal(resp.LastName, "lang", "Last name should be lang") + //t.Log(resp) + } + if apiResponse.Response.StatusCode != 200 { + t.Log(apiResponse.Response) + } +} + +func TestGetUserByNameWithInvalidID(t *testing.T) { + s := sw.NewUserApi() + resp, apiResponse, err := s.GetUserByName("999999999") + if err != nil { + t.Errorf("Error while getting user by invalid id") + t.Log(err) + t.Log(apiResponse) + } else { + t.Log(resp) + } + if apiResponse.Response.StatusCode != 200 { + t.Log(apiResponse.Response) + } +} + +func TestUpdateUser(t *testing.T) { + assert := assert.New(t) + s := sw.NewUserApi() + newUser := sw.User{ + Id: 1000, + FirstName: "gopher20", + LastName : "lang20", + Username : "gopher", + Password : "lang", + Email : "lang@test.com", + Phone : "5101112222", + UserStatus: 1} + + apiResponse, err := s.UpdateUser("gopher", newUser) + + if err != nil { + t.Errorf("Error while deleting user by id") + t.Log(err) + } + if apiResponse.Response.StatusCode != 200 { + t.Log(apiResponse.Response) + } + + //verify changings are correct + resp, apiResponse, err := s.GetUserByName("gopher") + if err != nil { + t.Errorf("Error while getting user by id") + t.Log(err) + } else { + assert.Equal(resp.Id, int64(1000), "User id should be equal") + assert.Equal(resp.FirstName, "gopher20", "User name should be gopher") + assert.Equal(resp.Password, "lang", "User name should be the same") + } +} + +func TestDeleteUser(t *testing.T) { + s := sw.NewUserApi() + apiResponse, err := s.DeleteUser("gopher") + + if err != nil { + t.Errorf("Error while deleting user") + t.Log(err) + } + if apiResponse.Response.StatusCode != 200 { + t.Log(apiResponse.Response) + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/default/docs/EnumClass.md b/samples/client/petstore/java/default/docs/EnumClass.md new file mode 100644 index 00000000000..de0bc8a95ac --- /dev/null +++ b/samples/client/petstore/java/default/docs/EnumClass.md @@ -0,0 +1,8 @@ + +# EnumClass + +## Enum + +* `{values=[_abc, -efg, (xyz)], enumVars=[{name=_ABC, value="_abc"}, {name=_EFG, value="-efg"}, {name=_XYZ_, value="(xyz)"}]}` + + diff --git a/samples/client/petstore/java/default/docs/EnumTest.md b/samples/client/petstore/java/default/docs/EnumTest.md new file mode 100644 index 00000000000..deb1951c552 --- /dev/null +++ b/samples/client/petstore/java/default/docs/EnumTest.md @@ -0,0 +1,36 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] + + + +## Enum: EnumStringEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + +## Enum: EnumIntegerEnum +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumNumberEnum +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/client/petstore/java/default/docs/FakeApi.md b/samples/client/petstore/java/default/docs/FakeApi.md new file mode 100644 index 00000000000..f642566c8e7 --- /dev/null +++ b/samples/client/petstore/java/default/docs/FakeApi.md @@ -0,0 +1,75 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters + + + +# **testEndpointParameters** +> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) + +Fake endpoint for testing various parameters + +Fake endpoint for testing various parameters + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String number = "number_example"; // String | None +Double _double = 3.4D; // Double | None +String string = "string_example"; // String | None +byte[] _byte = B; // byte[] | None +Integer integer = 56; // Integer | None +Integer int32 = 56; // Integer | None +Long int64 = 789L; // Long | None +Float _float = 3.4F; // Float | None +byte[] binary = B; // byte[] | None +Date date = new Date(); // Date | None +Date dateTime = new Date(); // Date | None +String password = "password_example"; // String | None +try { + apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **String**| None | + **_double** | **Double**| None | + **string** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **Date**| None | [optional] + **dateTime** | **Date**| None | [optional] + **password** | **String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/java/default/docs/FormatTest.md b/samples/client/petstore/java/default/docs/FormatTest.md index 8e400e7bcd7..5e54362e535 100644 --- a/samples/client/petstore/java/default/docs/FormatTest.md +++ b/samples/client/petstore/java/default/docs/FormatTest.md @@ -11,11 +11,11 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | [optional] +**_byte** | **byte[]** | | **binary** | **byte[]** | | [optional] -**date** | [**Date**](Date.md) | | [optional] +**date** | [**Date**](Date.md) | | **dateTime** | [**Date**](Date.md) | | [optional] -**password** | **String** | | [optional] +**password** | **String** | | diff --git a/samples/client/petstore/java/default/docs/Order.md b/samples/client/petstore/java/default/docs/Order.md index b1709c14eee..29ca3ddbc6b 100644 --- a/samples/client/petstore/java/default/docs/Order.md +++ b/samples/client/petstore/java/default/docs/Order.md @@ -16,9 +16,9 @@ Name | Type | Description | Notes ## Enum: StatusEnum Name | Value ---- | ----- -PLACED | placed -APPROVED | approved -DELIVERED | delivered +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/default/docs/Pet.md b/samples/client/petstore/java/default/docs/Pet.md index 20a1c298dd6..5b63109ef92 100644 --- a/samples/client/petstore/java/default/docs/Pet.md +++ b/samples/client/petstore/java/default/docs/Pet.md @@ -16,9 +16,9 @@ Name | Type | Description | Notes ## Enum: StatusEnum Name | Value ---- | ----- -AVAILABLE | available -PENDING | pending -SOLD | sold +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" diff --git a/samples/client/petstore/java/default/git_push.sh b/samples/client/petstore/java/default/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/java/default/git_push.sh +++ b/samples/client/petstore/java/default/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/api/FakeApi.java new file mode 100644 index 00000000000..ddfaff67d0f --- /dev/null +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/api/FakeApi.java @@ -0,0 +1,127 @@ +package io.swagger.client.api; + +import com.sun.jersey.api.client.GenericType; + +import io.swagger.client.ApiException; +import io.swagger.client.ApiClient; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; + +import java.util.Date; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class FakeApi { + private ApiClient apiClient; + + public FakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public FakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Fake endpoint for testing various parameters + * Fake endpoint for testing various parameters + * @param number None (required) + * @param _double None (required) + * @param string None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @throws ApiException if fails to make API call + */ + public void testEndpointParameters(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'number' is set + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); + } + + // verify the required parameter '_double' is set + if (_double == null) { + throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); + } + + // verify the required parameter 'string' is set + if (string == null) { + throw new ApiException(400, "Missing the required parameter 'string' when calling testEndpointParameters"); + } + + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + } + + // create path and map variables + String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + if (integer != null) + localVarFormParams.put("integer", integer); +if (int32 != null) + localVarFormParams.put("int32", int32); +if (int64 != null) + localVarFormParams.put("int64", int64); +if (number != null) + localVarFormParams.put("number", number); +if (_float != null) + localVarFormParams.put("float", _float); +if (_double != null) + localVarFormParams.put("double", _double); +if (string != null) + localVarFormParams.put("string", string); +if (_byte != null) + localVarFormParams.put("byte", _byte); +if (binary != null) + localVarFormParams.put("binary", binary); +if (date != null) + localVarFormParams.put("date", date); +if (dateTime != null) + localVarFormParams.put("dateTime", dateTime); +if (password != null) + localVarFormParams.put("password", password); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } +} diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java index e1e3604ad6b..559e19848f9 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Animal.java @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - +/** + * Animal + */ public class Animal { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Cat.java index 6b4875cda38..305b4806f4a 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Cat.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - - - +/** + * Cat + */ public class Cat extends Animal { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Category.java index 08a0de3e889..b97a241ff8c 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Category.java @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - +/** + * Category + */ public class Category { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Dog.java index 5aa51687996..f72a7f046ab 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Dog.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - - - +/** + * Dog + */ public class Dog extends Animal { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/EnumClass.java new file mode 100644 index 00000000000..716bfbbc85e --- /dev/null +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/EnumClass.java @@ -0,0 +1,27 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; + + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + _ABC("_abc"), + _EFG("-efg"), + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } +} + diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/EnumTest.java new file mode 100644 index 00000000000..806628ebd56 --- /dev/null +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/EnumTest.java @@ -0,0 +1,177 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +/** + * EnumTest + */ + +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + LOWER("lower"); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumStringEnum enumString = null; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumIntegerEnum enumInteger = null; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumNumberEnum enumNumber = null; + + + /** + **/ + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_string") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + + /** + **/ + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_integer") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + + /** + **/ + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_number") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/FormatTest.java index e578af2af43..f10a0749f5e 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/FormatTest.java @@ -8,9 +8,9 @@ import java.math.BigDecimal; import java.util.Date; - - - +/** + * FormatTest + */ public class FormatTest { @@ -25,10 +25,13 @@ public class FormatTest { private byte[] binary = null; private Date date = null; private Date dateTime = null; + private String uuid = null; private String password = null; /** + * minimum: 10.0 + * maximum: 100.0 **/ public FormatTest integer(Integer integer) { this.integer = integer; @@ -46,6 +49,8 @@ public class FormatTest { /** + * minimum: 20.0 + * maximum: 200.0 **/ public FormatTest int32(Integer int32) { this.int32 = int32; @@ -80,6 +85,8 @@ public class FormatTest { /** + * minimum: 32.1 + * maximum: 543.2 **/ public FormatTest number(BigDecimal number) { this.number = number; @@ -97,6 +104,8 @@ public class FormatTest { /** + * minimum: 54.3 + * maximum: 987.6 **/ public FormatTest _float(Float _float) { this._float = _float; @@ -114,6 +123,8 @@ public class FormatTest { /** + * minimum: 67.8 + * maximum: 123.4 **/ public FormatTest _double(Double _double) { this._double = _double; @@ -154,7 +165,7 @@ public class FormatTest { return this; } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("byte") public byte[] getByte() { return _byte; @@ -188,7 +199,7 @@ public class FormatTest { return this; } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("date") public Date getDate() { return date; @@ -215,6 +226,23 @@ public class FormatTest { } + /** + **/ + public FormatTest uuid(String uuid) { + this.uuid = uuid; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("uuid") + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** **/ public FormatTest password(String password) { @@ -222,7 +250,7 @@ public class FormatTest { return this; } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("password") public String getPassword() { return password; @@ -252,12 +280,13 @@ public class FormatTest { Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && Objects.equals(this.password, formatTest.password); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } @Override @@ -276,6 +305,7 @@ public class FormatTest { sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Model200Response.java index 4f44da64072..e62ec1f3281 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Model200Response.java @@ -6,11 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name starting with number - **/ - + */ @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelApiResponse.java index 62300f1a0eb..719f9b676fd 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - +/** + * ModelApiResponse + */ public class ModelApiResponse { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelReturn.java index 0f4279af8d3..fa6b2b8b90c 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/ModelReturn.java @@ -6,11 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing reserved words - **/ - + */ @ApiModel(description = "Model for testing reserved words") public class ModelReturn { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Name.java index e93e3c3ee72..b9953ebac0a 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Name.java @@ -6,11 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name same as property name - **/ - + */ @ApiModel(description = "Model for testing model name same as property name") public class Name { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Order.java index 94be5295f5d..00372f26f93 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Order.java @@ -8,9 +8,9 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; - - - +/** + * Order + */ public class Order { @@ -19,7 +19,9 @@ public class Order { private Integer quantity = null; private Date shipDate = null; - + /** + * Order Status + */ public enum StatusEnum { PLACED("placed"), APPROVED("approved"), @@ -34,7 +36,7 @@ public class Order { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Pet.java index 7a4eca82fe0..a3e34c8570f 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Pet.java @@ -11,9 +11,9 @@ import java.util.ArrayList; import java.util.List; - - - +/** + * Pet + */ public class Pet { @@ -23,7 +23,9 @@ public class Pet { private List photoUrls = new ArrayList(); private List tags = new ArrayList(); - + /** + * pet status in the store + */ public enum StatusEnum { AVAILABLE("available"), PENDING("pending"), @@ -38,7 +40,7 @@ public class Pet { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/SpecialModelName.java index f1a153e79a0..1a38a0edea9 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - +/** + * SpecialModelName + */ public class SpecialModelName { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Tag.java index 86cb5f48b09..f76224dd489 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Tag.java @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - +/** + * Tag + */ public class Tag { diff --git a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/User.java index f960f1461dd..017a72b2ee5 100644 --- a/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/default/src/main/java/io/swagger/client/model/User.java @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - +/** + * User + */ public class User { diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java index 5d534251519..4d348dcd9cb 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java @@ -14,7 +14,7 @@ import feign.codec.EncodeException; import feign.codec.Encoder; import feign.RequestTemplate; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class FormAwareEncoder implements Encoder { public static final String UTF_8 = "utf-8"; private static final String LINE_FEED = "\r\n"; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java index 0a07276e65b..3d1b4a72710 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java new file mode 100644 index 00000000000..b92a064d3e5 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java @@ -0,0 +1,40 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; + +import java.util.Date; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import feign.*; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") +public interface FakeApi extends ApiClient.Api { + + + /** + * Fake endpoint for testing various parameters + * Fake endpoint for testing various parameters + * @param number None (required) + * @param _double None (required) + * @param string None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @return void + */ + @RequestLine("POST /fake") + @Headers({ + "Content-type: application/x-www-form-urlencoded", + "Accepts: application/json", + }) + void testEndpointParameters(@Param("number") String number, @Param("_double") Double _double, @Param("string") String string, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("binary") byte[] binary, @Param("date") Date date, @Param("dateTime") Date dateTime, @Param("password") String password); +} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index e1a0e57b005..e44f445d291 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Map; import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public interface PetApi extends ApiClient.Api { diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index 6b124765369..04993aa879a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -10,7 +10,7 @@ import java.util.List; import java.util.Map; import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public interface StoreApi extends ApiClient.Api { diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index 281cf2df46a..13171d4bed4 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -10,7 +10,7 @@ import java.util.List; import java.util.Map; import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public interface UserApi extends ApiClient.Api { diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java index 6b79f42855b..d6249c18d7e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * Animal + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Animal { private String className = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index 09e48e27ad5..278889e60d4 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -7,10 +7,10 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * Cat + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Cat extends Animal { private String className = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java index 6d4ffb945a0..f1df969c29c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * Category + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Category { private Long id = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java index 5ff3690685f..1a6374d54bf 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java @@ -7,10 +7,10 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * Dog + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Dog extends Animal { private String className = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java new file mode 100644 index 00000000000..716bfbbc85e --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java @@ -0,0 +1,27 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; + + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + _ABC("_abc"), + _EFG("-efg"), + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java new file mode 100644 index 00000000000..9148bd3d5d5 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java @@ -0,0 +1,177 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +/** + * EnumTest + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + LOWER("lower"); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumStringEnum enumString = null; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumIntegerEnum enumInteger = null; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumNumberEnum enumNumber = null; + + + /** + **/ + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_string") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + + /** + **/ + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_integer") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + + /** + **/ + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_number") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java index ae470044a23..53aa13638a7 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java @@ -8,10 +8,10 @@ import java.math.BigDecimal; import java.util.Date; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * FormatTest + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class FormatTest { private Integer integer = null; @@ -29,6 +29,8 @@ public class FormatTest { /** + * minimum: 10.0 + * maximum: 100.0 **/ public FormatTest integer(Integer integer) { this.integer = integer; @@ -46,6 +48,8 @@ public class FormatTest { /** + * minimum: 20.0 + * maximum: 200.0 **/ public FormatTest int32(Integer int32) { this.int32 = int32; @@ -80,6 +84,8 @@ public class FormatTest { /** + * minimum: 32.1 + * maximum: 543.2 **/ public FormatTest number(BigDecimal number) { this.number = number; @@ -97,6 +103,8 @@ public class FormatTest { /** + * minimum: 54.3 + * maximum: 987.6 **/ public FormatTest _float(Float _float) { this._float = _float; @@ -114,6 +122,8 @@ public class FormatTest { /** + * minimum: 67.8 + * maximum: 123.4 **/ public FormatTest _double(Double _double) { this._double = _double; @@ -154,7 +164,7 @@ public class FormatTest { return this; } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("byte") public byte[] getByte() { return _byte; @@ -188,7 +198,7 @@ public class FormatTest { return this; } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("date") public Date getDate() { return date; @@ -222,7 +232,7 @@ public class FormatTest { return this; } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("password") public String getPassword() { return password; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java index 721faf5189e..9a9a655bc6f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/InlineResponse200.java @@ -10,17 +10,21 @@ import java.util.ArrayList; import java.util.List; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-13T14:36:33.302+02:00") +/** + * InlineResponse200 + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:03.099+08:00") public class InlineResponse200 { - private List tags = new ArrayList(); + private List photoUrls = new ArrayList(); + private String name = null; private Long id = null; private Object category = null; + private List tags = new ArrayList(); - + /** + * pet status in the store + */ public enum StatusEnum { AVAILABLE("available"), PENDING("pending"), @@ -35,13 +39,79 @@ public class InlineResponse200 { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } private StatusEnum status = null; - private String name = null; - private List photoUrls = new ArrayList(); + + + /** + **/ + public InlineResponse200 photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("photoUrls") + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + /** + **/ + public InlineResponse200 name(String name) { + this.name = name; + return this; + } + + @ApiModelProperty(example = "doggie", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + /** + **/ + public InlineResponse200 id(Long id) { + this.id = id; + return this; + } + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + + /** + **/ + public InlineResponse200 category(Object category) { + this.category = category; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Object getCategory() { + return category; + } + public void setCategory(Object category) { + this.category = category; + } /** @@ -60,41 +130,7 @@ public class InlineResponse200 { this.tags = tags; } - - /** - **/ - public InlineResponse200 id(Long id) { - this.id = id; - return this; - } - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - - /** - **/ - public InlineResponse200 category(Object category) { - this.category = category; - return this; - } - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") - public Object getCategory() { - return category; - } - public void setCategory(Object category) { - this.category = category; - } - - /** * pet status in the store **/ @@ -112,40 +148,7 @@ public class InlineResponse200 { this.status = status; } - - /** - **/ - public InlineResponse200 name(String name) { - this.name = name; - return this; - } - @ApiModelProperty(example = "doggie", value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - /** - **/ - public InlineResponse200 photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - @ApiModelProperty(example = "null", value = "") - @JsonProperty("photoUrls") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - @Override public boolean equals(java.lang.Object o) { @@ -156,17 +159,17 @@ public class InlineResponse200 { return false; } InlineResponse200 inlineResponse200 = (InlineResponse200) o; - return Objects.equals(this.tags, inlineResponse200.tags) && + return Objects.equals(this.photoUrls, inlineResponse200.photoUrls) && + Objects.equals(this.name, inlineResponse200.name) && Objects.equals(this.id, inlineResponse200.id) && Objects.equals(this.category, inlineResponse200.category) && - Objects.equals(this.status, inlineResponse200.status) && - Objects.equals(this.name, inlineResponse200.name) && - Objects.equals(this.photoUrls, inlineResponse200.photoUrls); + Objects.equals(this.tags, inlineResponse200.tags) && + Objects.equals(this.status, inlineResponse200.status); } @Override public int hashCode() { - return Objects.hash(tags, id, category, status, name, photoUrls); + return Objects.hash(photoUrls, name, id, category, tags, status); } @Override @@ -174,12 +177,12 @@ public class InlineResponse200 { StringBuilder sb = new StringBuilder(); sb.append("class InlineResponse200 {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java index e3d07e1b441..4573c22c3da 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java @@ -6,13 +6,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name starting with number - **/ - + */ @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Model200Response { private Integer name = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java index a1ca4f7ef45..eca2b1fb388 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * ModelApiResponse + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class ModelApiResponse { private Integer code = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java index b8b35a72382..476bf479288 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java @@ -6,13 +6,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing reserved words - **/ - + */ @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class ModelReturn { private Integer _return = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java index d993ca02455..19ababb8f1c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java @@ -6,13 +6,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name same as property name - **/ - + */ @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Name { private Integer name = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index 9004aa13a10..359d0105b80 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -8,10 +8,10 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * Order + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Order { private Long id = null; @@ -19,7 +19,9 @@ public class Order { private Integer quantity = null; private Date shipDate = null; - + /** + * Order Status + */ public enum StatusEnum { PLACED("placed"), APPROVED("approved"), @@ -34,7 +36,7 @@ public class Order { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index f23c9124882..511100f868d 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -11,10 +11,10 @@ import java.util.ArrayList; import java.util.List; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * Pet + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Pet { private Long id = null; @@ -23,7 +23,9 @@ public class Pet { private List photoUrls = new ArrayList(); private List tags = new ArrayList(); - + /** + * pet status in the store + */ public enum StatusEnum { AVAILABLE("available"), PENDING("pending"), @@ -38,7 +40,7 @@ public class Pet { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java index b2b87fad3a4..37c5823ed2c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * SpecialModelName + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class SpecialModelName { private Long specialPropertyName = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java index 55bef8324de..ff51db61fef 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * Tag + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class Tag { private Long id = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java index d8657dda7f5..6a4414b5f82 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:48:24.088+08:00") +/** + * User + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") public class User { private Long id = null; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java index a4dfdc3bc56..1a3029ec922 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * Animal + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Animal { private String className = null; @@ -31,6 +31,7 @@ public class Animal { this.className = className; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java index f150e8d3121..c877047cd45 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java @@ -7,10 +7,10 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * Cat + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Cat extends Animal { private String className = null; @@ -33,7 +33,7 @@ public class Cat extends Animal { this.className = className; } - + /** **/ public Cat declawed(Boolean declawed) { @@ -50,6 +50,7 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java index 78f43782919..b9cb4951346 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * Category + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Category { private Long id = null; @@ -32,7 +32,7 @@ public class Category { this.id = id; } - + /** **/ public Category name(String name) { @@ -49,6 +49,7 @@ public class Category { this.name = name; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java index 45c85698089..15d3ce320b2 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java @@ -7,10 +7,10 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * Dog + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Dog extends Animal { private String className = null; @@ -33,7 +33,7 @@ public class Dog extends Animal { this.className = className; } - + /** **/ public Dog breed(String breed) { @@ -50,6 +50,7 @@ public class Dog extends Animal { this.breed = breed; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java new file mode 100644 index 00000000000..716bfbbc85e --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java @@ -0,0 +1,27 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; + + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + _ABC("_abc"), + _EFG("-efg"), + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java new file mode 100644 index 00000000000..6b8ee8102be --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java @@ -0,0 +1,178 @@ +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +/** + * EnumTest + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + LOWER("lower"); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumStringEnum enumString = null; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumIntegerEnum enumInteger = null; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private EnumNumberEnum enumNumber = null; + + + /** + **/ + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_string") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + + /** + **/ + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_integer") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + + /** + **/ + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("enum_number") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java index cd6a37772e0..36f04c225f6 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java @@ -6,13 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** - * Model for testing model name starting with number - **/ - -@ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") + * Model200Response + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Model200Response { private Integer name = null; @@ -34,6 +31,7 @@ public class Model200Response { this.name = name; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java index e6214862791..62224f3b2c3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -6,13 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** - * Model for testing reserved words - **/ - -@ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") + * ModelReturn + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class ModelReturn { private Integer _return = null; @@ -34,6 +31,7 @@ public class ModelReturn { this._return = _return; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java index f710f6122e4..92bf36a7952 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java @@ -6,18 +6,14 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** - * Model for testing model name same as property name - **/ - -@ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") + * Name + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Name { private Integer name = null; private Integer snakeCase = null; - private String property = null; /** @@ -27,7 +23,7 @@ public class Name { return this; } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(example = "null", value = "") @JsonProperty("name") public Integer getName() { return name; @@ -36,30 +32,24 @@ public class Name { this.name = name; } - + + /** + **/ + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + @ApiModelProperty(example = "null", value = "") @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } - - - /** - **/ - public Name property(String property) { - this.property = property; - return this; + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; } + - @ApiModelProperty(example = "null", value = "") - @JsonProperty("property") - public String getProperty() { - return property; - } - public void setProperty(String property) { - this.property = property; - } - @Override public boolean equals(java.lang.Object o) { @@ -71,13 +61,12 @@ public class Name { } Name name = (Name) o; return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property); + Objects.equals(this.snakeCase, name.snakeCase); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property); + return Objects.hash(name, snakeCase); } @Override @@ -87,7 +76,6 @@ public class Name { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java index c2fbdbcc9f9..116f07dc14d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java @@ -8,10 +8,10 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * Order + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Order { private Long id = null; @@ -19,7 +19,9 @@ public class Order { private Integer quantity = null; private Date shipDate = null; - + /** + * Order Status + */ public enum StatusEnum { PLACED("placed"), APPROVED("approved"), @@ -34,31 +36,21 @@ public class Order { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } - private StatusEnum status = null; - private Boolean complete = false; + private StatusEnum status = StatusEnum.PLACED; + private Boolean complete = null; - /** - **/ - public Order id(Long id) { - this.id = id; - return this; - } - @ApiModelProperty(example = "null", value = "") @JsonProperty("id") public Long getId() { return id; } - public void setId(Long id) { - this.id = id; - } - + /** **/ public Order petId(Long petId) { @@ -75,7 +67,7 @@ public class Order { this.petId = petId; } - + /** **/ public Order quantity(Integer quantity) { @@ -92,7 +84,7 @@ public class Order { this.quantity = quantity; } - + /** **/ public Order shipDate(Date shipDate) { @@ -109,7 +101,7 @@ public class Order { this.shipDate = shipDate; } - + /** * Order Status **/ @@ -127,7 +119,7 @@ public class Order { this.status = status; } - + /** **/ public Order complete(Boolean complete) { @@ -144,6 +136,7 @@ public class Order { this.complete = complete; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java index 100c8f265f0..82dc1e9a1a4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java @@ -11,10 +11,10 @@ import java.util.ArrayList; import java.util.List; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * Pet + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Pet { private Long id = null; @@ -23,7 +23,9 @@ public class Pet { private List photoUrls = new ArrayList(); private List tags = new ArrayList(); - + /** + * pet status in the store + */ public enum StatusEnum { AVAILABLE("available"), PENDING("pending"), @@ -38,7 +40,7 @@ public class Pet { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } @@ -61,7 +63,7 @@ public class Pet { this.id = id; } - + /** **/ public Pet category(Category category) { @@ -78,7 +80,7 @@ public class Pet { this.category = category; } - + /** **/ public Pet name(String name) { @@ -95,7 +97,7 @@ public class Pet { this.name = name; } - + /** **/ public Pet photoUrls(List photoUrls) { @@ -112,7 +114,7 @@ public class Pet { this.photoUrls = photoUrls; } - + /** **/ public Pet tags(List tags) { @@ -129,7 +131,7 @@ public class Pet { this.tags = tags; } - + /** * pet status in the store **/ @@ -147,6 +149,7 @@ public class Pet { this.status = status; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java index fa2813e9c42..12e360e83a4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * SpecialModelName + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class SpecialModelName { private Long specialPropertyName = null; @@ -31,6 +31,7 @@ public class SpecialModelName { this.specialPropertyName = specialPropertyName; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java index f82159f2111..0c579b9ed7e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * Tag + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class Tag { private Long id = null; @@ -32,7 +32,7 @@ public class Tag { this.id = id; } - + /** **/ public Tag name(String name) { @@ -49,6 +49,7 @@ public class Tag { this.name = name; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java index 56bfb774ccb..48933177c5f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - - - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") +/** + * User + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") public class User { private Long id = null; @@ -38,7 +38,7 @@ public class User { this.id = id; } - + /** **/ public User username(String username) { @@ -55,7 +55,7 @@ public class User { this.username = username; } - + /** **/ public User firstName(String firstName) { @@ -72,7 +72,7 @@ public class User { this.firstName = firstName; } - + /** **/ public User lastName(String lastName) { @@ -89,7 +89,7 @@ public class User { this.lastName = lastName; } - + /** **/ public User email(String email) { @@ -106,7 +106,7 @@ public class User { this.email = email; } - + /** **/ public User password(String password) { @@ -123,7 +123,7 @@ public class User { this.password = password; } - + /** **/ public User phone(String phone) { @@ -140,7 +140,7 @@ public class User { this.phone = phone; } - + /** * User Status **/ @@ -158,6 +158,7 @@ public class User { this.userStatus = userStatus; } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/client/petstore/java/okhttp-gson/docs/EnumClass.md b/samples/client/petstore/java/okhttp-gson/docs/EnumClass.md new file mode 100644 index 00000000000..d03195a19a4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md new file mode 100644 index 00000000000..deb1951c552 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md @@ -0,0 +1,36 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] + + + +## Enum: EnumStringEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + +## Enum: EnumIntegerEnum +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumNumberEnum +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md new file mode 100644 index 00000000000..f642566c8e7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -0,0 +1,75 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters + + + +# **testEndpointParameters** +> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) + +Fake endpoint for testing various parameters + +Fake endpoint for testing various parameters + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String number = "number_example"; // String | None +Double _double = 3.4D; // Double | None +String string = "string_example"; // String | None +byte[] _byte = B; // byte[] | None +Integer integer = 56; // Integer | None +Integer int32 = 56; // Integer | None +Long int64 = 789L; // Long | None +Float _float = 3.4F; // Float | None +byte[] binary = B; // byte[] | None +Date date = new Date(); // Date | None +Date dateTime = new Date(); // Date | None +String password = "password_example"; // String | None +try { + apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **String**| None | + **_double** | **Double**| None | + **string** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **Date**| None | [optional] + **dateTime** | **Date**| None | [optional] + **password** | **String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md index 8e400e7bcd7..5e54362e535 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md @@ -11,11 +11,11 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | [optional] +**_byte** | **byte[]** | | **binary** | **byte[]** | | [optional] -**date** | [**Date**](Date.md) | | [optional] +**date** | [**Date**](Date.md) | | **dateTime** | [**Date**](Date.md) | | [optional] -**password** | **String** | | [optional] +**password** | **String** | | diff --git a/samples/client/petstore/java/okhttp-gson/docs/Order.md b/samples/client/petstore/java/okhttp-gson/docs/Order.md index b1709c14eee..29ca3ddbc6b 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Order.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Order.md @@ -16,9 +16,9 @@ Name | Type | Description | Notes ## Enum: StatusEnum Name | Value ---- | ----- -PLACED | placed -APPROVED | approved -DELIVERED | delivered +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/okhttp-gson/docs/Pet.md b/samples/client/petstore/java/okhttp-gson/docs/Pet.md index 20a1c298dd6..5b63109ef92 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Pet.md @@ -16,9 +16,9 @@ Name | Type | Description | Notes ## Enum: StatusEnum Name | Value ---- | ----- -AVAILABLE | available -PENDING | pending -SOLD | sold +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java index 91d660ba2ac..7c440acc914 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java @@ -3,7 +3,7 @@ package io.swagger.client; import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:54:48.271+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:09:59.809+08:00") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java index cba4c9e4fde..3bb31938c36 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:54:48.271+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:09:59.809+08:00") public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java index d7d9f17cf3c..ff86c29b167 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:54:48.271+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:09:59.809+08:00") public class Pair { private String name = ""; private String value = ""; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java index bcd8b8115c8..67f661726b1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:54:48.271+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:09:59.809+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java new file mode 100644 index 00000000000..dd6d8236607 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java @@ -0,0 +1,221 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import com.squareup.okhttp.Call; +import com.squareup.okhttp.Interceptor; +import com.squareup.okhttp.Response; + +import java.io.IOException; + +import java.util.Date; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FakeApi { + private ApiClient apiClient; + + public FakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public FakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /* Build call for testEndpointParameters */ + private Call testEndpointParametersCall(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'number' is set + if (number == null) { + throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); + } + + // verify the required parameter '_double' is set + if (_double == null) { + throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); + } + + // verify the required parameter 'string' is set + if (string == null) { + throw new ApiException("Missing the required parameter 'string' when calling testEndpointParameters(Async)"); + } + + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); + } + + + // create path and map variables + String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + if (integer != null) + localVarFormParams.put("integer", integer); + if (int32 != null) + localVarFormParams.put("int32", int32); + if (int64 != null) + localVarFormParams.put("int64", int64); + if (number != null) + localVarFormParams.put("number", number); + if (_float != null) + localVarFormParams.put("float", _float); + if (_double != null) + localVarFormParams.put("double", _double); + if (string != null) + localVarFormParams.put("string", string); + if (_byte != null) + localVarFormParams.put("byte", _byte); + if (binary != null) + localVarFormParams.put("binary", binary); + if (date != null) + localVarFormParams.put("date", date); + if (dateTime != null) + localVarFormParams.put("dateTime", dateTime); + if (password != null) + localVarFormParams.put("password", password); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + /** + * Fake endpoint for testing various parameters + * Fake endpoint for testing various parameters + * @param number None (required) + * @param _double None (required) + * @param string None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void testEndpointParameters(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException { + testEndpointParametersWithHttpInfo(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + } + + /** + * Fake endpoint for testing various parameters + * Fake endpoint for testing various parameters + * @param number None (required) + * @param _double None (required) + * @param string None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse testEndpointParametersWithHttpInfo(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException { + Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, null, null); + return apiClient.execute(call); + } + + /** + * Fake endpoint for testing various parameters (asynchronously) + * Fake endpoint for testing various parameters + * @param number None (required) + * @param _double None (required) + * @param string None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public Call testEndpointParametersAsync(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java index 81c31c9f07d..c4e0be3e711 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java @@ -5,7 +5,7 @@ import io.swagger.client.Pair; import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:54:48.271+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:09:59.809+08:00") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java index b281311fa19..e05568f8f38 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java @@ -5,7 +5,7 @@ import io.swagger.client.Pair; import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:54:48.271+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:09:59.809+08:00") public class OAuth implements Authentication { private String accessToken; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java index 87997d9de3f..328f71b7123 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - - +/** + * Animal + */ public class Animal { @SerializedName("className") @@ -64,3 +64,4 @@ public class Animal { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java index 45a322f7d9b..9ca89141033 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java @@ -8,9 +8,9 @@ import io.swagger.client.model.Animal; import com.google.gson.annotations.SerializedName; - - - +/** + * Cat + */ public class Cat extends Animal { @SerializedName("className") @@ -81,3 +81,4 @@ public class Cat extends Animal { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java index 61151088a7d..f72d42a5746 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - - +/** + * Category + */ public class Category { @SerializedName("id") @@ -79,3 +79,4 @@ public class Category { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java index aa1bde7d22a..2fa478001b1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java @@ -8,9 +8,9 @@ import io.swagger.client.model.Animal; import com.google.gson.annotations.SerializedName; - - - +/** + * Dog + */ public class Dog extends Animal { @SerializedName("className") @@ -81,3 +81,4 @@ public class Dog extends Animal { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java new file mode 100644 index 00000000000..6426f26867c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java @@ -0,0 +1,32 @@ +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; + + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + @SerializedName("_abc") + _ABC("_abc"), + + @SerializedName("-efg") + _EFG("-efg"), + + @SerializedName("(xyz)") + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java new file mode 100644 index 00000000000..9b3103c16d7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java @@ -0,0 +1,166 @@ +package io.swagger.client.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import com.google.gson.annotations.SerializedName; + + +/** + * EnumTest + */ +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_string") + private EnumStringEnum enumString = null; + + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + @SerializedName("1") + NUMBER_1(1), + + @SerializedName("-1") + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_integer") + private EnumIntegerEnum enumInteger = null; + + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + @SerializedName("1.1") + NUMBER_1_DOT_1(1.1), + + @SerializedName("-1.2") + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_number") + private EnumNumberEnum enumNumber = null; + + /** + **/ + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java index 1b9100afbb0..0fc4082d119 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java @@ -9,9 +9,9 @@ import java.util.Date; import com.google.gson.annotations.SerializedName; - - - +/** + * FormatTest + */ public class FormatTest { @SerializedName("integer") @@ -51,6 +51,8 @@ public class FormatTest { private String password = null; /** + * minimum: 10.0 + * maximum: 100.0 **/ @ApiModelProperty(value = "") public Integer getInteger() { @@ -61,6 +63,8 @@ public class FormatTest { } /** + * minimum: 20.0 + * maximum: 200.0 **/ @ApiModelProperty(value = "") public Integer getInt32() { @@ -81,6 +85,8 @@ public class FormatTest { } /** + * minimum: 32.1 + * maximum: 543.2 **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { @@ -91,6 +97,8 @@ public class FormatTest { } /** + * minimum: 54.3 + * maximum: 987.6 **/ @ApiModelProperty(value = "") public Float getFloat() { @@ -101,6 +109,8 @@ public class FormatTest { } /** + * minimum: 67.8 + * maximum: 123.4 **/ @ApiModelProperty(value = "") public Double getDouble() { @@ -122,7 +132,7 @@ public class FormatTest { /** **/ - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -142,7 +152,7 @@ public class FormatTest { /** **/ - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") public Date getDate() { return date; } @@ -162,7 +172,7 @@ public class FormatTest { /** **/ - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } @@ -231,3 +241,4 @@ public class FormatTest { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java index ca0c5871388..0ca445cb545 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java @@ -7,11 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - /** * Model for testing model name starting with number - **/ + */ @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { @@ -67,3 +65,4 @@ public class Model200Response { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java index 20d2fc58dd3..da52eda160d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - - +/** + * ModelApiResponse + */ public class ModelApiResponse { @SerializedName("code") @@ -94,3 +94,4 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java index 071c5e7de14..51aa1f4e055 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java @@ -7,11 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - /** * Model for testing reserved words - **/ + */ @ApiModel(description = "Model for testing reserved words") public class ModelReturn { @@ -67,3 +65,4 @@ public class ModelReturn { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java index 7ba516f17ec..b9cc8170969 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java @@ -7,11 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - /** * Model for testing model name same as property name - **/ + */ @ApiModel(description = "Model for testing model name same as property name") public class Name { @@ -94,3 +92,4 @@ public class Name { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java index b0ebd0e8758..e5c87a21e5b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java @@ -8,9 +8,9 @@ import java.util.Date; import com.google.gson.annotations.SerializedName; - - - +/** + * Order + */ public class Order { @SerializedName("id") @@ -26,28 +26,31 @@ public class Order { private Date shipDate = null; -public enum StatusEnum { - @SerializedName("placed") - PLACED("placed"), + /** + * Order Status + */ + public enum StatusEnum { + @SerializedName("placed") + PLACED("placed"), - @SerializedName("approved") - APPROVED("approved"), + @SerializedName("approved") + APPROVED("approved"), - @SerializedName("delivered") - DELIVERED("delivered"); + @SerializedName("delivered") + DELIVERED("delivered"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; @@ -164,3 +167,4 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java index fe1f0a34aa3..bc18c39e75f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java @@ -11,9 +11,9 @@ import java.util.List; import com.google.gson.annotations.SerializedName; - - - +/** + * Pet + */ public class Pet { @SerializedName("id") @@ -32,28 +32,31 @@ public class Pet { private List tags = new ArrayList(); -public enum StatusEnum { - @SerializedName("available") - AVAILABLE("available"), + /** + * pet status in the store + */ + public enum StatusEnum { + @SerializedName("available") + AVAILABLE("available"), - @SerializedName("pending") - PENDING("pending"), + @SerializedName("pending") + PENDING("pending"), - @SerializedName("sold") - SOLD("sold"); + @SerializedName("sold") + SOLD("sold"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; @@ -167,3 +170,4 @@ public enum StatusEnum { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java index 1f9bc95113e..46cee3c51f8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - - +/** + * SpecialModelName + */ public class SpecialModelName { @SerializedName("$special[property.name]") @@ -64,3 +64,4 @@ public class SpecialModelName { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java index d605f019569..600acee2ba7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - - +/** + * Tag + */ public class Tag { @SerializedName("id") @@ -79,3 +79,4 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java index a9f6b63a2f4..c8b44ce6562 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import com.google.gson.annotations.SerializedName; - - - +/** + * User + */ public class User { @SerializedName("id") @@ -170,3 +170,4 @@ public class User { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/StringUtil.java index 8adb42d4fb8..fb5b299a706 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:55:47.640+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:10:49.444+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java new file mode 100644 index 00000000000..03f5b9aff1b --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java @@ -0,0 +1,66 @@ +package io.swagger.client.api; + +import io.swagger.client.CollectionFormats.*; + +import retrofit.Callback; +import retrofit.http.*; +import retrofit.mime.*; + +import java.util.Date; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface FakeApi { + /** + * Fake endpoint for testing various parameters + * Sync method + * Fake endpoint for testing various parameters + * @param number None (required) + * @param _double None (required) + * @param string None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @return Void + */ + + @FormUrlEncoded + @POST("/fake") + Void testEndpointParameters( + @Field("number") String number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password + ); + + /** + * Fake endpoint for testing various parameters + * Async method + * @param number None (required) + * @param _double None (required) + * @param string None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param cb callback method + * @return void + */ + + @FormUrlEncoded + @POST("/fake") + void testEndpointParameters( + @Field("number") String number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password, Callback cb + ); +} diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java new file mode 100644 index 00000000000..8f9357fbd32 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java @@ -0,0 +1,50 @@ +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; + + + + + +public class EnumClass { + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumClass enumClass = (EnumClass) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumClass {\n"); + + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java new file mode 100644 index 00000000000..8db392afccc --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java @@ -0,0 +1,165 @@ +package io.swagger.client.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import com.google.gson.annotations.SerializedName; + + + + + +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_string") + private EnumStringEnum enumString = null; + + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + @SerializedName("1") + NUMBER_1(1), + + @SerializedName("-1") + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_integer") + private EnumIntegerEnum enumInteger = null; + + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + @SerializedName("1.1") + NUMBER_1_DOT_1(1.1), + + @SerializedName("-1.2") + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_number") + private EnumNumberEnum enumNumber = null; + + /** + **/ + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(enumString, enumTest.enumString) && + Objects.equals(enumInteger, enumTest.enumInteger) && + Objects.equals(enumNumber, enumTest.enumNumber); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java index 29d17bbdfe7..40d1ca0ecea 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java @@ -51,6 +51,8 @@ public class FormatTest { private String password = null; /** + * minimum: 10.0 + * maximum: 100.0 **/ @ApiModelProperty(value = "") public Integer getInteger() { @@ -61,6 +63,8 @@ public class FormatTest { } /** + * minimum: 20.0 + * maximum: 200.0 **/ @ApiModelProperty(value = "") public Integer getInt32() { @@ -81,6 +85,8 @@ public class FormatTest { } /** + * minimum: 32.1 + * maximum: 543.2 **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { @@ -91,6 +97,8 @@ public class FormatTest { } /** + * minimum: 54.3 + * maximum: 987.6 **/ @ApiModelProperty(value = "") public Float getFloat() { @@ -101,6 +109,8 @@ public class FormatTest { } /** + * minimum: 67.8 + * maximum: 123.4 **/ @ApiModelProperty(value = "") public Double getDouble() { @@ -122,7 +132,7 @@ public class FormatTest { /** **/ - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -142,7 +152,7 @@ public class FormatTest { /** **/ - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") public Date getDate() { return date; } @@ -162,7 +172,7 @@ public class FormatTest { /** **/ - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java index 196a5702404..2f774c13834 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java @@ -26,28 +26,31 @@ public class Order { private Date shipDate = null; -public enum StatusEnum { - @SerializedName("placed") - PLACED("placed"), + /** + * Order Status + */ + public enum StatusEnum { + @SerializedName("placed") + PLACED("placed"), - @SerializedName("approved") - APPROVED("approved"), + @SerializedName("approved") + APPROVED("approved"), - @SerializedName("delivered") - DELIVERED("delivered"); + @SerializedName("delivered") + DELIVERED("delivered"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java index bcee581aa97..8efc46bc471 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java @@ -32,28 +32,31 @@ public class Pet { private List tags = new ArrayList(); -public enum StatusEnum { - @SerializedName("available") - AVAILABLE("available"), + /** + * pet status in the store + */ + public enum StatusEnum { + @SerializedName("available") + AVAILABLE("available"), - @SerializedName("pending") - PENDING("pending"), + @SerializedName("pending") + PENDING("pending"), - @SerializedName("sold") - SOLD("sold"); + @SerializedName("sold") + SOLD("sold"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java index f5e5cea4151..fe188deeaf5 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T10:03:24.454+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T16:12:35.075+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java new file mode 100644 index 00000000000..8f9357fbd32 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java @@ -0,0 +1,50 @@ +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; + + + + + +public class EnumClass { + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumClass enumClass = (EnumClass) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumClass {\n"); + + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java new file mode 100644 index 00000000000..8db392afccc --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java @@ -0,0 +1,165 @@ +package io.swagger.client.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import com.google.gson.annotations.SerializedName; + + + + + +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_string") + private EnumStringEnum enumString = null; + + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + @SerializedName("1") + NUMBER_1(1), + + @SerializedName("-1") + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_integer") + private EnumIntegerEnum enumInteger = null; + + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + @SerializedName("1.1") + NUMBER_1_DOT_1(1.1), + + @SerializedName("-1.2") + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_number") + private EnumNumberEnum enumNumber = null; + + /** + **/ + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(enumString, enumTest.enumString) && + Objects.equals(enumInteger, enumTest.enumInteger) && + Objects.equals(enumNumber, enumTest.enumNumber); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java index 196a5702404..2f774c13834 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java @@ -26,28 +26,31 @@ public class Order { private Date shipDate = null; -public enum StatusEnum { - @SerializedName("placed") - PLACED("placed"), + /** + * Order Status + */ + public enum StatusEnum { + @SerializedName("placed") + PLACED("placed"), - @SerializedName("approved") - APPROVED("approved"), + @SerializedName("approved") + APPROVED("approved"), - @SerializedName("delivered") - DELIVERED("delivered"); + @SerializedName("delivered") + DELIVERED("delivered"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java index bcee581aa97..8efc46bc471 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java @@ -32,28 +32,31 @@ public class Pet { private List tags = new ArrayList(); -public enum StatusEnum { - @SerializedName("available") - AVAILABLE("available"), + /** + * pet status in the store + */ + public enum StatusEnum { + @SerializedName("available") + AVAILABLE("available"), - @SerializedName("pending") - PENDING("pending"), + @SerializedName("pending") + PENDING("pending"), - @SerializedName("sold") - SOLD("sold"); + @SerializedName("sold") + SOLD("sold"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java index cee81411e96..ed7083e0370 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T10:03:29.641+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T23:45:14.234+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index beaa9833892..768376eb8f9 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -9,6 +9,7 @@ import retrofit2.http.*; import okhttp3.RequestBody; import java.util.Date; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -37,7 +38,7 @@ public interface FakeApi { @FormUrlEncoded @POST("fake") Observable testEndpointParameters( - @Field("number") String number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password + @Field("number") BigDecimal number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java index 4a2e64b726e..304ea7a29a8 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java @@ -9,8 +9,8 @@ import retrofit2.http.*; import okhttp3.RequestBody; import io.swagger.client.model.Pet; -import io.swagger.client.model.ModelApiResponse; import java.io.File; +import io.swagger.client.model.ModelApiResponse; import java.util.ArrayList; import java.util.HashMap; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java new file mode 100644 index 00000000000..8f9357fbd32 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java @@ -0,0 +1,50 @@ +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; + + + + + +public class EnumClass { + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumClass enumClass = (EnumClass) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumClass {\n"); + + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java new file mode 100644 index 00000000000..8db392afccc --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java @@ -0,0 +1,165 @@ +package io.swagger.client.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import com.google.gson.annotations.SerializedName; + + + + + +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + @SerializedName("UPPER") + UPPER("UPPER"), + + @SerializedName("lower") + LOWER("lower"); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_string") + private EnumStringEnum enumString = null; + + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + @SerializedName("1") + NUMBER_1(1), + + @SerializedName("-1") + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_integer") + private EnumIntegerEnum enumInteger = null; + + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + @SerializedName("1.1") + NUMBER_1_DOT_1(1.1), + + @SerializedName("-1.2") + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + @SerializedName("enum_number") + private EnumNumberEnum enumNumber = null; + + /** + **/ + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + **/ + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(enumString, enumTest.enumString) && + Objects.equals(enumInteger, enumTest.enumInteger) && + Objects.equals(enumNumber, enumTest.enumNumber); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java index 40d1ca0ecea..4106b15caaf 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Date; +import java.util.UUID; import com.google.gson.annotations.SerializedName; @@ -47,6 +48,9 @@ public class FormatTest { @SerializedName("dateTime") private Date dateTime = null; + @SerializedName("uuid") + private UUID uuid = null; + @SerializedName("password") private String password = null; @@ -170,6 +174,16 @@ public class FormatTest { this.dateTime = dateTime; } + /** + **/ + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + /** **/ @ApiModelProperty(required = true, value = "") @@ -201,12 +215,13 @@ public class FormatTest { Objects.equals(binary, formatTest.binary) && Objects.equals(date, formatTest.date) && Objects.equals(dateTime, formatTest.dateTime) && + Objects.equals(uuid, formatTest.uuid) && Objects.equals(password, formatTest.password); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } @Override @@ -225,6 +240,7 @@ public class FormatTest { sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java index 196a5702404..2f774c13834 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java @@ -26,28 +26,31 @@ public class Order { private Date shipDate = null; -public enum StatusEnum { - @SerializedName("placed") - PLACED("placed"), + /** + * Order Status + */ + public enum StatusEnum { + @SerializedName("placed") + PLACED("placed"), - @SerializedName("approved") - APPROVED("approved"), + @SerializedName("approved") + APPROVED("approved"), - @SerializedName("delivered") - DELIVERED("delivered"); + @SerializedName("delivered") + DELIVERED("delivered"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java index bcee581aa97..8efc46bc471 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java @@ -32,28 +32,31 @@ public class Pet { private List tags = new ArrayList(); -public enum StatusEnum { - @SerializedName("available") - AVAILABLE("available"), + /** + * pet status in the store + */ + public enum StatusEnum { + @SerializedName("available") + AVAILABLE("available"), - @SerializedName("pending") - PENDING("pending"), + @SerializedName("pending") + PENDING("pending"), - @SerializedName("sold") - SOLD("sold"); + @SerializedName("sold") + SOLD("sold"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } } - @Override - public String toString() { - return value; - } -} - @SerializedName("status") private StatusEnum status = null; diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 2d707697bf2..651e1e6047f 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -1,12 +1,12 @@ # swagger-petstore SwaggerPetstore - JavaScript client for swagger-petstore -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 +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-05-01T12:06:44.623+08:00 +- Build date: 2016-05-03T11:05:41.851+08:00 - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen ## Installation @@ -53,16 +53,25 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger-petstore'); -var defaultClient = SwaggerPetstore.ApiClient.default; +var api = new SwaggerPetstore.FakeApi() -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = "YOUR ACCESS TOKEN" +var _number = 3.4; // {Number} None -var api = new SwaggerPetstore.PetApi() +var _double = 1.2; // {Number} None + +var _string = "_string_example"; // {String} None + +var _byte = "B"; // {String} None var opts = { - 'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store + 'integer': 56, // {Integer} None + 'int32': 56, // {Integer} None + 'int64': 789, // {Integer} None + '_float': 3.4, // {Number} None + 'binary': "B", // {String} None + '_date': new Date("2013-10-20"), // {Date} None + 'dateTime': new Date("2013-10-20T19:20:30+01:00"), // {Date} None + 'password': "password_example" // {String} None }; var callback = function(error, data, response) { @@ -72,7 +81,7 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -api.addPet(opts, callback); +api.testEndpointParameters(_number, _double, _string, _byte, opts, callback); ``` @@ -82,6 +91,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -106,9 +116,20 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [SwaggerPetstore.Animal](docs/Animal.md) + - [SwaggerPetstore.ApiResponse](docs/ApiResponse.md) + - [SwaggerPetstore.Cat](docs/Cat.md) - [SwaggerPetstore.Category](docs/Category.md) + - [SwaggerPetstore.Dog](docs/Dog.md) + - [SwaggerPetstore.EnumClass](docs/EnumClass.md) + - [SwaggerPetstore.EnumTest](docs/EnumTest.md) + - [SwaggerPetstore.FormatTest](docs/FormatTest.md) + - [SwaggerPetstore.Model200Response](docs/Model200Response.md) + - [SwaggerPetstore.ModelReturn](docs/ModelReturn.md) + - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.Order](docs/Order.md) - [SwaggerPetstore.Pet](docs/Pet.md) + - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) - [SwaggerPetstore.Tag](docs/Tag.md) - [SwaggerPetstore.User](docs/User.md) diff --git a/samples/client/petstore/javascript/docs/ApiResponse.md b/samples/client/petstore/javascript/docs/ApiResponse.md new file mode 100644 index 00000000000..0ee678b84af --- /dev/null +++ b/samples/client/petstore/javascript/docs/ApiResponse.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + diff --git a/samples/client/petstore/javascript/docs/EnumClass.md b/samples/client/petstore/javascript/docs/EnumClass.md new file mode 100644 index 00000000000..5159ccfb454 --- /dev/null +++ b/samples/client/petstore/javascript/docs/EnumClass.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript/docs/EnumTest.md b/samples/client/petstore/javascript/docs/EnumTest.md new file mode 100644 index 00000000000..724eea8a25e --- /dev/null +++ b/samples/client/petstore/javascript/docs/EnumTest.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumInteger** | **Integer** | | [optional] +**enumNumber** | **Number** | | [optional] + + diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md new file mode 100644 index 00000000000..121056d1c56 --- /dev/null +++ b/samples/client/petstore/javascript/docs/FakeApi.md @@ -0,0 +1,82 @@ +# SwaggerPetstore.FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters + + + +# **testEndpointParameters** +> testEndpointParameters(_number, _double, _string, _byte, opts) + +Fake endpoint for testing various parameters + +Fake endpoint for testing various parameters + +### Example +```javascript +var SwaggerPetstore = require('swagger-petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var _number = 3.4; // Number | None + +var _double = 1.2; // Number | None + +var _string = "_string_example"; // String | None + +var _byte = "B"; // String | None + +var opts = { + 'integer': 56, // Integer | None + 'int32': 56, // Integer | None + 'int64': 789, // Integer | None + '_float': 3.4, // Number | None + 'binary': "B", // String | None + '_date': new Date("2013-10-20"), // Date | None + 'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None + 'password': "password_example" // String | None +}; + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}; +apiInstance.testEndpointParameters(_number, _double, _string, _byte, opts, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_number** | **Number**| None | + **_double** | **Number**| None | + **_string** | **String**| None | + **_byte** | **String**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Integer**| None | [optional] + **_float** | **Number**| None | [optional] + **binary** | **String**| None | [optional] + **_date** | **Date**| None | [optional] + **dateTime** | **Date**| None | [optional] + **password** | **String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/javascript/docs/FormatTest.md b/samples/client/petstore/javascript/docs/FormatTest.md index 57a4fb132d5..9600904ee6d 100644 --- a/samples/client/petstore/javascript/docs/FormatTest.md +++ b/samples/client/petstore/javascript/docs/FormatTest.md @@ -10,9 +10,11 @@ Name | Type | Description | Notes **_float** | **Number** | | [optional] **_double** | **Number** | | [optional] **_string** | **String** | | [optional] -**_byte** | **String** | | [optional] +**_byte** | **String** | | **binary** | **String** | | [optional] -**_date** | **Date** | | [optional] -**dateTime** | **String** | | [optional] +**_date** | **Date** | | +**dateTime** | **Date** | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | diff --git a/samples/client/petstore/javascript/docs/Name.md b/samples/client/petstore/javascript/docs/Name.md index f0e693f2f56..3bdb76be085 100644 --- a/samples/client/petstore/javascript/docs/Name.md +++ b/samples/client/petstore/javascript/docs/Name.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] +**property** | **String** | | [optional] diff --git a/samples/client/petstore/javascript/docs/Order.md b/samples/client/petstore/javascript/docs/Order.md index b34b67d3a56..10503b58206 100644 --- a/samples/client/petstore/javascript/docs/Order.md +++ b/samples/client/petstore/javascript/docs/Order.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **quantity** | **Integer** | | [optional] **shipDate** | **Date** | | [optional] **status** | **String** | Order Status | [optional] -**complete** | **Boolean** | | [optional] +**complete** | **Boolean** | | [optional] [default to false] diff --git a/samples/client/petstore/javascript/docs/PetApi.md b/samples/client/petstore/javascript/docs/PetApi.md index 39b8726b0b6..8807e772687 100644 --- a/samples/client/petstore/javascript/docs/PetApi.md +++ b/samples/client/petstore/javascript/docs/PetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **addPet** -> addPet(opts) +> addPet(body) Add a new pet to the store @@ -33,9 +33,8 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new SwaggerPetstore.PetApi(); -var opts = { - 'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store -}; +var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store + var callback = function(error, data, response) { if (error) { @@ -44,14 +43,14 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -apiInstance.addPet(opts, callback); +apiInstance.addPet(body, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +63,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **deletePet** @@ -119,15 +118,15 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **findPetsByStatus** -> [Pet] findPetsByStatus(opts) +> [Pet] findPetsByStatus(status) Finds Pets by status -Multiple status values can be provided with comma seperated strings +Multiple status values can be provided with comma separated strings ### Example ```javascript @@ -140,9 +139,8 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new SwaggerPetstore.PetApi(); -var opts = { - 'status': ["available"] // [String] | Status values that need to be considered for filter -}; +var status = ["status_example"]; // [String] | Status values that need to be considered for filter + var callback = function(error, data, response) { if (error) { @@ -151,14 +149,14 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -apiInstance.findPetsByStatus(opts, callback); +apiInstance.findPetsByStatus(status, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md)| Status values that need to be considered for filter | [optional] [default to available] + **status** | [**[String]**](String.md)| Status values that need to be considered for filter | ### Return type @@ -171,15 +169,15 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **findPetsByTags** -> [Pet] findPetsByTags(opts) +> [Pet] findPetsByTags(tags) Finds Pets by tags -Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example ```javascript @@ -192,9 +190,8 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new SwaggerPetstore.PetApi(); -var opts = { - 'tags': ["tags_example"] // [String] | Tags to filter by -}; +var tags = ["tags_example"]; // [String] | Tags to filter by + var callback = function(error, data, response) { if (error) { @@ -203,14 +200,14 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -apiInstance.findPetsByTags(opts, callback); +apiInstance.findPetsByTags(tags, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md)| Tags to filter by | [optional] + **tags** | [**[String]**](String.md)| Tags to filter by | ### Return type @@ -223,7 +220,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **getPetById** @@ -231,7 +228,7 @@ Name | Type | Description | Notes Find pet by ID -Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +Returns a single pet ### Example ```javascript @@ -244,13 +241,9 @@ api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - var apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Integer | ID of pet that needs to be fetched +var petId = 789; // Integer | ID of pet to return var callback = function(error, data, response) { @@ -267,7 +260,7 @@ apiInstance.getPetById(petId, callback); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Integer**| ID of pet that needs to be fetched | + **petId** | **Integer**| ID of pet to return | ### Return type @@ -275,16 +268,16 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) +[api_key](../README.md#api_key) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **updatePet** -> updatePet(opts) +> updatePet(body) Update an existing pet @@ -301,9 +294,8 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new SwaggerPetstore.PetApi(); -var opts = { - 'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store -}; +var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store + var callback = function(error, data, response) { if (error) { @@ -312,14 +304,14 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -apiInstance.updatePet(opts, callback); +apiInstance.updatePet(body, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -332,7 +324,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **updatePetWithForm** @@ -353,7 +345,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new SwaggerPetstore.PetApi(); -var petId = "petId_example"; // String | ID of pet that needs to be updated +var petId = 789; // Integer | ID of pet that needs to be updated var opts = { 'name': "name_example", // String | Updated name of the pet @@ -374,7 +366,7 @@ apiInstance.updatePetWithForm(petId, opts, callback); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **String**| ID of pet that needs to be updated | + **petId** | **Integer**| ID of pet that needs to be updated | **name** | **String**| Updated name of the pet | [optional] **status** | **String**| Updated status of the pet | [optional] @@ -389,11 +381,11 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **uploadFile** -> uploadFile(petId, opts) +> ApiResponse uploadFile(petId, opts) uploads an image @@ -421,7 +413,7 @@ var callback = function(error, data, response) { if (error) { console.error(error); } else { - console.log('API called successfully.'); + console.log('API called successfully. Returned data: ' + data); } }; apiInstance.uploadFile(petId, opts, callback); @@ -437,7 +429,7 @@ Name | Type | Description | Notes ### Return type -null (empty response body) +[**ApiResponse**](ApiResponse.md) ### Authorization @@ -446,5 +438,5 @@ null (empty response body) ### HTTP request headers - **Content-Type**: multipart/form-data - - **Accept**: application/json, application/xml + - **Accept**: application/json diff --git a/samples/client/petstore/javascript/docs/StoreApi.md b/samples/client/petstore/javascript/docs/StoreApi.md index 563157be5b0..39c66ed5430 100644 --- a/samples/client/petstore/javascript/docs/StoreApi.md +++ b/samples/client/petstore/javascript/docs/StoreApi.md @@ -54,7 +54,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **getInventory** @@ -101,7 +101,7 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/json # **getOrderById** @@ -117,7 +117,7 @@ var SwaggerPetstore = require('swagger-petstore'); var apiInstance = new SwaggerPetstore.StoreApi(); -var orderId = "orderId_example"; // String | ID of pet that needs to be fetched +var orderId = 789; // Integer | ID of pet that needs to be fetched var callback = function(error, data, response) { @@ -134,7 +134,7 @@ apiInstance.getOrderById(orderId, callback); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of pet that needs to be fetched | + **orderId** | **Integer**| ID of pet that needs to be fetched | ### Return type @@ -147,11 +147,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **placeOrder** -> Order placeOrder(opts) +> Order placeOrder(body) Place an order for a pet @@ -163,9 +163,8 @@ var SwaggerPetstore = require('swagger-petstore'); var apiInstance = new SwaggerPetstore.StoreApi(); -var opts = { - 'body': new SwaggerPetstore.Order() // Order | order placed for purchasing the pet -}; +var body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet + var callback = function(error, data, response) { if (error) { @@ -174,14 +173,14 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -apiInstance.placeOrder(opts, callback); +apiInstance.placeOrder(body, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -194,5 +193,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/javascript/docs/UserApi.md b/samples/client/petstore/javascript/docs/UserApi.md index 5f9faae29b5..6646acc83ee 100644 --- a/samples/client/petstore/javascript/docs/UserApi.md +++ b/samples/client/petstore/javascript/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(opts) +> createUser(body) Create user @@ -28,9 +28,8 @@ var SwaggerPetstore = require('swagger-petstore'); var apiInstance = new SwaggerPetstore.UserApi(); -var opts = { - 'body': new SwaggerPetstore.User() // User | Created user object -}; +var body = new SwaggerPetstore.User(); // User | Created user object + var callback = function(error, data, response) { if (error) { @@ -39,14 +38,14 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -apiInstance.createUser(opts, callback); +apiInstance.createUser(body, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | [optional] + **body** | [**User**](User.md)| Created user object | ### Return type @@ -59,11 +58,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **createUsersWithArrayInput** -> createUsersWithArrayInput(opts) +> createUsersWithArrayInput(body) Creates list of users with given input array @@ -75,9 +74,8 @@ var SwaggerPetstore = require('swagger-petstore'); var apiInstance = new SwaggerPetstore.UserApi(); -var opts = { - 'body': [new SwaggerPetstore.User()] // [User] | List of user object -}; +var body = [new SwaggerPetstore.User()]; // [User] | List of user object + var callback = function(error, data, response) { if (error) { @@ -86,14 +84,14 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -apiInstance.createUsersWithArrayInput(opts, callback); +apiInstance.createUsersWithArrayInput(body, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md)| List of user object | [optional] + **body** | [**[User]**](User.md)| List of user object | ### Return type @@ -106,11 +104,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **createUsersWithListInput** -> createUsersWithListInput(opts) +> createUsersWithListInput(body) Creates list of users with given input array @@ -122,9 +120,8 @@ var SwaggerPetstore = require('swagger-petstore'); var apiInstance = new SwaggerPetstore.UserApi(); -var opts = { - 'body': [new SwaggerPetstore.User()] // [User] | List of user object -}; +var body = [new SwaggerPetstore.User()]; // [User] | List of user object + var callback = function(error, data, response) { if (error) { @@ -133,14 +130,14 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -apiInstance.createUsersWithListInput(opts, callback); +apiInstance.createUsersWithListInput(body, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md)| List of user object | [optional] + **body** | [**[User]**](User.md)| List of user object | ### Return type @@ -153,7 +150,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **deleteUser** @@ -199,7 +196,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **getUserByName** @@ -245,11 +242,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **loginUser** -> 'String' loginUser(opts) +> 'String' loginUser(username, password) Logs user into the system @@ -261,10 +258,10 @@ var SwaggerPetstore = require('swagger-petstore'); var apiInstance = new SwaggerPetstore.UserApi(); -var opts = { - 'username': "username_example", // String | The user name for login - 'password': "password_example" // String | The password for login in clear text -}; +var username = "username_example"; // String | The user name for login + +var password = "password_example"; // String | The password for login in clear text + var callback = function(error, data, response) { if (error) { @@ -273,15 +270,15 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -apiInstance.loginUser(opts, callback); +apiInstance.loginUser(username, password, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [optional] - **password** | **String**| The password for login in clear text | [optional] + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | ### Return type @@ -294,7 +291,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **logoutUser** @@ -334,11 +331,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json # **updateUser** -> updateUser(username, opts) +> updateUser(username, body) Updated user @@ -352,9 +349,8 @@ var apiInstance = new SwaggerPetstore.UserApi(); var username = "username_example"; // String | name that need to be deleted -var opts = { - 'body': new SwaggerPetstore.User() // User | Updated user object -}; +var body = new SwaggerPetstore.User(); // User | Updated user object + var callback = function(error, data, response) { if (error) { @@ -363,7 +359,7 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -apiInstance.updateUser(username, opts, callback); +apiInstance.updateUser(username, body, callback); ``` ### Parameters @@ -371,7 +367,7 @@ apiInstance.updateUser(username, opts, callback); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | [optional] + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -384,5 +380,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/javascript/package.json b/samples/client/petstore/javascript/package.json index 72a48ac71de..8ff02a78ae3 100644 --- a/samples/client/petstore/javascript/package.json +++ b/samples/client/petstore/javascript/package.json @@ -1,7 +1,7 @@ { "name": "swagger-petstore", "version": "1.0.0", - "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", + "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.", "license": "Apache 2.0", "main": "src/index.js", "scripts": { diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js new file mode 100644 index 00000000000..f75b8f55890 --- /dev/null +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -0,0 +1,121 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + /** + * Fake service. + * @module api/FakeApi + * @version 1.0.0 + */ + + /** + * Constructs a new FakeApi. + * @alias module:api/FakeApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + /** + * Callback function to receive the result of the testEndpointParameters operation. + * @callback module:api/FakeApi~testEndpointParametersCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * Fake endpoint for testing various parameters + * Fake endpoint for testing various parameters + * @param {Number} _number None + * @param {Number} _double None + * @param {String} _string None + * @param {String} _byte None + * @param {Object} opts Optional parameters + * @param {Integer} opts.integer None + * @param {Integer} opts.int32 None + * @param {Integer} opts.int64 None + * @param {Number} opts._float None + * @param {String} opts.binary None + * @param {Date} opts._date None + * @param {Date} opts.dateTime None + * @param {String} opts.password None + * @param {module:api/FakeApi~testEndpointParametersCallback} callback The callback function, accepting three arguments: error, data, response + */ + this.testEndpointParameters = function(_number, _double, _string, _byte, opts, callback) { + opts = opts || {}; + var postBody = null; + + // verify the required parameter '_number' is set + if (_number == undefined || _number == null) { + throw "Missing the required parameter '_number' when calling testEndpointParameters"; + } + + // verify the required parameter '_double' is set + if (_double == undefined || _double == null) { + throw "Missing the required parameter '_double' when calling testEndpointParameters"; + } + + // verify the required parameter '_string' is set + if (_string == undefined || _string == null) { + throw "Missing the required parameter '_string' when calling testEndpointParameters"; + } + + // verify the required parameter '_byte' is set + if (_byte == undefined || _byte == null) { + throw "Missing the required parameter '_byte' when calling testEndpointParameters"; + } + + + var pathParams = { + }; + var queryParams = { + }; + var headerParams = { + }; + var formParams = { + 'integer': opts['integer'], + 'int32': opts['int32'], + 'int64': opts['int64'], + 'number': _number, + 'float': opts['_float'], + 'double': _double, + 'string': _string, + 'byte': _byte, + 'binary': opts['binary'], + 'date': opts['_date'], + 'dateTime': opts['dateTime'], + 'password': opts['password'] + }; + + var authNames = []; + var contentTypes = []; + var accepts = ['application/xml', 'application/json']; + var returnType = null; + + return this.apiClient.callApi( + '/fake', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index da88c3f34f9..6e7193bd53e 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -1,18 +1,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Pet'], factory); + define(['ApiClient', 'model/Pet', 'model/ApiResponse'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Pet')); + module.exports = factory(require('../ApiClient'), require('../model/Pet'), require('../model/ApiResponse')); } else { // Browser globals (root is window) if (!root.SwaggerPetstore) { root.SwaggerPetstore = {}; } - root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Pet); + root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Pet, root.SwaggerPetstore.ApiResponse); } -}(this, function(ApiClient, Pet) { +}(this, function(ApiClient, Pet, ApiResponse) { 'use strict'; /** @@ -43,13 +43,16 @@ /** * Add a new pet to the store * - * @param {Object} opts Optional parameters - * @param {module:model/Pet} opts.body Pet object that needs to be added to the store + * @param {module:model/Pet} body Pet object that needs to be added to the store * @param {module:api/PetApi~addPetCallback} callback The callback function, accepting three arguments: error, data, response */ - this.addPet = function(opts, callback) { - opts = opts || {}; - var postBody = opts['body']; + this.addPet = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body == undefined || body == null) { + throw "Missing the required parameter 'body' when calling addPet"; + } var pathParams = { @@ -63,7 +66,7 @@ var authNames = ['petstore_auth']; var contentTypes = ['application/json', 'application/xml']; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -112,7 +115,7 @@ var authNames = ['petstore_auth']; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -132,21 +135,24 @@ /** * Finds Pets by status - * Multiple status values can be provided with comma seperated strings - * @param {Object} opts Optional parameters - * @param {Array.} opts.status Status values that need to be considered for filter (default to available) + * Multiple status values can be provided with comma separated strings + * @param {Array.} status Status values that need to be considered for filter * @param {module:api/PetApi~findPetsByStatusCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {Array.} */ - this.findPetsByStatus = function(opts, callback) { - opts = opts || {}; + this.findPetsByStatus = function(status, callback) { var postBody = null; + // verify the required parameter 'status' is set + if (status == undefined || status == null) { + throw "Missing the required parameter 'status' when calling findPetsByStatus"; + } + var pathParams = { }; var queryParams = { - 'status': this.apiClient.buildCollectionParam(opts['status'], 'multi') + 'status': this.apiClient.buildCollectionParam(status, 'csv') }; var headerParams = { }; @@ -155,7 +161,7 @@ var authNames = ['petstore_auth']; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = [Pet]; return this.apiClient.callApi( @@ -175,21 +181,24 @@ /** * Finds Pets by tags - * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param {Object} opts Optional parameters - * @param {Array.} opts.tags Tags to filter by + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param {Array.} tags Tags to filter by * @param {module:api/PetApi~findPetsByTagsCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {Array.} */ - this.findPetsByTags = function(opts, callback) { - opts = opts || {}; + this.findPetsByTags = function(tags, callback) { var postBody = null; + // verify the required parameter 'tags' is set + if (tags == undefined || tags == null) { + throw "Missing the required parameter 'tags' when calling findPetsByTags"; + } + var pathParams = { }; var queryParams = { - 'tags': this.apiClient.buildCollectionParam(opts['tags'], 'multi') + 'tags': this.apiClient.buildCollectionParam(tags, 'csv') }; var headerParams = { }; @@ -198,7 +207,7 @@ var authNames = ['petstore_auth']; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = [Pet]; return this.apiClient.callApi( @@ -218,8 +227,8 @@ /** * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param {Integer} petId ID of pet that needs to be fetched + * Returns a single pet + * @param {Integer} petId ID of pet to return * @param {module:api/PetApi~getPetByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {module:model/Pet} */ @@ -242,9 +251,9 @@ var formParams = { }; - var authNames = ['api_key', 'petstore_auth']; + var authNames = ['api_key']; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = Pet; return this.apiClient.callApi( @@ -265,13 +274,16 @@ /** * Update an existing pet * - * @param {Object} opts Optional parameters - * @param {module:model/Pet} opts.body Pet object that needs to be added to the store + * @param {module:model/Pet} body Pet object that needs to be added to the store * @param {module:api/PetApi~updatePetCallback} callback The callback function, accepting three arguments: error, data, response */ - this.updatePet = function(opts, callback) { - opts = opts || {}; - var postBody = opts['body']; + this.updatePet = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body == undefined || body == null) { + throw "Missing the required parameter 'body' when calling updatePet"; + } var pathParams = { @@ -285,7 +297,7 @@ var authNames = ['petstore_auth']; var contentTypes = ['application/json', 'application/xml']; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -306,7 +318,7 @@ /** * Updates a pet in the store with form data * - * @param {String} petId ID of pet that needs to be updated + * @param {Integer} petId ID of pet that needs to be updated * @param {Object} opts Optional parameters * @param {String} opts.name Updated name of the pet * @param {String} opts.status Updated status of the pet @@ -336,7 +348,7 @@ var authNames = ['petstore_auth']; var contentTypes = ['application/x-www-form-urlencoded']; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -350,7 +362,7 @@ * Callback function to receive the result of the uploadFile operation. * @callback module:api/PetApi~uploadFileCallback * @param {String} error Error message, if any. - * @param data This operation does not return a value. + * @param {module:model/ApiResponse} data The data returned by the service call. * @param {String} response The complete HTTP response. */ @@ -362,6 +374,7 @@ * @param {String} opts.additionalMetadata Additional data to pass to server * @param {File} opts.file file to upload * @param {module:api/PetApi~uploadFileCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {module:model/ApiResponse} */ this.uploadFile = function(petId, opts, callback) { opts = opts || {}; @@ -387,8 +400,8 @@ var authNames = ['petstore_auth']; var contentTypes = ['multipart/form-data']; - var accepts = ['application/json', 'application/xml']; - var returnType = null; + var accepts = ['application/json']; + var returnType = ApiResponse; return this.apiClient.callApi( '/pet/{petId}/uploadImage', 'POST', diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 56c05b82aa4..8b9aa077de7 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -67,7 +67,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -106,7 +106,7 @@ var authNames = ['api_key']; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/json']; var returnType = {'String': 'Integer'}; return this.apiClient.callApi( @@ -127,7 +127,7 @@ /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param {String} orderId ID of pet that needs to be fetched + * @param {Integer} orderId ID of pet that needs to be fetched * @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {module:model/Order} */ @@ -152,7 +152,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = Order; return this.apiClient.callApi( @@ -173,14 +173,17 @@ /** * Place an order for a pet * - * @param {Object} opts Optional parameters - * @param {module:model/Order} opts.body order placed for purchasing the pet + * @param {module:model/Order} body order placed for purchasing the pet * @param {module:api/StoreApi~placeOrderCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {module:model/Order} */ - this.placeOrder = function(opts, callback) { - opts = opts || {}; - var postBody = opts['body']; + this.placeOrder = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body == undefined || body == null) { + throw "Missing the required parameter 'body' when calling placeOrder"; + } var pathParams = { @@ -194,7 +197,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = Order; return this.apiClient.callApi( diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 00c717cc3de..4bc7218fdce 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -43,13 +43,16 @@ /** * Create user * This can only be done by the logged in user. - * @param {Object} opts Optional parameters - * @param {module:model/User} opts.body Created user object + * @param {module:model/User} body Created user object * @param {module:api/UserApi~createUserCallback} callback The callback function, accepting three arguments: error, data, response */ - this.createUser = function(opts, callback) { - opts = opts || {}; - var postBody = opts['body']; + this.createUser = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body == undefined || body == null) { + throw "Missing the required parameter 'body' when calling createUser"; + } var pathParams = { @@ -63,7 +66,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -84,13 +87,16 @@ /** * Creates list of users with given input array * - * @param {Object} opts Optional parameters - * @param {Array.} opts.body List of user object + * @param {Array.} body List of user object * @param {module:api/UserApi~createUsersWithArrayInputCallback} callback The callback function, accepting three arguments: error, data, response */ - this.createUsersWithArrayInput = function(opts, callback) { - opts = opts || {}; - var postBody = opts['body']; + this.createUsersWithArrayInput = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body == undefined || body == null) { + throw "Missing the required parameter 'body' when calling createUsersWithArrayInput"; + } var pathParams = { @@ -104,7 +110,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -125,13 +131,16 @@ /** * Creates list of users with given input array * - * @param {Object} opts Optional parameters - * @param {Array.} opts.body List of user object + * @param {Array.} body List of user object * @param {module:api/UserApi~createUsersWithListInputCallback} callback The callback function, accepting three arguments: error, data, response */ - this.createUsersWithListInput = function(opts, callback) { - opts = opts || {}; - var postBody = opts['body']; + this.createUsersWithListInput = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body == undefined || body == null) { + throw "Missing the required parameter 'body' when calling createUsersWithListInput"; + } var pathParams = { @@ -145,7 +154,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -190,7 +199,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -236,7 +245,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = User; return this.apiClient.callApi( @@ -257,22 +266,30 @@ /** * Logs user into the system * - * @param {Object} opts Optional parameters - * @param {String} opts.username The user name for login - * @param {String} opts.password The password for login in clear text + * @param {String} username The user name for login + * @param {String} password The password for login in clear text * @param {module:api/UserApi~loginUserCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {'String'} */ - this.loginUser = function(opts, callback) { - opts = opts || {}; + this.loginUser = function(username, password, callback) { var postBody = null; + // verify the required parameter 'username' is set + if (username == undefined || username == null) { + throw "Missing the required parameter 'username' when calling loginUser"; + } + + // verify the required parameter 'password' is set + if (password == undefined || password == null) { + throw "Missing the required parameter 'password' when calling loginUser"; + } + var pathParams = { }; var queryParams = { - 'username': opts['username'], - 'password': opts['password'] + 'username': username, + 'password': password }; var headerParams = { }; @@ -281,7 +298,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = 'String'; return this.apiClient.callApi( @@ -319,7 +336,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( @@ -341,19 +358,22 @@ * Updated user * This can only be done by the logged in user. * @param {String} username name that need to be deleted - * @param {Object} opts Optional parameters - * @param {module:model/User} opts.body Updated user object + * @param {module:model/User} body Updated user object * @param {module:api/UserApi~updateUserCallback} callback The callback function, accepting three arguments: error, data, response */ - this.updateUser = function(username, opts, callback) { - opts = opts || {}; - var postBody = opts['body']; + this.updateUser = function(username, body, callback) { + var postBody = body; // verify the required parameter 'username' is set if (username == undefined || username == null) { throw "Missing the required parameter 'username' when calling updateUser"; } + // verify the required parameter 'body' is set + if (body == undefined || body == null) { + throw "Missing the required parameter 'body' when calling updateUser"; + } + var pathParams = { 'username': username @@ -367,7 +387,7 @@ var authNames = []; var contentTypes = []; - var accepts = ['application/json', 'application/xml']; + var accepts = ['application/xml', 'application/json']; var returnType = null; return this.apiClient.callApi( diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index b0d17b3ef3a..2c3fb27ef65 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -1,16 +1,16 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Category', 'model/Order', 'model/Pet', 'model/Tag', 'model/User', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/Animal', 'model/ApiResponse', 'model/Cat', 'model/Category', 'model/Dog', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/Order', 'model/Pet', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/Order'), require('./model/Pet'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/Cat'), require('./model/Category'), require('./model/Dog'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, Category, Order, Pet, Tag, User, PetApi, StoreApi, UserApi) { +}(function(ApiClient, Animal, ApiResponse, Cat, Category, Dog, EnumClass, EnumTest, FormatTest, Model200Response, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, FakeApi, PetApi, StoreApi, UserApi) { 'use strict'; /** - * This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters.
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose..
* The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: @@ -46,11 +46,61 @@ * @property {module:ApiClient} */ ApiClient: ApiClient, + /** + * The Animal model constructor. + * @property {module:model/Animal} + */ + Animal: Animal, + /** + * The ApiResponse model constructor. + * @property {module:model/ApiResponse} + */ + ApiResponse: ApiResponse, + /** + * The Cat model constructor. + * @property {module:model/Cat} + */ + Cat: Cat, /** * The Category model constructor. * @property {module:model/Category} */ Category: Category, + /** + * The Dog model constructor. + * @property {module:model/Dog} + */ + Dog: Dog, + /** + * The EnumClass model constructor. + * @property {module:model/EnumClass} + */ + EnumClass: EnumClass, + /** + * The EnumTest model constructor. + * @property {module:model/EnumTest} + */ + EnumTest: EnumTest, + /** + * The FormatTest model constructor. + * @property {module:model/FormatTest} + */ + FormatTest: FormatTest, + /** + * The Model200Response model constructor. + * @property {module:model/Model200Response} + */ + Model200Response: Model200Response, + /** + * The ModelReturn model constructor. + * @property {module:model/ModelReturn} + */ + ModelReturn: ModelReturn, + /** + * The Name model constructor. + * @property {module:model/Name} + */ + Name: Name, /** * The Order model constructor. * @property {module:model/Order} @@ -61,6 +111,11 @@ * @property {module:model/Pet} */ Pet: Pet, + /** + * The SpecialModelName model constructor. + * @property {module:model/SpecialModelName} + */ + SpecialModelName: SpecialModelName, /** * The Tag model constructor. * @property {module:model/Tag} @@ -71,6 +126,11 @@ * @property {module:model/User} */ User: User, + /** + * The FakeApi service constructor. + * @property {module:api/FakeApi} + */ + FakeApi: FakeApi, /** * The PetApi service constructor. * @property {module:api/PetApi} diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index 674471a30ee..e42874c669b 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -1,7 +1,7 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['../ApiClient'], factory); + define(['ApiClient'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient')); @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The Animal model module. * @module model/Animal @@ -28,8 +31,9 @@ * @param className */ var exports = function(className) { + var _this = this; - this['className'] = className; + _this['className'] = className; }; /** @@ -40,7 +44,7 @@ * @return {module:model/Animal} The populated Animal instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); if (data.hasOwnProperty('className')) { @@ -50,7 +54,6 @@ return obj; } - /** * @member {String} className */ @@ -61,3 +64,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/ApiResponse.js b/samples/client/petstore/javascript/src/model/ApiResponse.js new file mode 100644 index 00000000000..6d4c970264b --- /dev/null +++ b/samples/client/petstore/javascript/src/model/ApiResponse.js @@ -0,0 +1,83 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.ApiResponse = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The ApiResponse model module. + * @module model/ApiResponse + * @version 1.0.0 + */ + + /** + * Constructs a new ApiResponse. + * @alias module:model/ApiResponse + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ApiResponse} obj Optional instance to populate. + * @return {module:model/ApiResponse} The populated ApiResponse instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'Integer'); + } + if (data.hasOwnProperty('type')) { + obj['type'] = ApiClient.convertToType(data['type'], 'String'); + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + } + return obj; + } + + /** + * @member {Integer} code + */ + exports.prototype['code'] = undefined; + /** + * @member {String} type + */ + exports.prototype['type'] = undefined; + /** + * @member {String} message + */ + exports.prototype['message'] = undefined; + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/Cat.js b/samples/client/petstore/javascript/src/model/Cat.js index c878af6edec..a6b25bc6d58 100644 --- a/samples/client/petstore/javascript/src/model/Cat.js +++ b/samples/client/petstore/javascript/src/model/Cat.js @@ -1,7 +1,7 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['../ApiClient', './Animal'], factory); + define(['ApiClient', 'model/Animal'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./Animal')); @@ -15,6 +15,9 @@ }(this, function(ApiClient, Animal) { 'use strict'; + + + /** * The Cat model module. * @module model/Cat @@ -29,7 +32,8 @@ * @param className */ var exports = function(className) { - Animal.call(this, className); + var _this = this; + Animal.call(_this, className); }; @@ -41,7 +45,7 @@ * @return {module:model/Cat} The populated Cat instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); Animal.constructFromObject(data, obj); if (data.hasOwnProperty('declawed')) { @@ -54,7 +58,6 @@ exports.prototype = Object.create(Animal.prototype); exports.prototype.constructor = exports; - /** * @member {Boolean} declawed */ @@ -65,3 +68,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js index 9956525e037..9e2e19ac5bb 100644 --- a/samples/client/petstore/javascript/src/model/Category.js +++ b/samples/client/petstore/javascript/src/model/Category.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The Category model module. * @module model/Category @@ -54,12 +57,10 @@ return obj; } - /** * @member {Integer} id */ exports.prototype['id'] = undefined; - /** * @member {String} name */ @@ -70,3 +71,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/Dog.js b/samples/client/petstore/javascript/src/model/Dog.js index e5e55581a70..ee17ae3467f 100644 --- a/samples/client/petstore/javascript/src/model/Dog.js +++ b/samples/client/petstore/javascript/src/model/Dog.js @@ -1,7 +1,7 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['../ApiClient', './Animal'], factory); + define(['ApiClient', 'model/Animal'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./Animal')); @@ -15,6 +15,9 @@ }(this, function(ApiClient, Animal) { 'use strict'; + + + /** * The Dog model module. * @module model/Dog @@ -29,7 +32,8 @@ * @param className */ var exports = function(className) { - Animal.call(this, className); + var _this = this; + Animal.call(_this, className); }; @@ -41,7 +45,7 @@ * @return {module:model/Dog} The populated Dog instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); Animal.constructFromObject(data, obj); if (data.hasOwnProperty('breed')) { @@ -54,7 +58,6 @@ exports.prototype = Object.create(Animal.prototype); exports.prototype.constructor = exports; - /** * @member {String} breed */ @@ -65,3 +68,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js new file mode 100644 index 00000000000..2ff3398113a --- /dev/null +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -0,0 +1,44 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.EnumClass = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class EnumClass. + * @enum {} + * @readonly + */ + exports.EnumClass = { + /** + * value: _abc + * @const + */ + "_abc": "_abc", + /** + * value: -efg + * @const + */ + "-efg": "-efg", + /** + * value: (xyz) + * @const + */ + "(xyz)": "(xyz)" }; + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/EnumTest.js b/samples/client/petstore/javascript/src/model/EnumTest.js new file mode 100644 index 00000000000..6f8f0de3836 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -0,0 +1,131 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.EnumTest = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The EnumTest model module. + * @module model/EnumTest + * @version 1.0.0 + */ + + /** + * Constructs a new EnumTest. + * @alias module:model/EnumTest + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumTest} obj Optional instance to populate. + * @return {module:model/EnumTest} The populated EnumTest instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('enum_string')) { + obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); + } + if (data.hasOwnProperty('enum_integer')) { + obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Integer'); + } + if (data.hasOwnProperty('enum_number')) { + obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number'); + } + } + return obj; + } + + /** + * @member {module:model/EnumTest.EnumStringEnum} enum_string + */ + exports.prototype['enum_string'] = undefined; + /** + * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer + */ + exports.prototype['enum_integer'] = undefined; + /** + * @member {module:model/EnumTest.EnumNumberEnum} enum_number + */ + exports.prototype['enum_number'] = undefined; + + + /** + * Allowed values for the enum_string property. + * @enum {String} + * @readonly + */ + exports.EnumStringEnum = { + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + /** + * value: "lower" + * @const + */ + "lower": "lower" }; + /** + * Allowed values for the enum_integer property. + * @enum {Integer} + * @readonly + */ + exports.EnumIntegerEnum = { + /** + * value: 1 + * @const + */ + "1": 1, + /** + * value: -1 + * @const + */ + "-1": -1 }; + /** + * Allowed values for the enum_number property. + * @enum {Number} + * @readonly + */ + exports.EnumNumberEnum = { + /** + * value: 1.1 + * @const + */ + "1.1": 1.1, + /** + * value: -1.2 + * @const + */ + "-1.2": -1.2 }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/FormatTest.js b/samples/client/petstore/javascript/src/model/FormatTest.js index 46a9bc854fc..ed9e0cfcaf8 100644 --- a/samples/client/petstore/javascript/src/model/FormatTest.js +++ b/samples/client/petstore/javascript/src/model/FormatTest.js @@ -1,7 +1,7 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['../ApiClient'], factory); + define(['ApiClient'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient')); @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The FormatTest model module. * @module model/FormatTest @@ -26,20 +29,26 @@ * @alias module:model/FormatTest * @class * @param _number + * @param _byte + * @param _date + * @param password */ - var exports = function(_number) { + var exports = function(_number, _byte, _date, password) { + var _this = this; - this['number'] = _number; - - + _this['number'] = _number; + _this['byte'] = _byte; + + _this['date'] = _date; + _this['password'] = password; }; /** @@ -50,7 +59,7 @@ * @return {module:model/FormatTest} The populated FormatTest instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); if (data.hasOwnProperty('integer')) { @@ -84,70 +93,75 @@ obj['date'] = ApiClient.convertToType(data['date'], 'Date'); } if (data.hasOwnProperty('dateTime')) { - obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'String'); + obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); + } + if (data.hasOwnProperty('uuid')) { + obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); + } + if (data.hasOwnProperty('password')) { + obj['password'] = ApiClient.convertToType(data['password'], 'String'); } } return obj; } - /** * @member {Integer} integer */ exports.prototype['integer'] = undefined; - /** * @member {Integer} int32 */ exports.prototype['int32'] = undefined; - /** * @member {Integer} int64 */ exports.prototype['int64'] = undefined; - /** * @member {Number} number */ exports.prototype['number'] = undefined; - /** * @member {Number} float */ exports.prototype['float'] = undefined; - /** * @member {Number} double */ exports.prototype['double'] = undefined; - /** * @member {String} string */ exports.prototype['string'] = undefined; - /** * @member {String} byte */ exports.prototype['byte'] = undefined; - /** * @member {String} binary */ exports.prototype['binary'] = undefined; - /** * @member {Date} date */ exports.prototype['date'] = undefined; - /** - * @member {String} dateTime + * @member {Date} dateTime */ exports.prototype['dateTime'] = undefined; + /** + * @member {String} uuid + */ + exports.prototype['uuid'] = undefined; + /** + * @member {String} password + */ + exports.prototype['password'] = undefined; return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js index 8381185d9d0..1d83d420287 100644 --- a/samples/client/petstore/javascript/src/model/Model200Response.js +++ b/samples/client/petstore/javascript/src/model/Model200Response.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The Model200Response model module. * @module model/Model200Response @@ -28,6 +31,7 @@ * @class */ var exports = function() { + var _this = this; }; @@ -40,7 +44,7 @@ * @return {module:model/Model200Response} The populated Model200Response instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); if (data.hasOwnProperty('name')) { @@ -50,7 +54,6 @@ return obj; } - /** * @member {Integer} name */ @@ -61,3 +64,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/ModelReturn.js b/samples/client/petstore/javascript/src/model/ModelReturn.js index 9549db64d46..d0236e77b17 100644 --- a/samples/client/petstore/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript/src/model/ModelReturn.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The ModelReturn model module. * @module model/ModelReturn @@ -28,6 +31,7 @@ * @class */ var exports = function() { + var _this = this; }; @@ -40,7 +44,7 @@ * @return {module:model/ModelReturn} The populated ModelReturn instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); if (data.hasOwnProperty('return')) { @@ -50,7 +54,6 @@ return obj; } - /** * @member {Integer} return */ @@ -61,3 +64,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index 08a5a34c29a..93d1d55deb2 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The Name model module. * @module model/Name @@ -29,8 +32,10 @@ * @param name */ var exports = function(name) { + var _this = this; + + _this['name'] = name; - this['name'] = name; }; @@ -42,7 +47,7 @@ * @return {module:model/Name} The populated Name instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); if (data.hasOwnProperty('name')) { @@ -51,23 +56,30 @@ if (data.hasOwnProperty('snake_case')) { obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer'); } + if (data.hasOwnProperty('property')) { + obj['property'] = ApiClient.convertToType(data['property'], 'String'); + } } return obj; } - /** * @member {Integer} name */ exports.prototype['name'] = undefined; - /** * @member {Integer} snake_case */ exports.prototype['snake_case'] = undefined; + /** + * @member {String} property + */ + exports.prototype['property'] = undefined; return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/Order.js b/samples/client/petstore/javascript/src/model/Order.js index 664908b77a9..57f77d84ccd 100644 --- a/samples/client/petstore/javascript/src/model/Order.js +++ b/samples/client/petstore/javascript/src/model/Order.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The Order model module. * @module model/Order @@ -70,37 +73,32 @@ return obj; } - /** * @member {Integer} id */ exports.prototype['id'] = undefined; - /** * @member {Integer} petId */ exports.prototype['petId'] = undefined; - /** * @member {Integer} quantity */ exports.prototype['quantity'] = undefined; - /** * @member {Date} shipDate */ exports.prototype['shipDate'] = undefined; - /** * Order Status * @member {module:model/Order.StatusEnum} status */ exports.prototype['status'] = undefined; - /** * @member {Boolean} complete + * @default false */ - exports.prototype['complete'] = undefined; + exports.prototype['complete'] = false; /** @@ -108,25 +106,25 @@ * @enum {String} * @readonly */ - exports.StatusEnum = { + exports.StatusEnum = { /** - * value: placed + * value: "placed" * @const */ - PLACED: "placed", - + "placed": "placed", /** - * value: approved + * value: "approved" * @const */ - APPROVED: "approved", - + "approved": "approved", /** - * value: delivered + * value: "delivered" * @const */ - DELIVERED: "delivered" - }; + "delivered": "delivered" }; + return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index ae907d35ca2..fe14361dbf2 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -15,6 +15,9 @@ }(this, function(ApiClient, Category, Tag) { 'use strict'; + + + /** * The Pet model module. * @module model/Pet @@ -72,32 +75,26 @@ return obj; } - /** * @member {Integer} id */ exports.prototype['id'] = undefined; - /** * @member {module:model/Category} category */ exports.prototype['category'] = undefined; - /** * @member {String} name */ exports.prototype['name'] = undefined; - /** * @member {Array.} photoUrls */ exports.prototype['photoUrls'] = undefined; - /** * @member {Array.} tags */ exports.prototype['tags'] = undefined; - /** * pet status in the store * @member {module:model/Pet.StatusEnum} status @@ -110,25 +107,25 @@ * @enum {String} * @readonly */ - exports.StatusEnum = { + exports.StatusEnum = { /** - * value: available + * value: "available" * @const */ - AVAILABLE: "available", - + "available": "available", /** - * value: pending + * value: "pending" * @const */ - PENDING: "pending", - + "pending": "pending", /** - * value: sold + * value: "sold" * @const */ - SOLD: "sold" - }; + "sold": "sold" }; + return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js index 8694196cdd9..d5a0e992a73 100644 --- a/samples/client/petstore/javascript/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript/src/model/SpecialModelName.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The SpecialModelName model module. * @module model/SpecialModelName @@ -27,6 +30,7 @@ * @class */ var exports = function() { + var _this = this; }; @@ -39,7 +43,7 @@ * @return {module:model/SpecialModelName} The populated SpecialModelName instance. */ exports.constructFromObject = function(data, obj) { - if (data) { + if (data) { obj = obj || new exports(); if (data.hasOwnProperty('$special[property.name]')) { @@ -49,7 +53,6 @@ return obj; } - /** * @member {Integer} $special[property.name] */ @@ -60,3 +63,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js index d9ab35fb8b5..443d312b76a 100644 --- a/samples/client/petstore/javascript/src/model/Tag.js +++ b/samples/client/petstore/javascript/src/model/Tag.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The Tag model module. * @module model/Tag @@ -54,12 +57,10 @@ return obj; } - /** * @member {Integer} id */ exports.prototype['id'] = undefined; - /** * @member {String} name */ @@ -70,3 +71,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index 3bc6aaab630..2360c7c6314 100644 --- a/samples/client/petstore/javascript/src/model/User.js +++ b/samples/client/petstore/javascript/src/model/User.js @@ -15,6 +15,9 @@ }(this, function(ApiClient) { 'use strict'; + + + /** * The User model module. * @module model/User @@ -78,42 +81,34 @@ return obj; } - /** * @member {Integer} id */ exports.prototype['id'] = undefined; - /** * @member {String} username */ exports.prototype['username'] = undefined; - /** * @member {String} firstName */ exports.prototype['firstName'] = undefined; - /** * @member {String} lastName */ exports.prototype['lastName'] = undefined; - /** * @member {String} email */ exports.prototype['email'] = undefined; - /** * @member {String} password */ exports.prototype['password'] = undefined; - /** * @member {String} phone */ exports.prototype['phone'] = undefined; - /** * User Status * @member {Integer} userStatus @@ -125,3 +120,5 @@ return exports; })); + + diff --git a/samples/client/petstore/javascript/test/api/PetApiTest.js b/samples/client/petstore/javascript/test/api/PetApiTest.js index 700b30ac505..213660d8058 100644 --- a/samples/client/petstore/javascript/test/api/PetApiTest.js +++ b/samples/client/petstore/javascript/test/api/PetApiTest.js @@ -55,7 +55,7 @@ describe('PetApi', function() { it('should create and get pet', function(done) { var pet = createRandomPet(); - api.addPet({body: pet}, function(error) { + api.addPet(pet, function(error) { if (error) throw error; api.getPetById(pet.id, function(error, fetched, response) { diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index e7d9b552b04..a0db472b07f 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: 1.0.0 -- Build date: 2016-04-29T03:01:58.276Z +- Build date: 2016-04-27T17:54:12.143+08:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -117,6 +117,8 @@ Class | Method | HTTP request | Description - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [Dog](docs/Dog.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) - [FormatTest](docs/FormatTest.md) - [Model200Response](docs/Model200Response.md) - [ModelReturn](docs/ModelReturn.md) diff --git a/samples/client/petstore/php/SwaggerClient-php/composer.json b/samples/client/petstore/php/SwaggerClient-php/composer.json index 2c63b2c8ba0..3822037d750 100644 --- a/samples/client/petstore/php/SwaggerClient-php/composer.json +++ b/samples/client/petstore/php/SwaggerClient-php/composer.json @@ -1,5 +1,5 @@ { - "name": "YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID", + "name": "GIT_USER_ID/GIT_REPO_ID", "version": "1.0.0", "description": "", "keywords": [ diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md index bc47365c9e0..93c24ef7eeb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md @@ -20,7 +20,7 @@ Fake endpoint for testing various parameters require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new Swagger\Client\Api\FakeApi(); -$number = "number_example"; // string | None +$number = 3.4; // float | None $double = 1.2; // double | None $string = "string_example"; // string | None $byte = "B"; // string | None @@ -45,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **string**| None | + **number** | **float**| None | **double** | **double**| None | **string** | **string**| None | **byte** | **string**| None | diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md b/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md index e043ee8d2b8..c31305010fc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **binary** | **string** | | [optional] **date** | [**\DateTime**](Date.md) | | **date_time** | [**\DateTime**](\DateTime.md) | | [optional] +**uuid** | **string** | | [optional] **password** | **string** | | [[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/php/SwaggerClient-php/git_push.sh b/samples/client/petstore/php/SwaggerClient-php/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/php/SwaggerClient-php/git_push.sh +++ b/samples/client/petstore/php/SwaggerClient-php/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi 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 ee15a10d025..2938beaf9ce 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -95,7 +95,7 @@ class FakeApi * * Fake endpoint for testing various parameters * - * @param string $number None (required) + * @param float $number None (required) * @param double $double None (required) * @param string $string None (required) * @param string $byte None (required) @@ -122,7 +122,7 @@ class FakeApi * * Fake endpoint for testing various parameters * - * @param string $number None (required) + * @param float $number None (required) * @param double $double None (required) * @param string $string None (required) * @param string $byte None (required) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index 1154b72929c..4ab1529c7c0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -60,7 +60,7 @@ class PetApi * Constructor * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ - function __construct($apiClient = null) + function __construct(\Swagger\Client\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -84,7 +84,7 @@ class PetApi * @param \Swagger\Client\ApiClient $apiClient set the API client * @return PetApi */ - public function setApiClient(ApiClient $apiClient) + public function setApiClient(\Swagger\Client\ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index 27253a09f4f..a238eb41312 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -60,7 +60,7 @@ class StoreApi * Constructor * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ - function __construct($apiClient = null) + function __construct(\Swagger\Client\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -84,7 +84,7 @@ class StoreApi * @param \Swagger\Client\ApiClient $apiClient set the API client * @return StoreApi */ - public function setApiClient(ApiClient $apiClient) + public function setApiClient(\Swagger\Client\ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 96c9fa6fc09..ed9744b8255 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -60,7 +60,7 @@ class UserApi * Constructor * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ - function __construct($apiClient = null) + function __construct(\Swagger\Client\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -84,7 +84,7 @@ class UserApi * @param \Swagger\Client\ApiClient $apiClient set the API client * @return UserApi */ - public function setApiClient(ApiClient $apiClient) + public function setApiClient(\Swagger\Client\ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php index 65ee9d27f29..b28f2f26140 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php @@ -69,7 +69,7 @@ class ApiClient * Constructor of the class * @param Configuration $config config for this ApiClient */ - public function __construct(Configuration $config = null) + public function __construct(\Swagger\Client\Configuration $config = null) { if ($config == null) { $config = Configuration::getDefaultConfiguration(); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index 3f01e789547..12224679ac7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -59,51 +59,55 @@ class Animal implements ArrayAccess static $swaggerTypes = array( 'class_name' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'class_name' => 'className' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'class_name' => 'setClassName' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'class_name' => 'getClassName' ); - + static function getters() { return self::$getters; } + + + + /** - * $class_name - * @var string - */ + * $class_name + * @var string + */ protected $class_name; /** @@ -129,7 +133,7 @@ class Animal implements ArrayAccess { return $this->class_name; } - + /** * Sets class_name * @param string $class_name @@ -150,7 +154,7 @@ class Animal implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -160,7 +164,7 @@ class Animal implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -171,7 +175,7 @@ class Animal implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -181,7 +185,7 @@ class Animal implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index 4f467a5aab5..1e96648c7c1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -61,67 +61,71 @@ class ApiResponse implements ArrayAccess 'type' => 'string', 'message' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'code' => 'code', 'type' => 'type', 'message' => 'message' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'code' => 'setCode', 'type' => 'setType', 'message' => 'setMessage' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'code' => 'getCode', 'type' => 'getType', 'message' => 'getMessage' ); - + static function getters() { return self::$getters; } + + + + /** - * $code - * @var int - */ + * $code + * @var int + */ protected $code; /** - * $type - * @var string - */ + * $type + * @var string + */ protected $type; /** - * $message - * @var string - */ + * $message + * @var string + */ protected $message; /** @@ -146,7 +150,7 @@ class ApiResponse implements ArrayAccess { return $this->code; } - + /** * Sets code * @param int $code @@ -166,7 +170,7 @@ class ApiResponse implements ArrayAccess { return $this->type; } - + /** * Sets type * @param string $type @@ -186,7 +190,7 @@ class ApiResponse implements ArrayAccess { return $this->message; } - + /** * Sets message * @param string $message @@ -207,7 +211,7 @@ class ApiResponse implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -217,7 +221,7 @@ class ApiResponse implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -228,7 +232,7 @@ class ApiResponse implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -238,7 +242,7 @@ class ApiResponse implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index e0eaf7a106d..cf85b9fb5bc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -59,51 +59,55 @@ class Cat extends Animal implements ArrayAccess static $swaggerTypes = array( 'declawed' => 'bool' ); - + static function swaggerTypes() { return self::$swaggerTypes + parent::swaggerTypes(); } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'declawed' => 'declawed' ); - + static function attributeMap() { return parent::attributeMap() + self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'declawed' => 'setDeclawed' ); - + static function setters() { return parent::setters() + self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'declawed' => 'getDeclawed' ); - + static function getters() { return parent::getters() + self::$getters; } + + + + /** - * $declawed - * @var bool - */ + * $declawed + * @var bool + */ protected $declawed; /** @@ -126,7 +130,7 @@ class Cat extends Animal implements ArrayAccess { return $this->declawed; } - + /** * Sets declawed * @param bool $declawed @@ -147,7 +151,7 @@ class Cat extends Animal implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -157,7 +161,7 @@ class Cat extends Animal implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -168,7 +172,7 @@ class Cat extends Animal implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -178,7 +182,7 @@ class Cat extends Animal implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index fb6eed3af29..ddc52637051 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -60,59 +60,63 @@ class Category implements ArrayAccess 'id' => 'int', 'name' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'id' => 'id', 'name' => 'name' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'id' => 'setId', 'name' => 'setName' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'id' => 'getId', 'name' => 'getName' ); - + static function getters() { return self::$getters; } + + + + /** - * $id - * @var int - */ + * $id + * @var int + */ protected $id; /** - * $name - * @var string - */ + * $name + * @var string + */ protected $name; /** @@ -136,7 +140,7 @@ class Category implements ArrayAccess { return $this->id; } - + /** * Sets id * @param int $id @@ -156,7 +160,7 @@ class Category implements ArrayAccess { return $this->name; } - + /** * Sets name * @param string $name @@ -177,7 +181,7 @@ class Category implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -187,7 +191,7 @@ class Category implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -198,7 +202,7 @@ class Category implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -208,7 +212,7 @@ class Category implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index 6fd43d3a944..15b5c22e0ce 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -59,51 +59,55 @@ class Dog extends Animal implements ArrayAccess static $swaggerTypes = array( 'breed' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes + parent::swaggerTypes(); } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'breed' => 'breed' ); - + static function attributeMap() { return parent::attributeMap() + self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'breed' => 'setBreed' ); - + static function setters() { return parent::setters() + self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'breed' => 'getBreed' ); - + static function getters() { return parent::getters() + self::$getters; } + + + + /** - * $breed - * @var string - */ + * $breed + * @var string + */ protected $breed; /** @@ -126,7 +130,7 @@ class Dog extends Animal implements ArrayAccess { return $this->breed; } - + /** * Sets breed * @param string $breed @@ -147,7 +151,7 @@ class Dog extends Animal implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -157,7 +161,7 @@ class Dog extends Animal implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -168,7 +172,7 @@ class Dog extends Animal implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -178,7 +182,7 @@ class Dog extends Animal implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 7bfe30c0ef7..6888cac7cd3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -70,15 +70,15 @@ class FormatTest implements ArrayAccess 'date_time' => '\DateTime', 'password' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'integer' => 'integer', 'int32' => 'int32', @@ -93,15 +93,15 @@ class FormatTest implements ArrayAccess 'date_time' => 'dateTime', 'password' => 'password' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'integer' => 'setInteger', 'int32' => 'setInt32', @@ -116,15 +116,15 @@ class FormatTest implements ArrayAccess 'date_time' => 'setDateTime', 'password' => 'setPassword' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'integer' => 'getInteger', 'int32' => 'getInt32', @@ -139,70 +139,74 @@ class FormatTest implements ArrayAccess 'date_time' => 'getDateTime', 'password' => 'getPassword' ); - + static function getters() { return self::$getters; } + + + + /** - * $integer - * @var int - */ + * $integer + * @var int + */ protected $integer; /** - * $int32 - * @var int - */ + * $int32 + * @var int + */ protected $int32; /** - * $int64 - * @var int - */ + * $int64 + * @var int + */ protected $int64; /** - * $number - * @var float - */ + * $number + * @var float + */ protected $number; /** - * $float - * @var float - */ + * $float + * @var float + */ protected $float; /** - * $double - * @var double - */ + * $double + * @var double + */ protected $double; /** - * $string - * @var string - */ + * $string + * @var string + */ protected $string; /** - * $byte - * @var string - */ + * $byte + * @var string + */ protected $byte; /** - * $binary - * @var string - */ + * $binary + * @var string + */ protected $binary; /** - * $date - * @var \DateTime - */ + * $date + * @var \DateTime + */ protected $date; /** - * $date_time - * @var \DateTime - */ + * $date_time + * @var \DateTime + */ protected $date_time; /** - * $password - * @var string - */ + * $password + * @var string + */ protected $password; /** @@ -236,7 +240,7 @@ class FormatTest implements ArrayAccess { return $this->integer; } - + /** * Sets integer * @param int $integer @@ -256,7 +260,7 @@ class FormatTest implements ArrayAccess { return $this->int32; } - + /** * Sets int32 * @param int $int32 @@ -276,7 +280,7 @@ class FormatTest implements ArrayAccess { return $this->int64; } - + /** * Sets int64 * @param int $int64 @@ -296,7 +300,7 @@ class FormatTest implements ArrayAccess { return $this->number; } - + /** * Sets number * @param float $number @@ -316,7 +320,7 @@ class FormatTest implements ArrayAccess { return $this->float; } - + /** * Sets float * @param float $float @@ -336,7 +340,7 @@ class FormatTest implements ArrayAccess { return $this->double; } - + /** * Sets double * @param double $double @@ -356,7 +360,7 @@ class FormatTest implements ArrayAccess { return $this->string; } - + /** * Sets string * @param string $string @@ -376,7 +380,7 @@ class FormatTest implements ArrayAccess { return $this->byte; } - + /** * Sets byte * @param string $byte @@ -396,7 +400,7 @@ class FormatTest implements ArrayAccess { return $this->binary; } - + /** * Sets binary * @param string $binary @@ -416,7 +420,7 @@ class FormatTest implements ArrayAccess { return $this->date; } - + /** * Sets date * @param \DateTime $date @@ -436,7 +440,7 @@ class FormatTest implements ArrayAccess { return $this->date_time; } - + /** * Sets date_time * @param \DateTime $date_time @@ -456,7 +460,7 @@ class FormatTest implements ArrayAccess { return $this->password; } - + /** * Sets password * @param string $password @@ -477,7 +481,7 @@ class FormatTest implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -487,7 +491,7 @@ class FormatTest implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -498,7 +502,7 @@ class FormatTest implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -508,7 +512,7 @@ class FormatTest implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php index 3bd2106ba0e..d66a078a4e0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php @@ -47,15 +47,9 @@ use \ArrayAccess; class InlineResponse200 implements ArrayAccess { /** - * The original name of the model. - * @var string - */ - static $swaggerModelName = 'inline_response_200'; - - /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'tags' => '\Swagger\Client\Model\Tag[]', 'id' => 'int', @@ -64,15 +58,15 @@ class InlineResponse200 implements ArrayAccess 'name' => 'string', 'photo_urls' => 'string[]' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'tags' => 'tags', 'id' => 'id', @@ -81,15 +75,15 @@ class InlineResponse200 implements ArrayAccess 'name' => 'name', 'photo_urls' => 'photoUrls' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'tags' => 'setTags', 'id' => 'setId', @@ -98,15 +92,15 @@ class InlineResponse200 implements ArrayAccess 'name' => 'setName', 'photo_urls' => 'setPhotoUrls' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'tags' => 'getTags', 'id' => 'getId', @@ -115,41 +109,67 @@ class InlineResponse200 implements ArrayAccess 'name' => 'getName', 'photo_urls' => 'getPhotoUrls' ); - + static function getters() { return self::$getters; } + const STATUS_AVAILABLE = 'available'; + const STATUS_PENDING = 'pending'; + const STATUS_SOLD = 'sold'; + + + /** - * $tags - * @var \Swagger\Client\Model\Tag[] - */ + * Gets allowable values of the enum + * @return string[] + */ + public function getStatusAllowableValues() { + return [ + self::STATUS_AVAILABLE, + self::STATUS_PENDING, + self::STATUS_SOLD, + ]; + } + + + + /** + * $tags + * @var \Swagger\Client\Model\Tag[] + */ protected $tags; + /** - * $id - * @var int - */ + * $id + * @var int + */ protected $id; + /** - * $category - * @var object - */ + * $category + * @var object + */ protected $category; + /** - * $status pet status in the store - * @var string - */ + * $status pet status in the store + * @var string + */ protected $status; + /** - * $name - * @var string - */ + * $name + * @var string + */ protected $name; + /** - * $photo_urls - * @var string[] - */ + * $photo_urls + * @var string[] + */ protected $photo_urls; + /** * Constructor @@ -158,7 +178,6 @@ class InlineResponse200 implements ArrayAccess public function __construct(array $data = null) { - if ($data != null) { $this->tags = $data["tags"]; $this->id = $data["id"]; @@ -168,17 +187,18 @@ class InlineResponse200 implements ArrayAccess $this->photo_urls = $data["photo_urls"]; } } + /** - * Gets tags + * Gets tags. * @return \Swagger\Client\Model\Tag[] */ public function getTags() { return $this->tags; } - + /** - * Sets tags + * Sets tags. * @param \Swagger\Client\Model\Tag[] $tags * @return $this */ @@ -188,17 +208,18 @@ class InlineResponse200 implements ArrayAccess $this->tags = $tags; return $this; } + /** - * Gets id + * Gets id. * @return int */ public function getId() { return $this->id; } - + /** - * Sets id + * Sets id. * @param int $id * @return $this */ @@ -208,17 +229,18 @@ class InlineResponse200 implements ArrayAccess $this->id = $id; return $this; } + /** - * Gets category + * Gets category. * @return object */ public function getCategory() { return $this->category; } - + /** - * Sets category + * Sets category. * @param object $category * @return $this */ @@ -228,17 +250,18 @@ class InlineResponse200 implements ArrayAccess $this->category = $category; return $this; } + /** - * Gets status + * Gets status. * @return string */ public function getStatus() { return $this->status; } - + /** - * Sets status + * Sets status. * @param string $status pet status in the store * @return $this */ @@ -251,17 +274,18 @@ class InlineResponse200 implements ArrayAccess $this->status = $status; return $this; } + /** - * Gets name + * Gets name. * @return string */ public function getName() { return $this->name; } - + /** - * Sets name + * Sets name. * @param string $name * @return $this */ @@ -271,17 +295,18 @@ class InlineResponse200 implements ArrayAccess $this->name = $name; return $this; } + /** - * Gets photo_urls + * Gets photo_urls. * @return string[] */ public function getPhotoUrls() { return $this->photo_urls; } - + /** - * Sets photo_urls + * Sets photo_urls. * @param string[] $photo_urls * @return $this */ @@ -291,6 +316,7 @@ class InlineResponse200 implements ArrayAccess $this->photo_urls = $photo_urls; return $this; } + /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -300,7 +326,7 @@ class InlineResponse200 implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -310,7 +336,7 @@ class InlineResponse200 implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -321,7 +347,7 @@ class InlineResponse200 implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -331,17 +357,19 @@ class InlineResponse200 implements ArrayAccess { unset($this->$offset); } - + /** - * Gets the string presentation of the object + * Gets the string presentation of the object. * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + if (defined('JSON_PRETTY_PRINT')) { return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } else { + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } - - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } + +?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index 8d62f9531ec..fd305916a2d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -59,51 +59,55 @@ class Model200Response implements ArrayAccess static $swaggerTypes = array( 'name' => 'int' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'name' => 'name' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'name' => 'setName' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'name' => 'getName' ); - + static function getters() { return self::$getters; } + + + + /** - * $name - * @var int - */ + * $name + * @var int + */ protected $name; /** @@ -126,7 +130,7 @@ class Model200Response implements ArrayAccess { return $this->name; } - + /** * Sets name * @param int $name @@ -147,7 +151,7 @@ class Model200Response implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -157,7 +161,7 @@ class Model200Response implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -168,7 +172,7 @@ class Model200Response implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -178,7 +182,7 @@ class Model200Response implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index d4660e118fd..a7e36a14365 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -59,51 +59,55 @@ class ModelReturn implements ArrayAccess static $swaggerTypes = array( 'return' => 'int' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'return' => 'return' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'return' => 'setReturn' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'return' => 'getReturn' ); - + static function getters() { return self::$getters; } + + + + /** - * $return - * @var int - */ + * $return + * @var int + */ protected $return; /** @@ -126,7 +130,7 @@ class ModelReturn implements ArrayAccess { return $this->return; } - + /** * Sets return * @param int $return @@ -147,7 +151,7 @@ class ModelReturn implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -157,7 +161,7 @@ class ModelReturn implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -168,7 +172,7 @@ class ModelReturn implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -178,7 +182,7 @@ class ModelReturn implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index 9e1c4b92762..ff62e4f1c25 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -61,67 +61,71 @@ class Name implements ArrayAccess 'snake_case' => 'int', 'property' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'name' => 'name', 'snake_case' => 'snake_case', 'property' => 'property' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'name' => 'setName', 'snake_case' => 'setSnakeCase', 'property' => 'setProperty' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'name' => 'getName', 'snake_case' => 'getSnakeCase', 'property' => 'getProperty' ); - + static function getters() { return self::$getters; } + + + + /** - * $name - * @var int - */ + * $name + * @var int + */ protected $name; /** - * $snake_case - * @var int - */ + * $snake_case + * @var int + */ protected $snake_case; /** - * $property - * @var string - */ + * $property + * @var string + */ protected $property; /** @@ -146,7 +150,7 @@ class Name implements ArrayAccess { return $this->name; } - + /** * Sets name * @param int $name @@ -166,7 +170,7 @@ class Name implements ArrayAccess { return $this->snake_case; } - + /** * Sets snake_case * @param int $snake_case @@ -186,7 +190,7 @@ class Name implements ArrayAccess { return $this->property; } - + /** * Sets property * @param string $property @@ -207,7 +211,7 @@ class Name implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -217,7 +221,7 @@ class Name implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -228,7 +232,7 @@ class Name implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -238,7 +242,7 @@ class Name implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 7ee5c124d2c..270a53a41e7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -64,15 +64,15 @@ class Order implements ArrayAccess 'status' => 'string', 'complete' => 'bool' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'id' => 'id', 'pet_id' => 'petId', @@ -81,15 +81,15 @@ class Order implements ArrayAccess 'status' => 'status', 'complete' => 'complete' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'id' => 'setId', 'pet_id' => 'setPetId', @@ -98,15 +98,15 @@ class Order implements ArrayAccess 'status' => 'setStatus', 'complete' => 'setComplete' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'id' => 'getId', 'pet_id' => 'getPetId', @@ -115,40 +115,59 @@ class Order implements ArrayAccess 'status' => 'getStatus', 'complete' => 'getComplete' ); - + static function getters() { return self::$getters; } + const STATUS_PLACED = 'placed'; + const STATUS_APPROVED = 'approved'; + const STATUS_DELIVERED = 'delivered'; + + + /** - * $id - * @var int - */ + * Gets allowable values of the enum + * @return string[] + */ + public function getStatusAllowableValues() { + return [ + self::STATUS_PLACED, + self::STATUS_APPROVED, + self::STATUS_DELIVERED, + ]; + } + + + /** + * $id + * @var int + */ protected $id; /** - * $pet_id - * @var int - */ + * $pet_id + * @var int + */ protected $pet_id; /** - * $quantity - * @var int - */ + * $quantity + * @var int + */ protected $quantity; /** - * $ship_date - * @var \DateTime - */ + * $ship_date + * @var \DateTime + */ protected $ship_date; /** - * $status Order Status - * @var string - */ + * $status Order Status + * @var string + */ protected $status; /** - * $complete - * @var bool - */ + * $complete + * @var bool + */ protected $complete = false; /** @@ -176,7 +195,7 @@ class Order implements ArrayAccess { return $this->id; } - + /** * Sets id * @param int $id @@ -196,7 +215,7 @@ class Order implements ArrayAccess { return $this->pet_id; } - + /** * Sets pet_id * @param int $pet_id @@ -216,7 +235,7 @@ class Order implements ArrayAccess { return $this->quantity; } - + /** * Sets quantity * @param int $quantity @@ -236,7 +255,7 @@ class Order implements ArrayAccess { return $this->ship_date; } - + /** * Sets ship_date * @param \DateTime $ship_date @@ -256,7 +275,7 @@ class Order implements ArrayAccess { return $this->status; } - + /** * Sets status * @param string $status Order Status @@ -279,7 +298,7 @@ class Order implements ArrayAccess { return $this->complete; } - + /** * Sets complete * @param bool $complete @@ -300,7 +319,7 @@ class Order implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -310,7 +329,7 @@ class Order implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -321,7 +340,7 @@ class Order implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -331,7 +350,7 @@ class Order implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 3a9e46cd3fb..ce1d7a63944 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -64,15 +64,15 @@ class Pet implements ArrayAccess 'tags' => '\Swagger\Client\Model\Tag[]', 'status' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'id' => 'id', 'category' => 'category', @@ -81,15 +81,15 @@ class Pet implements ArrayAccess 'tags' => 'tags', 'status' => 'status' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'id' => 'setId', 'category' => 'setCategory', @@ -98,15 +98,15 @@ class Pet implements ArrayAccess 'tags' => 'setTags', 'status' => 'setStatus' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'id' => 'getId', 'category' => 'getCategory', @@ -115,40 +115,59 @@ class Pet implements ArrayAccess 'tags' => 'getTags', 'status' => 'getStatus' ); - + static function getters() { return self::$getters; } + const STATUS_AVAILABLE = 'available'; + const STATUS_PENDING = 'pending'; + const STATUS_SOLD = 'sold'; + + + /** - * $id - * @var int - */ + * Gets allowable values of the enum + * @return string[] + */ + public function getStatusAllowableValues() { + return [ + self::STATUS_AVAILABLE, + self::STATUS_PENDING, + self::STATUS_SOLD, + ]; + } + + + /** + * $id + * @var int + */ protected $id; /** - * $category - * @var \Swagger\Client\Model\Category - */ + * $category + * @var \Swagger\Client\Model\Category + */ protected $category; /** - * $name - * @var string - */ + * $name + * @var string + */ protected $name; /** - * $photo_urls - * @var string[] - */ + * $photo_urls + * @var string[] + */ protected $photo_urls; /** - * $tags - * @var \Swagger\Client\Model\Tag[] - */ + * $tags + * @var \Swagger\Client\Model\Tag[] + */ protected $tags; /** - * $status pet status in the store - * @var string - */ + * $status pet status in the store + * @var string + */ protected $status; /** @@ -176,7 +195,7 @@ class Pet implements ArrayAccess { return $this->id; } - + /** * Sets id * @param int $id @@ -196,7 +215,7 @@ class Pet implements ArrayAccess { return $this->category; } - + /** * Sets category * @param \Swagger\Client\Model\Category $category @@ -216,7 +235,7 @@ class Pet implements ArrayAccess { return $this->name; } - + /** * Sets name * @param string $name @@ -236,7 +255,7 @@ class Pet implements ArrayAccess { return $this->photo_urls; } - + /** * Sets photo_urls * @param string[] $photo_urls @@ -256,7 +275,7 @@ class Pet implements ArrayAccess { return $this->tags; } - + /** * Sets tags * @param \Swagger\Client\Model\Tag[] $tags @@ -276,7 +295,7 @@ class Pet implements ArrayAccess { return $this->status; } - + /** * Sets status * @param string $status pet status in the store @@ -300,7 +319,7 @@ class Pet implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -310,7 +329,7 @@ class Pet implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -321,7 +340,7 @@ class Pet implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -331,7 +350,7 @@ class Pet implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index fb748811cf2..e2cb5b6e90f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -59,51 +59,55 @@ class SpecialModelName implements ArrayAccess static $swaggerTypes = array( 'special_property_name' => 'int' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'special_property_name' => '$special[property.name]' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'special_property_name' => 'setSpecialPropertyName' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'special_property_name' => 'getSpecialPropertyName' ); - + static function getters() { return self::$getters; } + + + + /** - * $special_property_name - * @var int - */ + * $special_property_name + * @var int + */ protected $special_property_name; /** @@ -126,7 +130,7 @@ class SpecialModelName implements ArrayAccess { return $this->special_property_name; } - + /** * Sets special_property_name * @param int $special_property_name @@ -147,7 +151,7 @@ class SpecialModelName implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -157,7 +161,7 @@ class SpecialModelName implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -168,7 +172,7 @@ class SpecialModelName implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -178,7 +182,7 @@ class SpecialModelName implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index 4bb56401c48..159c531b8b2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -60,59 +60,63 @@ class Tag implements ArrayAccess 'id' => 'int', 'name' => 'string' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'id' => 'id', 'name' => 'name' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'id' => 'setId', 'name' => 'setName' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'id' => 'getId', 'name' => 'getName' ); - + static function getters() { return self::$getters; } + + + + /** - * $id - * @var int - */ + * $id + * @var int + */ protected $id; /** - * $name - * @var string - */ + * $name + * @var string + */ protected $name; /** @@ -136,7 +140,7 @@ class Tag implements ArrayAccess { return $this->id; } - + /** * Sets id * @param int $id @@ -156,7 +160,7 @@ class Tag implements ArrayAccess { return $this->name; } - + /** * Sets name * @param string $name @@ -177,7 +181,7 @@ class Tag implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -187,7 +191,7 @@ class Tag implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -198,7 +202,7 @@ class Tag implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -208,7 +212,7 @@ class Tag implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index da9cc20ff4c..2d624103218 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -66,15 +66,15 @@ class User implements ArrayAccess 'phone' => 'string', 'user_status' => 'int' ); - + static function swaggerTypes() { return self::$swaggerTypes; } /** - * Array of attributes where the key is the local name, and the value is the original name - * @var string[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'id' => 'id', 'username' => 'username', @@ -85,15 +85,15 @@ class User implements ArrayAccess 'phone' => 'phone', 'user_status' => 'userStatus' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'id' => 'setId', 'username' => 'setUsername', @@ -104,15 +104,15 @@ class User implements ArrayAccess 'phone' => 'setPhone', 'user_status' => 'setUserStatus' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'id' => 'getId', 'username' => 'getUsername', @@ -123,50 +123,54 @@ class User implements ArrayAccess 'phone' => 'getPhone', 'user_status' => 'getUserStatus' ); - + static function getters() { return self::$getters; } + + + + /** - * $id - * @var int - */ + * $id + * @var int + */ protected $id; /** - * $username - * @var string - */ + * $username + * @var string + */ protected $username; /** - * $first_name - * @var string - */ + * $first_name + * @var string + */ protected $first_name; /** - * $last_name - * @var string - */ + * $last_name + * @var string + */ protected $last_name; /** - * $email - * @var string - */ + * $email + * @var string + */ protected $email; /** - * $password - * @var string - */ + * $password + * @var string + */ protected $password; /** - * $phone - * @var string - */ + * $phone + * @var string + */ protected $phone; /** - * $user_status User Status - * @var int - */ + * $user_status User Status + * @var int + */ protected $user_status; /** @@ -196,7 +200,7 @@ class User implements ArrayAccess { return $this->id; } - + /** * Sets id * @param int $id @@ -216,7 +220,7 @@ class User implements ArrayAccess { return $this->username; } - + /** * Sets username * @param string $username @@ -236,7 +240,7 @@ class User implements ArrayAccess { return $this->first_name; } - + /** * Sets first_name * @param string $first_name @@ -256,7 +260,7 @@ class User implements ArrayAccess { return $this->last_name; } - + /** * Sets last_name * @param string $last_name @@ -276,7 +280,7 @@ class User implements ArrayAccess { return $this->email; } - + /** * Sets email * @param string $email @@ -296,7 +300,7 @@ class User implements ArrayAccess { return $this->password; } - + /** * Sets password * @param string $password @@ -316,7 +320,7 @@ class User implements ArrayAccess { return $this->phone; } - + /** * Sets phone * @param string $phone @@ -336,7 +340,7 @@ class User implements ArrayAccess { return $this->user_status; } - + /** * Sets user_status * @param int $user_status User Status @@ -357,7 +361,7 @@ class User implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -367,7 +371,7 @@ class User implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -378,7 +382,7 @@ class User implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -388,7 +392,7 @@ class User implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php index 51b82a695d6..8ef5a8e5058 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php @@ -12,6 +12,13 @@ class OrderApiTest extends \PHPUnit_Framework_TestCase //error_reporting(~0); } + // test get inventory + public function testOrderEnum() + { + $this->assertSame(Swagger\Client\Model\Order::STATUS_PLACED, "placed"); + $this->assertSame(Swagger\Client\Model\Order::STATUS_APPROVED, "approved"); + } + // test get inventory public function testOrder() { diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index da8816ec711..62b0d52dc7b 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-04-29T11:03:36.514+08:00 +- Build date: 2016-05-02T21:47:16.723+08:00 - Build package: class io.swagger.codegen.languages.RubyClientCodegen ## Installation @@ -36,9 +36,9 @@ Finally add this to the Gemfile: ### Install from Git -If the Ruby gem is hosted at a git repository: https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID, then add the following in the Gemfile: +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - gem 'petstore', :git => 'https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git' + gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ### Include the Ruby code directly diff --git a/samples/client/petstore/ruby/docs/200Response.md b/samples/client/petstore/ruby/docs/200Response.md new file mode 100644 index 00000000000..2e0f1ec92f3 --- /dev/null +++ b/samples/client/petstore/ruby/docs/200Response.md @@ -0,0 +1,8 @@ +# Petstore::200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] + + diff --git a/samples/client/petstore/ruby/docs/FormatTest.md b/samples/client/petstore/ruby/docs/FormatTest.md index 014f2431f12..79cf9b5a866 100644 --- a/samples/client/petstore/ruby/docs/FormatTest.md +++ b/samples/client/petstore/ruby/docs/FormatTest.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **binary** | **String** | | [optional] **date** | **Date** | | **date_time** | **DateTime** | | [optional] -**uuid** | [**UUID**](UUID.md) | | [optional] +**uuid** | **String** | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/ruby/git_push.sh b/samples/client/petstore/ruby/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/ruby/git_push.sh +++ b/samples/client/petstore/ruby/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi 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 807a8f4d605..946e0001555 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -77,7 +77,7 @@ module Petstore :'binary' => :'String', :'date' => :'Date', :'date_time' => :'DateTime', - :'uuid' => :'UUID', + :'uuid' => :'String', :'password' => :'String' } end diff --git a/samples/client/petstore/ruby/spec/api/store_api_spec.rb b/samples/client/petstore/ruby/spec/api/store_api_spec.rb index 479891e9308..015d1d8e39d 100644 --- a/samples/client/petstore/ruby/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/store_api_spec.rb @@ -69,7 +69,7 @@ describe 'StoreApi' do # unit tests for get_order_by_id # Find purchase order by ID - # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # @param order_id ID of pet that needs to be fetched # @param [Hash] opts the optional parameters # @return [Order] diff --git a/samples/client/petstore/ruby/spec/api/user_api_spec.rb b/samples/client/petstore/ruby/spec/api/user_api_spec.rb index 4564491d507..272980a6db0 100644 --- a/samples/client/petstore/ruby/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/user_api_spec.rb @@ -103,7 +103,7 @@ describe 'UserApi' do # unit tests for get_user_by_name # Get user by user name # - # @param username The name that needs to be fetched. Use user1 for testing. + # @param username The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters # @return [User] describe 'get_user_by_name test' do diff --git a/samples/client/petstore/ruby/spec/models/dog_spec.rb b/samples/client/petstore/ruby/spec/models/dog_spec.rb index 20375338c7e..b319d72b80a 100644 --- a/samples/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby/spec/models/dog_spec.rb @@ -36,7 +36,7 @@ describe 'Dog' do @instance.should be_a(Petstore::Dog) end end - describe 'test attribute "class_name"' do + describe 'test attribute "breed"' do it 'should work' do # assertion here # should be_a() @@ -46,7 +46,7 @@ describe 'Dog' do end end - describe 'test attribute "breed"' do + describe 'test attribute "class_name"' do it 'should work' do # assertion here # should be_a() diff --git a/samples/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/client/petstore/ruby/spec/models/format_test_spec.rb index e44131192a3..50b2980d17b 100644 --- a/samples/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/format_test_spec.rb @@ -146,6 +146,16 @@ describe 'FormatTest' do end end + describe 'test attribute "uuid"' do + it 'should work' do + # assertion here + # should be_a() + # should be_nil + # should == + # should_not == + end + end + describe 'test attribute "password"' do it 'should work' do # assertion here diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift index f9e2f72b908..0aa3b3e381c 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift @@ -156,7 +156,7 @@ class Decoders { instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Order.ST(rawValue: (sourceDictionary["status"] as? String) ?? "") instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) return instance } @@ -175,7 +175,7 @@ class Decoders { instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Pet.ST(rawValue: (sourceDictionary["status"] as? String) ?? "") return instance } diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Category.swift index 19f31d266ef..89ce2ccb616 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Category.swift @@ -18,7 +18,6 @@ public class Category: JSONEncodable { func encodeToJSON() -> AnyObject { var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Order.swift index 4374d95ed47..e4086143266 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Order.swift @@ -9,7 +9,7 @@ import Foundation public class Order: JSONEncodable { - public enum Status: String { + public enum ST: String { case Placed = "placed" case Approved = "approved" case Delivered = "delivered" @@ -19,7 +19,7 @@ public class Order: JSONEncodable { public var quantity: Int32? public var shipDate: NSDate? /** Order Status */ - public var status: Status? + public var status: ST? public var complete: Bool? public init() {} @@ -28,8 +28,6 @@ public class Order: JSONEncodable { func encodeToJSON() -> AnyObject { var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["quantity"] = self.quantity?.encodeToJSON() nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Pet.swift index 8a467a5bf0b..ee9aa295a53 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Pet.swift @@ -9,7 +9,7 @@ import Foundation public class Pet: JSONEncodable { - public enum Status: String { + public enum ST: String { case Available = "available" case Pending = "pending" case Sold = "sold" @@ -20,7 +20,7 @@ public class Pet: JSONEncodable { public var photoUrls: [String]? public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: ST? public init() {} @@ -28,7 +28,6 @@ public class Pet: JSONEncodable { func encodeToJSON() -> AnyObject { var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["category"] = self.category?.encodeToJSON() nillableDictionary["name"] = self.name nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Tag.swift index a3916f59b13..774f91557e6 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Tag.swift @@ -18,7 +18,6 @@ public class Tag: JSONEncodable { func encodeToJSON() -> AnyObject { var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/User.swift index 26e9c619927..67b72a61922 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/User.swift @@ -25,7 +25,6 @@ public class User: JSONEncodable { func encodeToJSON() -> AnyObject { var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["username"] = self.username nillableDictionary["firstName"] = self.firstName nillableDictionary["lastName"] = self.lastName diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index fe35821d6e0..da35c633e44 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -7,113 +7,103 @@ objects = { /* Begin PBXBuildFile section */ + 01BD61BBC475EB3369237B84FE24D3EE /* UIViewController+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BA017E288BB42E06EBEE9C6E6993EAF /* UIViewController+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0268F9278E32ACC1F996F4E2E45622B5 /* UIActionSheet+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6846D22C9F0CCBC48DF833E309A8E84F /* UIActionSheet+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; 03F494989CC1A8857B68A317D5D6860F /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF5FC3AF99846209C5FCE55A2E12D9A /* Response.swift */; }; 0681ADC8BAE2C3185F13487BAAB4D9DD /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCE38472832BBCC541E646DA6C18EF9C /* Upload.swift */; }; - 0B0F79070CD75DE3CF053E58B491A3AC /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD05F019D163F2D5FE7C8E64C1D2E299 /* UserAPI.swift */; }; + 06F7C0C55DF4C09C015159F6B0802EB1 /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84319E048FE6DD89B905FA3A81005C5F /* join.swift */; }; 0B34EB4425C08BB021C2D09F75C9C146 /* OMGHTTPURLRQ.h in Headers */ = {isa = PBXBuildFile; fileRef = 450166FEA2155A5821D97744A0127DF8 /* OMGHTTPURLRQ.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0BB1E79782E3BE258C30A65A20C85FC1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC4BF94DC4B3D8B88FC160B00931B0EC /* QuartzCore.framework */; }; - 10E93502CF9CED0B6341DB95B658F2F9 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C24509ECAD94A91B30D87D8B2DEEB9B /* Model200Response.swift */; }; - 14FD108A5B931460A799BDCB874A99C3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED58811444E6D32A1F7B372F034DB7A /* SpecialModelName.swift */; }; - 1A4D55F76DCB3489302BC425F4DB1C04 /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 143BC30E5DDAF52A3D9578F507EC6A41 /* when.m */; }; - 1DB7E23C2A2A8D4B5CE046135E4540C6 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BFFA6FD621E9ED341AA89AEAC1604D7 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2308448E8874D3DAA33A1AEFEFCFBA2D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BAE461B3A62164A09480E8967D29E64 /* Extensions.swift */; }; + 0BDA43D8F48C8B0D504C440046FAF681 /* Umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A8906F6D6920DF197965D1740A7E283 /* Umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0D240D796AAD10F0119A1D7AC2570AAA /* NSObject+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6EB54C331FED437583A5F01EB2757D1 /* NSObject+Promise.swift */; }; + 11C221075C5B20BDEEB3DDF8EAC99E63 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 4798BAC01B0E3F07E3BBBB07BA57F2D7 /* NSNotificationCenter+AnyPromise.m */; }; + 11EA8D6B0352FD31F520F983CFB9D993 /* UIAlertView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = F075F63EFE77F7B59FF77CBA95B9AADF /* UIAlertView+AnyPromise.m */; }; + 12348513CB81BD05B497C210905CDF65 /* UIAlertView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 92D340D66F03F31237B70F23FE9B00D0 /* UIAlertView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 124EFF5E3C46EC88F47C52479FA6ACAF /* CALayer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A22F2595054D39018E03961CA7283A /* CALayer+AnyPromise.m */; }; + 1287903F965945AEB5EFC4EE768C7B38 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC4BF94DC4B3D8B88FC160B00931B0EC /* QuartzCore.framework */; }; + 15ECEBA1EFBD023AEA47F36524270D2C /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0266C5AE0B23A436291F6647902086 /* Models.swift */; }; + 18FAC6B4FD3B44CB353C7A6027286100 /* NSURLConnection+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = BAE48ACA10E8895BB8BF5CE8C0846B4B /* NSURLConnection+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1AC7E88F0EC64D1D4E83CE7767BFD2B7 /* afterlife.swift in Sources */ = {isa = PBXBuildFile; fileRef = C476B916B763E55E4161F0B30760C4E8 /* afterlife.swift */; }; + 1CDA074C6DC95876D85E13ECF882B93A /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */; }; + 1E1010EA437F154A554D04F7F3A894EC /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E0DBDE561A6C2E7AC7A24160F8A5F28 /* Promise+Properties.swift */; }; + 25FBB92AFB8F5A777CE8E40EC3B9DACA /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; + 2B38BB4603B4286FF8D7A780372E947F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */; }; 2C5450AC69398958CF6F7539EF7D99E5 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 30CE7341A995EF6812D71771E74CF7F7 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2DF2D3E610EB6F19375570C0EBA9E77F /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = B868468092D7B2489B889A50981C9247 /* after.m */; }; - 30F9F020F5B35577080063E71CDAB08C /* OMGHTTPURLRQ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */; }; - 33326318BF830A838DA62D54ADAA5ECA /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D172F6D749B7735D04B495330AB7FE3 /* Cat.swift */; }; + 2D9379807BA243E1CE457D1BE963DA09 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */; }; 35F6B35131F89EA23246C6508199FB05 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB15A61DB7ABCB74565286162157C5A0 /* Foundation.framework */; }; - 38FE2977C973FA258977E86E1E964E02 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5973BC143AE488C12FFB1E83E71F0C45 /* AnyPromise.swift */; }; - 39E7AFE23097B4BC393D43A44093FB63 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB15A61DB7ABCB74565286162157C5A0 /* Foundation.framework */; }; + 3860D960E37C1257BDA54626CA592E86 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F19945EE403F7B29D8B1939EA6D579A /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 387C7387FDC662D23D743879B6143D59 /* UIActionSheet+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD570E28B63274E742E7D1FBBD55BB41 /* UIActionSheet+Promise.swift */; }; 3A8D316D4266A3309D0A98ED74F8A13A /* OMGUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 87BC7910B8D7D31310A07C32438A8C67 /* OMGUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 41C531C4CEDCAE196A6F92FEAE66CCF3 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7FF1C1E487B6795C5F6734CCA49DF3 /* StoreAPI.swift */; }; - 445F515F4FAB3537878E1377562BBBA7 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 4798BAC01B0E3F07E3BBBB07BA57F2D7 /* NSNotificationCenter+AnyPromise.m */; }; - 4827FED90242878355B47A6D34BAABCA /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 323E5DCC342B03D7AE59F37523D2626A /* APIs.swift */; }; + 443361437B359830308B93A7B98BE039 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */; }; + 46F838880F41F56ABD91796FC956B4BF /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */; }; 48CB8E7E16443CA771E4DCFB3E0709A2 /* OMGHTTPURLRQ.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D579267FC1F163C8F04B444DAEFED0D /* OMGHTTPURLRQ.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 4C22563311AC2B52651A6525A979E076 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F0F4EDC2236E1C270DC2014181D6506 /* UIView+AnyPromise.m */; }; 4DE5FCC41D100B113B6645EA64410F16 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FBD351D007CF4095C98C9DFD9D83D61 /* ParameterEncoding.swift */; }; - 4E07AC40078EBB1C88ED8700859F5A1B /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E506C8F40F5AD602D83B383EAA7C0CD /* APIHelper.swift */; }; + 516D41E4D035A817CC5116C11302E408 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */; }; 5192A7466019F9B3D7F1E987124E96BC /* OMGHTTPURLRQ-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBDD2EEED520E06ACB3538B3832049 /* OMGHTTPURLRQ-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 523C1819FC864864A9715CF713DD12E9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB15A61DB7ABCB74565286162157C5A0 /* Foundation.framework */; }; 5480169E42C456C49BE59E273D7E0115 /* OMGFormURLEncode.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ADA0B6B6B00CB0E818AA8CBC311677 /* OMGFormURLEncode.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5E46AC6FA35723E095C2EB6ED23C0510 /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9042667D08D783E45394FE8B97EE6468 /* PromiseKit-dummy.m */; }; - 5EECE3F98893B2D4E03DC027C57C21F3 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A60B64E388679F589CB959AA5FC4787 /* Models.swift */; }; - 5FDCAFE73B791C4A4B863C9D65F6CF7B /* UIAlertView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA854180C132DB5511D64C82535C5FDE /* UIAlertView+Promise.swift */; }; - 623677B20997F5EC0F6CA695CADD410B /* ObjectReturn.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3CC2D1A2A451C0A3C4DBD6D7E117C01 /* ObjectReturn.swift */; }; - 63AF5DF795F5D610768B4AF53C7E9976 /* UIActionSheet+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6846D22C9F0CCBC48DF833E309A8E84F /* UIActionSheet+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 655C3826275A76D04835F2336AC87A91 /* UIAlertView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = F075F63EFE77F7B59FF77CBA95B9AADF /* UIAlertView+AnyPromise.m */; }; - 660435DF96CE68B3A3E078030C5F54FA /* UIView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3CDA0958D6247505ECD9098D662EA74 /* UIView+Promise.swift */; }; - 66B8591A8CCC9760D933506B71A13962 /* UIViewController+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BA017E288BB42E06EBEE9C6E6993EAF /* UIViewController+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5D7EAE5725A7E750B51FD27AECB5F0FD /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AD59903FAA8315AD0036AC459FFB97F /* join.m */; }; + 5EE5E1CA27F3CB04A5DCF5BB90B76000 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */; }; + 5FFED823C0BDD412FA41B01EA47394D1 /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = F4B6A98D6DAF474045210F5A74FF1C3C /* hang.m */; }; + 60EBBACB76CD5879FB7B9B3E0AA5E2C1 /* UIViewController+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = AA24C5EC82CF437D8D1FFFAB68975408 /* UIViewController+AnyPromise.m */; }; + 656BED6137A9FFA3B2DF03861F525022 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6A128FE350973D8A693E3F063C5E4A49 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = A92242715FB4C0608F8DCEBF8F3791E2 /* dispatch_promise.m */; }; + 6B0A17CD24331793D2504E0FBBAF5EB2 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */; }; 6CB84A616D7B4D189A4E94BD37621575 /* OMGUserAgent.m in Sources */ = {isa = PBXBuildFile; fileRef = E11BFB27B43B742CB5D6086C4233A909 /* OMGUserAgent.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 6D264CCBD7DAC0A530076FB1A847EEC7 /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */; }; 6F63943B0E954F701F32BC7A1F4C2FEC /* OMGFormURLEncode.m in Sources */ = {isa = PBXBuildFile; fileRef = 25614E715DDC170DAFB0DF50C5503E33 /* OMGFormURLEncode.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 7120EA2BF0D3942FF9CE0EDABBF86BA1 /* NSURLConnection+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412985229DA7A4DF9E129B7E8F0C09BB /* NSURLConnection+Promise.swift */; }; - 72B2C8A6E81C1E99E6093BE3BDBDE554 /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84319E048FE6DD89B905FA3A81005C5F /* join.swift */; }; - 752EACD07B4F948C1F24E0583C5DA165 /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 3616971BAEF40302B7F2F8B1007C0B2B /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7BCBC4FD2E385CAFC5F3949FFFFE2095 /* NSError+Cancellation.h in Headers */ = {isa = PBXBuildFile; fileRef = 045C1F608ADE57757E6732D721779F22 /* NSError+Cancellation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7C87E63D6733AC0FE083373A5FAF86CB /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71B762588C78E0A95319F5BB534965BE /* Category.swift */; }; - 7CE6DE14AB43CB51B4D5C5BA4293C47B /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AD59903FAA8315AD0036AC459FFB97F /* join.m */; }; - 7D38A3624822DA504D0FBD9F4EA485BA /* UIViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D459D0AB2361B48F81C4D14C6D0DAA /* UIViewController+Promise.swift */; }; - 7DAC8F56FC00F6400AC3BF3AF79ACAFD /* ModelReturn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17CBD3DEAD30C207791B4B1A5AD66991 /* ModelReturn.swift */; }; + 73FA79FDB37E5C458B996012BFB0CF04 /* PMKAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C731FBFCC690050C6C08E5AC9D9DC724 /* PMKAlertController.swift */; }; + 7D7A40DBAC93241786E8C553921E8C86 /* OMGHTTPURLRQ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */; }; 80F496237530D382A045A29654D8C11C /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 400A6910E83F606BCD67DC11FA706697 /* ServerTrustPolicy.swift */; }; - 81970BD13A497C0962CBEA922C1DAB3E /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980FD13F87B44BFD90F8AC129BEB2E61 /* race.swift */; }; + 81A2DB65C0742D785DE7C2609CC14140 /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535DF88FC12304114DEF55E4003421B2 /* NSURLSession+Promise.swift */; }; 82971968CBDAB224212EEB4607C9FB8D /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53F8B2513042BD6DB957E8063EF895BD /* Result.swift */; }; - 82BEAE7085889DB1A860FE690273EA7E /* PMKAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C731FBFCC690050C6C08E5AC9D9DC724 /* PMKAlertController.swift */; }; 8399DBEE3E2D98EB1F466132E476F4D9 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F14E17B4D6BDF8BD3E384BE6528F744 /* MultipartFormData.swift */; }; - 8809E3D6CC478B4AC9FA6C2389A5447F /* NSObject+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6EB54C331FED437583A5F01EB2757D1 /* NSObject+Promise.swift */; }; - 8955A9B8A34594437C8D27C4C55BFC9E /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B41BBA87E8FD7BD3513CD49733EB30 /* FormatTest.swift */; }; - 895CB65D12461DA4EA243ACE8346D21F /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = D513E5F3C28C7B452E79AE279B71813D /* User.swift */; }; - 8C749DAB8EA0585A7A5769F38CB33CBC /* NSURLConnection+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = A7F0DAACAC89A93B940BBE54E6A87E9F /* NSURLConnection+AnyPromise.m */; }; - 92EEF6DC60C3CA25AA3997D2652A28F9 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; + 857E5961D9F6E23BD86DEB613A1499C7 /* NSError+Cancellation.h in Headers */ = {isa = PBXBuildFile; fileRef = 045C1F608ADE57757E6732D721779F22 /* NSError+Cancellation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 88B3F911629C08DEEB226F3B294AAB36 /* NSNotificationCenter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = B93FB4BB16CFB41DCA35A8CFAD7A7FEF /* NSNotificationCenter+Promise.swift */; }; + 8C4A96A3E69C772990E3E922D0FD1BC4 /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDD82DB3E6D43BA9769FCA9B744CB5E /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8D3A68D3CBD8A1D89099F704A04A04FC /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9042667D08D783E45394FE8B97EE6468 /* PromiseKit-dummy.m */; }; + 8E3861989641484EE3095722EC08B5A9 /* NSURLConnection+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = A7F0DAACAC89A93B940BBE54E6A87E9F /* NSURLConnection+AnyPromise.m */; }; + 909B0A29022956D90C32C4AA319F75D1 /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B7E90A568681E000EF3CB0917584F3C /* AnyPromise.m */; }; 96D99D0C2472535A169DED65CB231CD7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB15A61DB7ABCB74565286162157C5A0 /* Foundation.framework */; }; - 97BDDBBB6BA36B90E98FCD53B9AE171A /* UIAlertView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 92D340D66F03F31237B70F23FE9B00D0 /* UIAlertView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 994580EAAB3547FFCA0E969378A7AC2E /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D23C407A7CDBFD244D6115899F9D45D /* Promise.swift */; }; - 995CE773471ADA3D5FEB52DF624174C6 /* CALayer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 27E0FE41D771BE8BE3F0D4F1DAD0B179 /* CALayer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9D7DE077DBB18ADD8C4272A59BEB323A /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1D1571AB15108DF6F9C4FE2064E3C43 /* Alamofire.framework */; }; - 9E7DA5C2386E5EA1D57B8C9A38D0A509 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = A92242715FB4C0608F8DCEBF8F3791E2 /* dispatch_promise.m */; }; + 97D71F12142A541BEEF425805D51379E /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980FD13F87B44BFD90F8AC129BEB2E61 /* race.swift */; }; + 9CFBA896DF45B68C788F80013AC3FDBB /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1D1571AB15108DF6F9C4FE2064E3C43 /* Alamofire.framework */; }; A2C172FE407C0BC3478ADCA91A6C9CEC /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D51C929AC51E34493AA757180C09C3B /* Manager.swift */; }; A3505FA2FB3067D53847AD288AC04F03 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04177B09D9596450D827FE49A36C4C4 /* Download.swift */; }; - A5EBC0528F4371B43BFA5A2293089BB5 /* dispatch_promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392FA21A33296B88F790D62A4FAA4E4E /* dispatch_promise.swift */; }; - AA38773839F0E81980834A7A374BA9DC /* InlineResponse200.swift in Sources */ = {isa = PBXBuildFile; fileRef = 176079DAA9CD16ADABA2C18C289C529D /* InlineResponse200.swift */; }; - AC6DCF4BF95F44A46CF6BC9230AD6604 /* UIActionSheet+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD570E28B63274E742E7D1FBBD55BB41 /* UIActionSheet+Promise.swift */; }; - B0AB13A8C68D6972CEDF64FB39D38CB4 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = 275DA9A664C70DD40A4059090D1A00D4 /* after.swift */; }; + ADEEE5F368B5D707D03E78FD75C59048 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D23C407A7CDBFD244D6115899F9D45D /* Promise.swift */; }; B0FB4B01682814B9E3D32F9DC4A5E762 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B476A57549D7994745E17A6DE5BE745 /* Alamofire.swift */; }; - B26D78FFEBAA030D8E8D44B67888C4C2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB15A61DB7ABCB74565286162157C5A0 /* Foundation.framework */; }; - B2C0216914777E4B58E1827D854886C2 /* URLDataPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7CE161ED0CF68954A63F30528ACAD9B /* URLDataPromise.swift */; }; B6D2DC3E3DA44CD382B9B425F40E11C1 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 139346EB669CBE2DE8FE506E14A2BA9C /* Alamofire-dummy.m */; }; - B9096C0EE89EC783BDDC77E1F07314E4 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = C716D7A2A32272C40DFA0AAC76DC0E1E /* Tag.swift */; }; - BC9F5678D442E5AA1B14083554B7B1C8 /* CALayer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A22F2595054D39018E03961CA7283A /* CALayer+AnyPromise.m */; }; - BCCC0421EE641F782CA295FBD240E2E1 /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535DF88FC12304114DEF55E4003421B2 /* NSURLSession+Promise.swift */; }; - BEE4B5067218AB107DDECC8B09569EFC /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B7E90A568681E000EF3CB0917584F3C /* AnyPromise.m */; }; - C5EEED0AFF5E2C5AAE2A646689B73DA3 /* UIViewController+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = AA24C5EC82CF437D8D1FFFAB68975408 /* UIViewController+AnyPromise.m */; }; C75519F0450166A6F28126ECC7664E9C /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA1AD92813B887E2D017D051B8C0E3D2 /* Validation.swift */; }; - CA0AABE1706F8B94DC37330AB2BC062C /* Umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A8906F6D6920DF197965D1740A7E283 /* Umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CB4E6EA27EA59B8851C744CA7D98A2BA /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A112EF8BB3933C1C1E42F11B3DD3B02A /* PromiseKit.framework */; }; - CE7DAD64CE27C4B98432BDB1CB0E21C7 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AEDC82569B65EDA2A3D12E1F9B8A2D8 /* Dog.swift */; }; - D1E26E1C25F870E9A0AEC9240E589D75 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = C295084120B300E8BDB7B91981B104FC /* Name.swift */; }; + C86881D2285095255829A578F0A85300 /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = B868468092D7B2489B889A50981C9247 /* after.m */; }; + C86CE0A47FAD4C9B2929A335D62A179E /* UIViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6D459D0AB2361B48F81C4D14C6D0DAA /* UIViewController+Promise.swift */; }; + CAF12A3EDA2376FFEAD4A12E413C1AAD /* UIActionSheet+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 9774D31336C85248A115B569E7D95283 /* UIActionSheet+AnyPromise.m */; }; + CB2A58CBAB5A2E63D0CB70F2697CAE87 /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 143BC30E5DDAF52A3D9578F507EC6A41 /* when.m */; }; + CD97970D21D3CB8C459FAFEF11EE60F3 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */; }; + CE225CF07E6E385F014883D607AFA44D /* URLDataPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7CE161ED0CF68954A63F30528ACAD9B /* URLDataPromise.swift */; }; + CE89E5C528D52BBCBCD23309603BA6D1 /* CALayer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 27E0FE41D771BE8BE3F0D4F1DAD0B179 /* CALayer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D1735D6C4D574339EB49024228448459 /* UIView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3CDA0958D6247505ECD9098D662EA74 /* UIView+Promise.swift */; }; D1E8B31EFCBDE00F108E739AD69425C0 /* Pods-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; D21B7325B3642887BFBE977E021F2D26 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD558DDCDDA1B46951548B02C34277EF /* ResponseSerialization.swift */; }; - D258F1E893340393ADABCB02B9FBA206 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F19945EE403F7B29D8B1939EA6D579A /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D2C7190FC2A0F2868EB7C89F5CFA526B /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DC63EB77B3791891517B98CAA115DE8 /* State.swift */; }; D358A828E68E152D06FC8E35533BF00B /* OMGHTTPURLRQ-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F36B65CF990C57DC527824ED0BA1915 /* OMGHTTPURLRQ-dummy.m */; }; - D39F4FBEE42A57E59471B2A0997FE4CF /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = F4B6A98D6DAF474045210F5A74FF1C3C /* hang.m */; }; - D57DA5AC37CE3CEA92958C9528F80FD9 /* UIActionSheet+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 9774D31336C85248A115B569E7D95283 /* UIActionSheet+AnyPromise.m */; }; + D546A4DBA3F7750F45A6F63B994C081C /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */; }; D75CA395D510E08C404E55F5BDAE55CE /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A9CB35983E4859DFFBAD8840196A094 /* Error.swift */; }; - D839A38DEEDDB887F186714D75E73431 /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E0DBDE561A6C2E7AC7A24160F8A5F28 /* Promise+Properties.swift */; }; - DC710F75309F7DFEA3C5AB01E9288681 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAA644003A8DF304D35F77FE04B8AB17 /* AlamofireImplementations.swift */; }; - DCFE64070EE0BB77557935AD2A4ABF62 /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16730DAF3E51C161D8247E473F069E71 /* when.swift */; }; + D93596046CD3B301F4EC99A7A118C82C /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 558DFECE2C740177CA6357DA71A1DFBB /* Error.swift */; }; + DBD1F4247E1C591AE4EE5531599AB170 /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 3616971BAEF40302B7F2F8B1007C0B2B /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; DD8D067A7F742F39B87FA04CE12DD118 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB15A61DB7ABCB74565286162157C5A0 /* Foundation.framework */; }; - E1EB5507436EFBD58AF7B9FF051A5AC4 /* afterlife.swift in Sources */ = {isa = PBXBuildFile; fileRef = C476B916B763E55E4161F0B30760C4E8 /* afterlife.swift */; }; - E3AB1EE3B8DECE5D55D9EB64B0D05E93 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A29C027BA870C5E7975BF50087CAE384 /* Pet.swift */; }; - E62ABEDB4D7B179589B75C8423C5BF9B /* NSURLConnection+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = BAE48ACA10E8895BB8BF5CE8C0846B4B /* NSURLConnection+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E74976C9C4A5EF60B0A9CA1285693DDF /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDD82DB3E6D43BA9769FCA9B744CB5E /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EB0C1A986BDF161D01919BCCCAE40D7E /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 076251AD10B5F4E8880F4C350E1D9D5A /* Animal.swift */; }; - F0E47CCDA10383F8489C3839FD0DF755 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A1DC80A0773C5A569348DC442EAFD1D /* UIKit.framework */; }; - F1E37BB11F68A6A76DF44B230F965E05 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F3D3D4088EDA3359CC0E5EBA9B683959 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F2773E2F96E394825BE86FA45E48132 /* PetAPI.swift */; }; - F4448E76D51EBACC2B20CDFE3D2D90D7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91579AC4E335E76904DB4DB54228CC42 /* Order.swift */; }; - F4C2BD51185019A010DA83458B007F81 /* NSNotificationCenter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = B93FB4BB16CFB41DCA35A8CFAD7A7FEF /* NSNotificationCenter+Promise.swift */; }; - F4E24EB57CB59F112060100A4B9E5D10 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 558DFECE2C740177CA6357DA71A1DFBB /* Error.swift */; }; + E2B0094FAAEA55C55AD141136F650E35 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */; }; + EA35E77B4F31DC3E1D224458E0BC959D /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8072E1108951F272C003553FC8926C7 /* APIs.swift */; }; + EA67B414E392EFD2B14742F55A595596 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = 275DA9A664C70DD40A4059090D1A00D4 /* after.swift */; }; + EA691570F0F8066651EE2A7066426384 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A1DC80A0773C5A569348DC442EAFD1D /* UIKit.framework */; }; + EB3C88CDAF122BA763FEF85758370C7C /* UIAlertView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA854180C132DB5511D64C82535C5FDE /* UIAlertView+Promise.swift */; }; + EB9A1F33DB49ADA09F6E7F19A2C30357 /* NSURLConnection+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412985229DA7A4DF9E129B7E8F0C09BB /* NSURLConnection+Promise.swift */; }; + ED30A8B82BA1D53CBC370B1DC18DA1EB /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16730DAF3E51C161D8247E473F069E71 /* when.swift */; }; + EEF6E654182421FEBC0CC202E72F71A8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB15A61DB7ABCB74565286162157C5A0 /* Foundation.framework */; }; + F4582E8DC1C9F362ADA4BAE9CEF8B681 /* dispatch_promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392FA21A33296B88F790D62A4FAA4E4E /* dispatch_promise.swift */; }; + F700EAA9F9F6C1F99C83B45D05C5AD14 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BFFA6FD621E9ED341AA89AEAC1604D7 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F7161E50F083B2267363F243C4E4B78F /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5973BC143AE488C12FFB1E83E71F0C45 /* AnyPromise.swift */; }; + F898D4270885EF1114608E76B0C09E21 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DC63EB77B3791891517B98CAA115DE8 /* State.swift */; }; + FB0B33F03AC2BC8A7FC7FD912C12CC22 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A112EF8BB3933C1C1E42F11B3DD3B02A /* PromiseKit.framework */; }; FC14480CECE872865A9C6E584F886DA3 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 133C5287CFDCB3B67578A7B1221E132C /* Request.swift */; }; FEF0D7653948988B804226129471C1EC /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A8F373B23E0F7FB68B0BA71D92D1C60 /* Stream.swift */; }; - FF5CD62C722D6A68AD65462B56D7CB72 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F0F4EDC2236E1C270DC2014181D6506 /* UIView+AnyPromise.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -121,17 +111,10 @@ isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 57958C5706F810052A634C1714567A9F; + remoteGlobalIDString = 2FD913B4E24277823983BABFDB071664; remoteInfo = PetstoreClient; }; - 23252B1F29F10BD972ECD7BA34F20EA8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 190ACD3A51BC90B85EADB13E9CDD207B; - remoteInfo = OMGHTTPURLRQ; - }; - 56AF0748FFC13AD34ECC967C04930EF8 /* PBXContainerItemProxy */ = { + 4BED27A854EA6600536518D29BBB3670 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; @@ -145,6 +128,13 @@ remoteGlobalIDString = 432ECC54282C84882B482CCB4CF227FC; remoteInfo = Alamofire; }; + 8059767A82D94C9F7F7C16D030819C4E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 190ACD3A51BC90B85EADB13E9CDD207B; + remoteInfo = OMGHTTPURLRQ; + }; 9AD20158D23CE70A2A91E5B7859090C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; @@ -156,14 +146,14 @@ isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = D9A01D449983C8E3EF61C0CA4A7D8F59; + remoteGlobalIDString = 25EDA9CFC641C69402B3857A2C4A39F0; remoteInfo = PromiseKit; }; - EEB067570D28F14A138B737F596BCB1A /* PBXContainerItemProxy */ = { + ECAC5E4454026C822004659466983ADD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = D9A01D449983C8E3EF61C0CA4A7D8F59; + remoteGlobalIDString = 25EDA9CFC641C69402B3857A2C4A39F0; remoteInfo = PromiseKit; }; /* End PBXContainerItemProxy section */ @@ -171,10 +161,9 @@ /* Begin PBXFileReference section */ 045C1F608ADE57757E6732D721779F22 /* NSError+Cancellation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSError+Cancellation.h"; path = "Sources/NSError+Cancellation.h"; sourceTree = ""; }; 04A22F2595054D39018E03961CA7283A /* CALayer+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+AnyPromise.m"; path = "Categories/QuartzCore/CALayer+AnyPromise.m"; sourceTree = ""; }; - 076251AD10B5F4E8880F4C350E1D9D5A /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; 0A8906F6D6920DF197965D1740A7E283 /* Umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Umbrella.h; path = Sources/Umbrella.h; sourceTree = ""; }; 0BA017E288BB42E06EBEE9C6E6993EAF /* UIViewController+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+AnyPromise.h"; path = "Categories/UIKit/UIViewController+AnyPromise.h"; sourceTree = ""; }; - 0C24509ECAD94A91B30D87D8B2DEEB9B /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; 0F36B65CF990C57DC527824ED0BA1915 /* OMGHTTPURLRQ-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OMGHTTPURLRQ-dummy.m"; sourceTree = ""; }; 122D5005A81832479161CD1D223C573A /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; 133C5287CFDCB3B67578A7B1221E132C /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; @@ -183,23 +172,21 @@ 143BC30E5DDAF52A3D9578F507EC6A41 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; 16730DAF3E51C161D8247E473F069E71 /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; 16D7C901D915C251DEBA27AC1EF57E34 /* OMGHTTPURLRQ.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = OMGHTTPURLRQ.xcconfig; sourceTree = ""; }; - 176079DAA9CD16ADABA2C18C289C529D /* InlineResponse200.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = InlineResponse200.swift; sourceTree = ""; }; - 17CBD3DEAD30C207791B4B1A5AD66991 /* ModelReturn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ModelReturn.swift; sourceTree = ""; }; + 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; 1B7E90A568681E000EF3CB0917584F3C /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; - 1C7FF1C1E487B6795C5F6734CCA49DF3 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; 1F19945EE403F7B29D8B1939EA6D579A /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; 1FBD351D007CF4095C98C9DFD9D83D61 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 24C79ED4B5226F263307B22E96E88F9F /* OMGHTTPURLRQ.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = OMGHTTPURLRQ.modulemap; sourceTree = ""; }; 25614E715DDC170DAFB0DF50C5503E33 /* OMGFormURLEncode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGFormURLEncode.m; path = Sources/OMGFormURLEncode.m; sourceTree = ""; }; + 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 275DA9A664C70DD40A4059090D1A00D4 /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; 27E0FE41D771BE8BE3F0D4F1DAD0B179 /* CALayer+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CALayer+AnyPromise.h"; path = "Categories/QuartzCore/CALayer+AnyPromise.h"; sourceTree = ""; }; - 2BAE461B3A62164A09480E8967D29E64 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-umbrella.h"; sourceTree = ""; }; 2D51C929AC51E34493AA757180C09C3B /* Manager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Manager.swift; path = Source/Manager.swift; sourceTree = ""; }; - 2E506C8F40F5AD602D83B383EAA7C0CD /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; 2F0F4EDC2236E1C270DC2014181D6506 /* UIView+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+AnyPromise.m"; path = "Categories/UIKit/UIView+AnyPromise.m"; sourceTree = ""; }; 30CE7341A995EF6812D71771E74CF7F7 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - 323E5DCC342B03D7AE59F37523D2626A /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OMGHTTPURLRQ.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3616971BAEF40302B7F2F8B1007C0B2B /* NSNotificationCenter+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSNotificationCenter+AnyPromise.h"; path = "Categories/Foundation/NSNotificationCenter+AnyPromise.h"; sourceTree = ""; }; 392FA21A33296B88F790D62A4FAA4E4E /* dispatch_promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = dispatch_promise.swift; path = Sources/dispatch_promise.swift; sourceTree = ""; }; @@ -215,17 +202,17 @@ 51ADA0B6B6B00CB0E818AA8CBC311677 /* OMGFormURLEncode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OMGFormURLEncode.h; path = Sources/OMGFormURLEncode.h; sourceTree = ""; }; 535DF88FC12304114DEF55E4003421B2 /* NSURLSession+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSURLSession+Promise.swift"; path = "Categories/Foundation/NSURLSession+Promise.swift"; sourceTree = ""; }; 53F8B2513042BD6DB957E8063EF895BD /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; 558DFECE2C740177CA6357DA71A1DFBB /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; 5973BC143AE488C12FFB1E83E71F0C45 /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; 5A1DC80A0773C5A569348DC442EAFD1D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 5CA1C154DFC54DFFB12A754B9A0BBDFC /* OMGHTTPURLRQ.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OMGHTTPURLRQ.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5DF5FC3AF99846209C5FCE55A2E12D9A /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; 5F14E17B4D6BDF8BD3E384BE6528F744 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; 6846D22C9F0CCBC48DF833E309A8E84F /* UIActionSheet+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActionSheet+AnyPromise.h"; path = "Categories/UIKit/UIActionSheet+AnyPromise.h"; sourceTree = ""; }; - 6A60B64E388679F589CB959AA5FC4787 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 6AD59903FAA8315AD0036AC459FFB97F /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; - 6AEDC82569B65EDA2A3D12E1F9B8A2D8 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 71B762588C78E0A95319F5BB534965BE /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; 792D14AC86CD98AA9C31373287E0F353 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79A9DEDC89FE8336BF5FEDAAF75BF7FC /* Pods.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Pods.modulemap; sourceTree = ""; }; 7E0DBDE561A6C2E7AC7A24160F8A5F28 /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; @@ -238,27 +225,22 @@ 8A9CB35983E4859DFFBAD8840196A094 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Source/Error.swift; sourceTree = ""; }; 8B476A57549D7994745E17A6DE5BE745 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; 8DC63EB77B3791891517B98CAA115DE8 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; + 8F0266C5AE0B23A436291F6647902086 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 9042667D08D783E45394FE8B97EE6468 /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; - 91579AC4E335E76904DB4DB54228CC42 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; 92D340D66F03F31237B70F23FE9B00D0 /* UIAlertView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIAlertView+AnyPromise.h"; path = "Categories/UIKit/UIAlertView+AnyPromise.h"; sourceTree = ""; }; - 93B41BBA87E8FD7BD3513CD49733EB30 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; 9774D31336C85248A115B569E7D95283 /* UIActionSheet+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIActionSheet+AnyPromise.m"; path = "Categories/UIKit/UIActionSheet+AnyPromise.m"; sourceTree = ""; }; 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = ""; }; 980FD13F87B44BFD90F8AC129BEB2E61 /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; - 9D172F6D749B7735D04B495330AB7FE3 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; 9D579267FC1F163C8F04B444DAEFED0D /* OMGHTTPURLRQ.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGHTTPURLRQ.m; path = Sources/OMGHTTPURLRQ.m; sourceTree = ""; }; - 9F2773E2F96E394825BE86FA45E48132 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; A04177B09D9596450D827FE49A36C4C4 /* Download.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Download.swift; path = Source/Download.swift; sourceTree = ""; }; A112EF8BB3933C1C1E42F11B3DD3B02A /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A1D1571AB15108DF6F9C4FE2064E3C43 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A29C027BA870C5E7975BF50087CAE384 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - A3CC2D1A2A451C0A3C4DBD6D7E117C01 /* ObjectReturn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ObjectReturn.swift; sourceTree = ""; }; A7F0DAACAC89A93B940BBE54E6A87E9F /* NSURLConnection+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSURLConnection+AnyPromise.m"; path = "Categories/Foundation/NSURLConnection+AnyPromise.m"; sourceTree = ""; }; A92242715FB4C0608F8DCEBF8F3791E2 /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; AA24C5EC82CF437D8D1FFFAB68975408 /* UIViewController+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+AnyPromise.m"; path = "Categories/UIKit/UIViewController+AnyPromise.m"; sourceTree = ""; }; AB4DA378490493502B34B20D4B12325B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AD05F019D163F2D5FE7C8E64C1D2E299 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; B868468092D7B2489B889A50981C9247 /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; B93FB4BB16CFB41DCA35A8CFAD7A7FEF /* NSNotificationCenter+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Promise.swift"; path = "Categories/Foundation/NSNotificationCenter+Promise.swift"; sourceTree = ""; }; @@ -266,26 +248,24 @@ BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; BAE48ACA10E8895BB8BF5CE8C0846B4B /* NSURLConnection+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSURLConnection+AnyPromise.h"; path = "Categories/Foundation/NSURLConnection+AnyPromise.h"; sourceTree = ""; }; BCDD82DB3E6D43BA9769FCA9B744CB5E /* UIView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+AnyPromise.h"; path = "Categories/UIKit/UIView+AnyPromise.h"; sourceTree = ""; }; - C295084120B300E8BDB7B91981B104FC /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; C476B916B763E55E4161F0B30760C4E8 /* afterlife.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = afterlife.swift; path = Categories/Foundation/afterlife.swift; sourceTree = ""; }; - C716D7A2A32272C40DFA0AAC76DC0E1E /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; C731FBFCC690050C6C08E5AC9D9DC724 /* PMKAlertController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PMKAlertController.swift; path = Categories/UIKit/PMKAlertController.swift; sourceTree = ""; }; CA1AD92813B887E2D017D051B8C0E3D2 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; CA854180C132DB5511D64C82535C5FDE /* UIAlertView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIAlertView+Promise.swift"; path = "Categories/UIKit/UIAlertView+Promise.swift"; sourceTree = ""; }; - CAA644003A8DF304D35F77FE04B8AB17 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; CBC0F7C552B739C909B650A0F42F7F38 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = ""; }; CC49FF2A84C0E0E9349747D94036B728 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; CCE38472832BBCC541E646DA6C18EF9C /* Upload.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Upload.swift; path = Source/Upload.swift; sourceTree = ""; }; CDC4DD7DB9F4C34A288BECA73BC13B57 /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PromiseKit.modulemap; sourceTree = ""; }; D0405803033A2A777B8E4DFA0C1800ED /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = ""; }; + D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; D4248CF20178C57CEFEFAAF453C0DC75 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D513E5F3C28C7B452E79AE279B71813D /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; D6D459D0AB2361B48F81C4D14C6D0DAA /* UIViewController+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIViewController+Promise.swift"; path = "Categories/UIKit/UIViewController+Promise.swift"; sourceTree = ""; }; D6EB54C331FED437583A5F01EB2757D1 /* NSObject+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Promise.swift"; path = "Categories/Foundation/NSObject+Promise.swift"; sourceTree = ""; }; + D8072E1108951F272C003553FC8926C7 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; D931A99C6B5A8E0F69C818C6ECC3C44F /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; DA312349A49333542E6F4B36B329960E /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = ""; }; DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - DED58811444E6D32A1F7B372F034DB7A /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; E11BFB27B43B742CB5D6086C4233A909 /* OMGUserAgent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGUserAgent.m; path = Sources/OMGUserAgent.m; sourceTree = ""; }; E160B50E4D11692AA38E74C897D69C61 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E3CDA0958D6247505ECD9098D662EA74 /* UIView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Promise.swift"; path = "Categories/UIKit/UIView+Promise.swift"; sourceTree = ""; }; @@ -305,16 +285,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 783E7A91F3C3404EDF234C828FCA6543 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9D7DE077DBB18ADD8C4272A59BEB323A /* Alamofire.framework in Frameworks */, - B26D78FFEBAA030D8E8D44B67888C4C2 /* Foundation.framework in Frameworks */, - CB4E6EA27EA59B8851C744CA7D98A2BA /* PromiseKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9792A6BDBB07FB15453527B4370E3086 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -331,14 +301,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DBF65F787DDFE72646CDC44CF9E22784 /* Frameworks */ = { + B9EC7146E2607203CE4A5678AE249144 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 39E7AFE23097B4BC393D43A44093FB63 /* Foundation.framework in Frameworks */, - 30F9F020F5B35577080063E71CDAB08C /* OMGHTTPURLRQ.framework in Frameworks */, - 0BB1E79782E3BE258C30A65A20C85FC1 /* QuartzCore.framework in Frameworks */, - F0E47CCDA10383F8489C3839FD0DF755 /* UIKit.framework in Frameworks */, + EEF6E654182421FEBC0CC202E72F71A8 /* Foundation.framework in Frameworks */, + 7D7A40DBAC93241786E8C553921E8C86 /* OMGHTTPURLRQ.framework in Frameworks */, + 1287903F965945AEB5EFC4EE768C7B38 /* QuartzCore.framework in Frameworks */, + EA691570F0F8066651EE2A7066426384 /* UIKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -350,6 +320,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FC8C7ACC9E4D7F04E9223A734BF57FFB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9CFBA896DF45B68C788F80013AC3FDBB /* Alamofire.framework in Frameworks */, + 523C1819FC864864A9715CF713DD12E9 /* Foundation.framework in Frameworks */, + FB0B33F03AC2BC8A7FC7FD912C12CC22 /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -362,24 +342,14 @@ name = UserAgent; sourceTree = ""; }; - 18E0A354B63748476BE2595538327E6C /* Models */ = { + 1322FED69118C64DAD026CAF7F4C38C6 /* Models */ = { isa = PBXGroup; children = ( - 076251AD10B5F4E8880F4C350E1D9D5A /* Animal.swift */, - 9D172F6D749B7735D04B495330AB7FE3 /* Cat.swift */, - 71B762588C78E0A95319F5BB534965BE /* Category.swift */, - 6AEDC82569B65EDA2A3D12E1F9B8A2D8 /* Dog.swift */, - 93B41BBA87E8FD7BD3513CD49733EB30 /* FormatTest.swift */, - 176079DAA9CD16ADABA2C18C289C529D /* InlineResponse200.swift */, - 0C24509ECAD94A91B30D87D8B2DEEB9B /* Model200Response.swift */, - 17CBD3DEAD30C207791B4B1A5AD66991 /* ModelReturn.swift */, - C295084120B300E8BDB7B91981B104FC /* Name.swift */, - A3CC2D1A2A451C0A3C4DBD6D7E117C01 /* ObjectReturn.swift */, - 91579AC4E335E76904DB4DB54228CC42 /* Order.swift */, - A29C027BA870C5E7975BF50087CAE384 /* Pet.swift */, - DED58811444E6D32A1F7B372F034DB7A /* SpecialModelName.swift */, - C716D7A2A32272C40DFA0AAC76DC0E1E /* Tag.swift */, - D513E5F3C28C7B452E79AE279B71813D /* User.swift */, + D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */, + 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */, + 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */, + 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */, + 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */, ); path = Models; sourceTree = ""; @@ -576,7 +546,7 @@ AD94092456F8ABCB18F74CAC75AD85DE /* Classes */ = { isa = PBXGroup; children = ( - DFFDD7A6740B9120EF97F5F72A59157D /* Swaggers */, + F64549CFCC17C7AC6479508BE180B18D /* Swaggers */, ); path = Classes; sourceTree = ""; @@ -617,16 +587,6 @@ name = CorePromise; sourceTree = ""; }; - CA9F1413BA9B41923CFFA1AAB2765441 /* APIs */ = { - isa = PBXGroup; - children = ( - 9F2773E2F96E394825BE86FA45E48132 /* PetAPI.swift */, - 1C7FF1C1E487B6795C5F6734CCA49DF3 /* StoreAPI.swift */, - AD05F019D163F2D5FE7C8E64C1D2E299 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; CF22FA3EE19C3EC42FEBA1247EB70D85 /* Pods */ = { isa = PBXGroup; children = ( @@ -661,20 +621,6 @@ path = PromiseKit; sourceTree = ""; }; - DFFDD7A6740B9120EF97F5F72A59157D /* Swaggers */ = { - isa = PBXGroup; - children = ( - CAA644003A8DF304D35F77FE04B8AB17 /* AlamofireImplementations.swift */, - 2E506C8F40F5AD602D83B383EAA7C0CD /* APIHelper.swift */, - 323E5DCC342B03D7AE59F37523D2626A /* APIs.swift */, - 2BAE461B3A62164A09480E8967D29E64 /* Extensions.swift */, - 6A60B64E388679F589CB959AA5FC4787 /* Models.swift */, - CA9F1413BA9B41923CFFA1AAB2765441 /* APIs */, - 18E0A354B63748476BE2595538327E6C /* Models */, - ); - path = Swaggers; - sourceTree = ""; - }; E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = { isa = PBXGroup; children = ( @@ -714,9 +660,59 @@ path = ../..; sourceTree = ""; }; + F64549CFCC17C7AC6479508BE180B18D /* Swaggers */ = { + isa = PBXGroup; + children = ( + 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */, + D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */, + D8072E1108951F272C003553FC8926C7 /* APIs.swift */, + 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */, + 8F0266C5AE0B23A436291F6647902086 /* Models.swift */, + F92EFB558CBA923AB1CFA22F708E315A /* APIs */, + 1322FED69118C64DAD026CAF7F4C38C6 /* Models */, + ); + path = Swaggers; + sourceTree = ""; + }; + F92EFB558CBA923AB1CFA22F708E315A /* APIs */ = { + isa = PBXGroup; + children = ( + 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */, + 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */, + 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */, + ); + path = APIs; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 09D29D14882ADDDA216809ED16917D07 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3860D960E37C1257BDA54626CA592E86 /* AnyPromise.h in Headers */, + CE89E5C528D52BBCBCD23309603BA6D1 /* CALayer+AnyPromise.h in Headers */, + 857E5961D9F6E23BD86DEB613A1499C7 /* NSError+Cancellation.h in Headers */, + DBD1F4247E1C591AE4EE5531599AB170 /* NSNotificationCenter+AnyPromise.h in Headers */, + 18FAC6B4FD3B44CB353C7A6027286100 /* NSURLConnection+AnyPromise.h in Headers */, + F700EAA9F9F6C1F99C83B45D05C5AD14 /* PromiseKit.h in Headers */, + 0268F9278E32ACC1F996F4E2E45622B5 /* UIActionSheet+AnyPromise.h in Headers */, + 12348513CB81BD05B497C210905CDF65 /* UIAlertView+AnyPromise.h in Headers */, + 8C4A96A3E69C772990E3E922D0FD1BC4 /* UIView+AnyPromise.h in Headers */, + 01BD61BBC475EB3369237B84FE24D3EE /* UIViewController+AnyPromise.h in Headers */, + 0BDA43D8F48C8B0D504C440046FAF681 /* Umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2835BFBD2FEFE3E2844CFC1B10201EA4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 656BED6137A9FFA3B2DF03861F525022 /* PetstoreClient-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5F7B61281F714E2A64A51E80A2C9C062 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -725,14 +721,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 661BAF8916A434EEB8B0CDCC39DF19C2 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - F1E37BB11F68A6A76DF44B230F965E05 /* PetstoreClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 7E1332ABD911123D7A873D6D87E2F182 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -752,24 +740,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - CC349308BCECD7B68C93EB3091B72E61 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D258F1E893340393ADABCB02B9FBA206 /* AnyPromise.h in Headers */, - 995CE773471ADA3D5FEB52DF624174C6 /* CALayer+AnyPromise.h in Headers */, - 7BCBC4FD2E385CAFC5F3949FFFFE2095 /* NSError+Cancellation.h in Headers */, - 752EACD07B4F948C1F24E0583C5DA165 /* NSNotificationCenter+AnyPromise.h in Headers */, - E62ABEDB4D7B179589B75C8423C5BF9B /* NSURLConnection+AnyPromise.h in Headers */, - 1DB7E23C2A2A8D4B5CE046135E4540C6 /* PromiseKit.h in Headers */, - 63AF5DF795F5D610768B4AF53C7E9976 /* UIActionSheet+AnyPromise.h in Headers */, - 97BDDBBB6BA36B90E98FCD53B9AE171A /* UIAlertView+AnyPromise.h in Headers */, - E74976C9C4A5EF60B0A9CA1285693DDF /* UIView+AnyPromise.h in Headers */, - 66B8591A8CCC9760D933506B71A13962 /* UIViewController+AnyPromise.h in Headers */, - CA0AABE1706F8B94DC37330AB2BC062C /* Umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -790,6 +760,43 @@ productReference = 5CA1C154DFC54DFFB12A754B9A0BBDFC /* OMGHTTPURLRQ.framework */; productType = "com.apple.product-type.framework"; }; + 25EDA9CFC641C69402B3857A2C4A39F0 /* PromiseKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 03DDC7D7BA248863E8493F462ABAD118 /* Build configuration list for PBXNativeTarget "PromiseKit" */; + buildPhases = ( + 1541E3035B9D2A7EED16C98953A8CEB6 /* Sources */, + B9EC7146E2607203CE4A5678AE249144 /* Frameworks */, + 09D29D14882ADDDA216809ED16917D07 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + C893B48B47F4A7541102DAAFECFC50F2 /* PBXTargetDependency */, + ); + name = PromiseKit; + productName = PromiseKit; + productReference = D4248CF20178C57CEFEFAAF453C0DC75 /* PromiseKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 2FD913B4E24277823983BABFDB071664 /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = B5E28E2093F917340AF5AAA0FCE5E37D /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + 0DDA01F58E1381BEA0D7FB759B75A456 /* Sources */, + FC8C7ACC9E4D7F04E9223A734BF57FFB /* Frameworks */, + 2835BFBD2FEFE3E2844CFC1B10201EA4 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + FC9E3FF49D9B636B2925749B2D51A5D3 /* PBXTargetDependency */, + FAC5685F6C40E5D74404831646CBC453 /* PBXTargetDependency */, + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = E160B50E4D11692AA38E74C897D69C61 /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; 432ECC54282C84882B482CCB4CF227FC /* Alamofire */ = { isa = PBXNativeTarget; buildConfigurationList = 8B2B2DA2F7F80D41B1FDB5FACFA4B3DE /* Build configuration list for PBXNativeTarget "Alamofire" */; @@ -807,25 +814,6 @@ productReference = EBC4140FCBB5B4D3A955B1608C165C04 /* Alamofire.framework */; productType = "com.apple.product-type.framework"; }; - 57958C5706F810052A634C1714567A9F /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = C36F9DFB9BBE472AD46194868C8F885B /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - 85A7E0C7933D1BC0EB062F281D1F19AD /* Sources */, - 783E7A91F3C3404EDF234C828FCA6543 /* Frameworks */, - 661BAF8916A434EEB8B0CDCC39DF19C2 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - F6093ED00F5D11A44F55549F1A4C778F /* PBXTargetDependency */, - 38BE3993D1A8CA768731BA0465C21F17 /* PBXTargetDependency */, - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = E160B50E4D11692AA38E74C897D69C61 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; 7A5DBD588D2CC1C0CB1C42D4ED613FE4 /* Pods */ = { isa = PBXNativeTarget; buildConfigurationList = 8CB3C5DF3F4B6413A6F2D003B58CCF32 /* Build configuration list for PBXNativeTarget "Pods" */; @@ -847,24 +835,6 @@ productReference = D931A99C6B5A8E0F69C818C6ECC3C44F /* Pods.framework */; productType = "com.apple.product-type.framework"; }; - D9A01D449983C8E3EF61C0CA4A7D8F59 /* PromiseKit */ = { - isa = PBXNativeTarget; - buildConfigurationList = FCAE2E57B1A9453B9D35EF9071C4C581 /* Build configuration list for PBXNativeTarget "PromiseKit" */; - buildPhases = ( - E0A9A1079F8923D78CC7F6D7F87CD779 /* Sources */, - DBF65F787DDFE72646CDC44CF9E22784 /* Frameworks */, - CC349308BCECD7B68C93EB3091B72E61 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - A48A5E27A5C878B373F0FE7365829141 /* PBXTargetDependency */, - ); - name = PromiseKit; - productName = PromiseKit; - productReference = D4248CF20178C57CEFEFAAF453C0DC75 /* PromiseKit.framework */; - productType = "com.apple.product-type.framework"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -888,14 +858,77 @@ targets = ( 432ECC54282C84882B482CCB4CF227FC /* Alamofire */, 190ACD3A51BC90B85EADB13E9CDD207B /* OMGHTTPURLRQ */, - 57958C5706F810052A634C1714567A9F /* PetstoreClient */, + 2FD913B4E24277823983BABFDB071664 /* PetstoreClient */, 7A5DBD588D2CC1C0CB1C42D4ED613FE4 /* Pods */, - D9A01D449983C8E3EF61C0CA4A7D8F59 /* PromiseKit */, + 25EDA9CFC641C69402B3857A2C4A39F0 /* PromiseKit */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ + 0DDA01F58E1381BEA0D7FB759B75A456 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 516D41E4D035A817CC5116C11302E408 /* AlamofireImplementations.swift in Sources */, + 46F838880F41F56ABD91796FC956B4BF /* APIHelper.swift in Sources */, + EA35E77B4F31DC3E1D224458E0BC959D /* APIs.swift in Sources */, + CD97970D21D3CB8C459FAFEF11EE60F3 /* Category.swift in Sources */, + 5EE5E1CA27F3CB04A5DCF5BB90B76000 /* Extensions.swift in Sources */, + 15ECEBA1EFBD023AEA47F36524270D2C /* Models.swift in Sources */, + E2B0094FAAEA55C55AD141136F650E35 /* Order.swift in Sources */, + 1CDA074C6DC95876D85E13ECF882B93A /* Pet.swift in Sources */, + 2B38BB4603B4286FF8D7A780372E947F /* PetAPI.swift in Sources */, + 25FBB92AFB8F5A777CE8E40EC3B9DACA /* PetstoreClient-dummy.m in Sources */, + 443361437B359830308B93A7B98BE039 /* StoreAPI.swift in Sources */, + 6B0A17CD24331793D2504E0FBBAF5EB2 /* Tag.swift in Sources */, + D546A4DBA3F7750F45A6F63B994C081C /* User.swift in Sources */, + 2D9379807BA243E1CE457D1BE963DA09 /* UserAPI.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1541E3035B9D2A7EED16C98953A8CEB6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C86881D2285095255829A578F0A85300 /* after.m in Sources */, + EA67B414E392EFD2B14742F55A595596 /* after.swift in Sources */, + 1AC7E88F0EC64D1D4E83CE7767BFD2B7 /* afterlife.swift in Sources */, + 909B0A29022956D90C32C4AA319F75D1 /* AnyPromise.m in Sources */, + F7161E50F083B2267363F243C4E4B78F /* AnyPromise.swift in Sources */, + 124EFF5E3C46EC88F47C52479FA6ACAF /* CALayer+AnyPromise.m in Sources */, + 6A128FE350973D8A693E3F063C5E4A49 /* dispatch_promise.m in Sources */, + F4582E8DC1C9F362ADA4BAE9CEF8B681 /* dispatch_promise.swift in Sources */, + D93596046CD3B301F4EC99A7A118C82C /* Error.swift in Sources */, + 5FFED823C0BDD412FA41B01EA47394D1 /* hang.m in Sources */, + 5D7EAE5725A7E750B51FD27AECB5F0FD /* join.m in Sources */, + 06F7C0C55DF4C09C015159F6B0802EB1 /* join.swift in Sources */, + 11C221075C5B20BDEEB3DDF8EAC99E63 /* NSNotificationCenter+AnyPromise.m in Sources */, + 88B3F911629C08DEEB226F3B294AAB36 /* NSNotificationCenter+Promise.swift in Sources */, + 0D240D796AAD10F0119A1D7AC2570AAA /* NSObject+Promise.swift in Sources */, + 8E3861989641484EE3095722EC08B5A9 /* NSURLConnection+AnyPromise.m in Sources */, + EB9A1F33DB49ADA09F6E7F19A2C30357 /* NSURLConnection+Promise.swift in Sources */, + 81A2DB65C0742D785DE7C2609CC14140 /* NSURLSession+Promise.swift in Sources */, + 73FA79FDB37E5C458B996012BFB0CF04 /* PMKAlertController.swift in Sources */, + 1E1010EA437F154A554D04F7F3A894EC /* Promise+Properties.swift in Sources */, + ADEEE5F368B5D707D03E78FD75C59048 /* Promise.swift in Sources */, + 8D3A68D3CBD8A1D89099F704A04A04FC /* PromiseKit-dummy.m in Sources */, + 97D71F12142A541BEEF425805D51379E /* race.swift in Sources */, + F898D4270885EF1114608E76B0C09E21 /* State.swift in Sources */, + CAF12A3EDA2376FFEAD4A12E413C1AAD /* UIActionSheet+AnyPromise.m in Sources */, + 387C7387FDC662D23D743879B6143D59 /* UIActionSheet+Promise.swift in Sources */, + 11EA8D6B0352FD31F520F983CFB9D993 /* UIAlertView+AnyPromise.m in Sources */, + EB3C88CDAF122BA763FEF85758370C7C /* UIAlertView+Promise.swift in Sources */, + 4C22563311AC2B52651A6525A979E076 /* UIView+AnyPromise.m in Sources */, + D1735D6C4D574339EB49024228448459 /* UIView+Promise.swift in Sources */, + 60EBBACB76CD5879FB7B9B3E0AA5E2C1 /* UIViewController+AnyPromise.m in Sources */, + C86CE0A47FAD4C9B2929A335D62A179E /* UIViewController+Promise.swift in Sources */, + CE225CF07E6E385F014883D607AFA44D /* URLDataPromise.swift in Sources */, + CB2A58CBAB5A2E63D0CB70F2697CAE87 /* when.m in Sources */, + ED30A8B82BA1D53CBC370B1DC18DA1EB /* when.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 44321F32F148EB47FF23494889576DF5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -907,37 +940,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 85A7E0C7933D1BC0EB062F281D1F19AD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DC710F75309F7DFEA3C5AB01E9288681 /* AlamofireImplementations.swift in Sources */, - EB0C1A986BDF161D01919BCCCAE40D7E /* Animal.swift in Sources */, - 4E07AC40078EBB1C88ED8700859F5A1B /* APIHelper.swift in Sources */, - 4827FED90242878355B47A6D34BAABCA /* APIs.swift in Sources */, - 33326318BF830A838DA62D54ADAA5ECA /* Cat.swift in Sources */, - 7C87E63D6733AC0FE083373A5FAF86CB /* Category.swift in Sources */, - CE7DAD64CE27C4B98432BDB1CB0E21C7 /* Dog.swift in Sources */, - 2308448E8874D3DAA33A1AEFEFCFBA2D /* Extensions.swift in Sources */, - 8955A9B8A34594437C8D27C4C55BFC9E /* FormatTest.swift in Sources */, - AA38773839F0E81980834A7A374BA9DC /* InlineResponse200.swift in Sources */, - 10E93502CF9CED0B6341DB95B658F2F9 /* Model200Response.swift in Sources */, - 7DAC8F56FC00F6400AC3BF3AF79ACAFD /* ModelReturn.swift in Sources */, - 5EECE3F98893B2D4E03DC027C57C21F3 /* Models.swift in Sources */, - D1E26E1C25F870E9A0AEC9240E589D75 /* Name.swift in Sources */, - 623677B20997F5EC0F6CA695CADD410B /* ObjectReturn.swift in Sources */, - F4448E76D51EBACC2B20CDFE3D2D90D7 /* Order.swift in Sources */, - E3AB1EE3B8DECE5D55D9EB64B0D05E93 /* Pet.swift in Sources */, - F3D3D4088EDA3359CC0E5EBA9B683959 /* PetAPI.swift in Sources */, - 92EEF6DC60C3CA25AA3997D2652A28F9 /* PetstoreClient-dummy.m in Sources */, - 14FD108A5B931460A799BDCB874A99C3 /* SpecialModelName.swift in Sources */, - 41C531C4CEDCAE196A6F92FEAE66CCF3 /* StoreAPI.swift in Sources */, - B9096C0EE89EC783BDDC77E1F07314E4 /* Tag.swift in Sources */, - 895CB65D12461DA4EA243ACE8346D21F /* User.swift in Sources */, - 0B0F79070CD75DE3CF053E58B491A3AC /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 91F4D6732A1613C9660866E34445A67B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -946,48 +948,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - E0A9A1079F8923D78CC7F6D7F87CD779 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2DF2D3E610EB6F19375570C0EBA9E77F /* after.m in Sources */, - B0AB13A8C68D6972CEDF64FB39D38CB4 /* after.swift in Sources */, - E1EB5507436EFBD58AF7B9FF051A5AC4 /* afterlife.swift in Sources */, - BEE4B5067218AB107DDECC8B09569EFC /* AnyPromise.m in Sources */, - 38FE2977C973FA258977E86E1E964E02 /* AnyPromise.swift in Sources */, - BC9F5678D442E5AA1B14083554B7B1C8 /* CALayer+AnyPromise.m in Sources */, - 9E7DA5C2386E5EA1D57B8C9A38D0A509 /* dispatch_promise.m in Sources */, - A5EBC0528F4371B43BFA5A2293089BB5 /* dispatch_promise.swift in Sources */, - F4E24EB57CB59F112060100A4B9E5D10 /* Error.swift in Sources */, - D39F4FBEE42A57E59471B2A0997FE4CF /* hang.m in Sources */, - 7CE6DE14AB43CB51B4D5C5BA4293C47B /* join.m in Sources */, - 72B2C8A6E81C1E99E6093BE3BDBDE554 /* join.swift in Sources */, - 445F515F4FAB3537878E1377562BBBA7 /* NSNotificationCenter+AnyPromise.m in Sources */, - F4C2BD51185019A010DA83458B007F81 /* NSNotificationCenter+Promise.swift in Sources */, - 8809E3D6CC478B4AC9FA6C2389A5447F /* NSObject+Promise.swift in Sources */, - 8C749DAB8EA0585A7A5769F38CB33CBC /* NSURLConnection+AnyPromise.m in Sources */, - 7120EA2BF0D3942FF9CE0EDABBF86BA1 /* NSURLConnection+Promise.swift in Sources */, - BCCC0421EE641F782CA295FBD240E2E1 /* NSURLSession+Promise.swift in Sources */, - 82BEAE7085889DB1A860FE690273EA7E /* PMKAlertController.swift in Sources */, - D839A38DEEDDB887F186714D75E73431 /* Promise+Properties.swift in Sources */, - 994580EAAB3547FFCA0E969378A7AC2E /* Promise.swift in Sources */, - 5E46AC6FA35723E095C2EB6ED23C0510 /* PromiseKit-dummy.m in Sources */, - 81970BD13A497C0962CBEA922C1DAB3E /* race.swift in Sources */, - D2C7190FC2A0F2868EB7C89F5CFA526B /* State.swift in Sources */, - D57DA5AC37CE3CEA92958C9528F80FD9 /* UIActionSheet+AnyPromise.m in Sources */, - AC6DCF4BF95F44A46CF6BC9230AD6604 /* UIActionSheet+Promise.swift in Sources */, - 655C3826275A76D04835F2336AC87A91 /* UIAlertView+AnyPromise.m in Sources */, - 5FDCAFE73B791C4A4B863C9D65F6CF7B /* UIAlertView+Promise.swift in Sources */, - FF5CD62C722D6A68AD65462B56D7CB72 /* UIView+AnyPromise.m in Sources */, - 660435DF96CE68B3A3E078030C5F54FA /* UIView+Promise.swift in Sources */, - C5EEED0AFF5E2C5AAE2A646689B73DA3 /* UIViewController+AnyPromise.m in Sources */, - 7D38A3624822DA504D0FBD9F4EA485BA /* UIViewController+Promise.swift in Sources */, - B2C0216914777E4B58E1827D854886C2 /* URLDataPromise.swift in Sources */, - 1A4D55F76DCB3489302BC425F4DB1C04 /* when.m in Sources */, - DCFE64070EE0BB77557935AD2A4ABF62 /* when.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; EF659EFF40D426A3A32A82CDB98CC6EE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1016,19 +976,13 @@ 2673248EF608AB8375FABCFDA8141072 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PetstoreClient; - target = 57958C5706F810052A634C1714567A9F /* PetstoreClient */; + target = 2FD913B4E24277823983BABFDB071664 /* PetstoreClient */; targetProxy = 014385BD85FA83B60A03ADE9E8844F33 /* PBXContainerItemProxy */; }; - 38BE3993D1A8CA768731BA0465C21F17 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PromiseKit; - target = D9A01D449983C8E3EF61C0CA4A7D8F59 /* PromiseKit */; - targetProxy = EEB067570D28F14A138B737F596BCB1A /* PBXContainerItemProxy */; - }; 5433AD51A3DC696530C96B8A7D78ED7D /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PromiseKit; - target = D9A01D449983C8E3EF61C0CA4A7D8F59 /* PromiseKit */; + target = 25EDA9CFC641C69402B3857A2C4A39F0 /* PromiseKit */; targetProxy = B5FB8931CDF8801206EDD2FEF94793BF /* PBXContainerItemProxy */; }; 64142DAEC5D96F7E876BBE00917C0E9D /* PBXTargetDependency */ = { @@ -1037,17 +991,11 @@ target = 432ECC54282C84882B482CCB4CF227FC /* Alamofire */; targetProxy = 769630CDAAA8C24AA5B4C81A85C45AC8 /* PBXContainerItemProxy */; }; - A48A5E27A5C878B373F0FE7365829141 /* PBXTargetDependency */ = { + C893B48B47F4A7541102DAAFECFC50F2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = OMGHTTPURLRQ; target = 190ACD3A51BC90B85EADB13E9CDD207B /* OMGHTTPURLRQ */; - targetProxy = 23252B1F29F10BD972ECD7BA34F20EA8 /* PBXContainerItemProxy */; - }; - F6093ED00F5D11A44F55549F1A4C778F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 432ECC54282C84882B482CCB4CF227FC /* Alamofire */; - targetProxy = 56AF0748FFC13AD34ECC967C04930EF8 /* PBXContainerItemProxy */; + targetProxy = 8059767A82D94C9F7F7C16D030819C4E /* PBXContainerItemProxy */; }; F74DEE1C89F05CC835997330B0E3B7C1 /* PBXTargetDependency */ = { isa = PBXTargetDependency; @@ -1055,6 +1003,18 @@ target = 190ACD3A51BC90B85EADB13E9CDD207B /* OMGHTTPURLRQ */; targetProxy = 9AD20158D23CE70A2A91E5B7859090C3 /* PBXContainerItemProxy */; }; + FAC5685F6C40E5D74404831646CBC453 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PromiseKit; + target = 25EDA9CFC641C69402B3857A2C4A39F0 /* PromiseKit */; + targetProxy = ECAC5E4454026C822004659466983ADD /* PBXContainerItemProxy */; + }; + FC9E3FF49D9B636B2925749B2D51A5D3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 432ECC54282C84882B482CCB4CF227FC /* Alamofire */; + targetProxy = 4BED27A854EA6600536518D29BBB3670 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -1085,6 +1045,33 @@ }; name = Release; }; + 10966F49AC953FB6BFDCBF072AF5B251 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 1361791756A3908370041AE99E5CF772 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */; @@ -1171,34 +1158,7 @@ }; name = Release; }; - 6FD241CD58AB51A79661DD6FAEA92DBD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 80A78EC79E146B38BA17527C9588FE35 /* Release */ = { + 7B7ACBE5930AD378A2346DC89BAD1027 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CC49FF2A84C0E0E9349747D94036B728 /* PromiseKit.xcconfig */; buildSettings = { @@ -1215,15 +1175,16 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; + MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_NAME = PromiseKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; 819D3D3D508154D9CFF3CE30C13E000E /* Debug */ = { isa = XCBuildConfiguration; @@ -1291,35 +1252,7 @@ }; name = Debug; }; - AE41315F8FBD1AB94C4250498DEAAFE5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CC49FF2A84C0E0E9349747D94036B728 /* PromiseKit.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PromiseKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - BA9437D357EA08C2BE7C3B5F7555E7E7 /* Debug */ = { + 94652EA7B5323CE393BCE396E7262170 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; buildSettings = { @@ -1347,6 +1280,33 @@ }; name = Debug; }; + ADB2280332CE02FCD777CC987CD4E28A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CC49FF2A84C0E0E9349747D94036B728 /* PromiseKit.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = PromiseKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; C5A18280E9321A9268D1C80B7DA43967 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1414,6 +1374,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 03DDC7D7BA248863E8493F462ABAD118 /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7B7ACBE5930AD378A2346DC89BAD1027 /* Debug */, + ADB2280332CE02FCD777CC987CD4E28A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1450,20 +1419,11 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C36F9DFB9BBE472AD46194868C8F885B /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + B5E28E2093F917340AF5AAA0FCE5E37D /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - BA9437D357EA08C2BE7C3B5F7555E7E7 /* Debug */, - 6FD241CD58AB51A79661DD6FAEA92DBD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - FCAE2E57B1A9453B9D35EF9071C4C581 /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AE41315F8FBD1AB94C4250498DEAAFE5 /* Debug */, - 80A78EC79E146B38BA17527C9588FE35 /* Release */, + 94652EA7B5323CE393BCE396E7262170 /* Debug */, + 10966F49AC953FB6BFDCBF072AF5B251 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift/git_push.sh b/samples/client/petstore/swift/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/swift/git_push.sh +++ b/samples/client/petstore/swift/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/typescript-angular/API/Client/PetApi.ts b/samples/client/petstore/typescript-angular/API/Client/PetApi.ts index d11e0d780ed..62492c17d80 100644 --- a/samples/client/petstore/typescript-angular/API/Client/PetApi.ts +++ b/samples/client/petstore/typescript-angular/API/Client/PetApi.ts @@ -41,36 +41,7 @@ namespace API.Client { url: localVarPath, json: true, data: body, - - - params: queryParameters, - headers: headerParams - }; - - if (extraHttpRequestParams) { - httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams); - } - - return this.$http(httpRequestParams); - } - /** - * Fake endpoint to test byte array in body parameter for adding a new pet to the store - * - * @param body Pet object in the form of byte array - */ - public addPetUsingByteArray (body?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { - const localVarPath = this.basePath + '/pet?testing_byte_array=true'; - - let queryParameters: any = {}; - let headerParams: any = this.extendObj({}, this.defaultHeaders); - let httpRequestParams: any = { - method: 'POST', - url: localVarPath, - json: true, - data: body, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -102,9 +73,7 @@ namespace API.Client { method: 'DELETE', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -116,8 +85,8 @@ namespace API.Client { } /** * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for query + * Multiple status values can be provided with comma seperated strings + * @param status Status values that need to be considered for filter */ public findPetsByStatus (status?: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> { const localVarPath = this.basePath + '/pet/findByStatus'; @@ -132,9 +101,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -162,9 +129,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -193,71 +158,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, - headers: headerParams - }; - - if (extraHttpRequestParams) { - httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams); - } - - return this.$http(httpRequestParams); - } - /** - * Fake endpoint to test inline arbitrary object return by '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 getPetByIdInObject (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { - const localVarPath = this.basePath + '/pet/{petId}?response=inline_arbitrary_object' - .replace('{' + 'petId' + '}', String(petId)); - - let queryParameters: any = {}; - let headerParams: any = this.extendObj({}, this.defaultHeaders); - // verify required parameter 'petId' is set - if (!petId) { - throw new Error('Missing required parameter petId when calling getPetByIdInObject'); - } - let httpRequestParams: any = { - method: 'GET', - url: localVarPath, - json: true, - - - params: queryParameters, - headers: headerParams - }; - - if (extraHttpRequestParams) { - httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams); - } - - return this.$http(httpRequestParams); - } - /** - * Fake endpoint to test byte array return by '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 petPetIdtestingByteArraytrueGet (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { - const localVarPath = this.basePath + '/pet/{petId}?testing_byte_array=true' - .replace('{' + 'petId' + '}', String(petId)); - - let queryParameters: any = {}; - let headerParams: any = this.extendObj({}, this.defaultHeaders); - // verify required parameter 'petId' is set - if (!petId) { - throw new Error('Missing required parameter petId when calling petPetIdtestingByteArraytrueGet'); - } - let httpRequestParams: any = { - method: 'GET', - url: localVarPath, - json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -282,9 +183,7 @@ namespace API.Client { url: localVarPath, json: true, data: body, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -323,9 +222,7 @@ namespace API.Client { method: 'POST', url: localVarPath, json: false, - - data: this.$httpParamSerializer(formParams), - + data: this.$httpParamSerializer(formParams), params: queryParameters, headers: headerParams }; @@ -365,9 +262,7 @@ namespace API.Client { method: 'POST', url: localVarPath, json: false, - - data: this.$httpParamSerializer(formParams), - + data: this.$httpParamSerializer(formParams), params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angular/API/Client/StoreApi.ts b/samples/client/petstore/typescript-angular/API/Client/StoreApi.ts index 193e12fe5e5..976ee7acd48 100644 --- a/samples/client/petstore/typescript-angular/API/Client/StoreApi.ts +++ b/samples/client/petstore/typescript-angular/API/Client/StoreApi.ts @@ -45,39 +45,7 @@ namespace API.Client { method: 'DELETE', url: localVarPath, json: true, - - - params: queryParameters, - headers: headerParams - }; - - if (extraHttpRequestParams) { - httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams); - } - - return this.$http(httpRequestParams); - } - /** - * Finds orders by status - * A single status value can be provided as a string - * @param status Status value that needs to be considered for query - */ - public findOrdersByStatus (status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise> { - const localVarPath = this.basePath + '/store/findByStatus'; - - let queryParameters: any = {}; - let headerParams: any = this.extendObj({}, this.defaultHeaders); - if (status !== undefined) { - queryParameters['status'] = status; - } - - let httpRequestParams: any = { - method: 'GET', - url: localVarPath, - json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -100,34 +68,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, - headers: headerParams - }; - - if (extraHttpRequestParams) { - httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams); - } - - return this.$http(httpRequestParams); - } - /** - * Fake endpoint to test arbitrary object return by 'Get inventory' - * Returns an arbitrary object which is actually a map of status codes to quantities - */ - public getInventoryInObject (extraHttpRequestParams?: any ) : ng.IHttpPromise { - const localVarPath = this.basePath + '/store/inventory?response=arbitrary_object'; - - let queryParameters: any = {}; - let headerParams: any = this.extendObj({}, this.defaultHeaders); - let httpRequestParams: any = { - method: 'GET', - url: localVarPath, - json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -139,7 +80,7 @@ namespace API.Client { } /** * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * 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, extraHttpRequestParams?: any ) : ng.IHttpPromise { @@ -156,9 +97,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -183,9 +122,7 @@ namespace API.Client { url: localVarPath, json: true, data: body, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angular/API/Client/UserApi.ts b/samples/client/petstore/typescript-angular/API/Client/UserApi.ts index c1111e146ad..79f6326b99c 100644 --- a/samples/client/petstore/typescript-angular/API/Client/UserApi.ts +++ b/samples/client/petstore/typescript-angular/API/Client/UserApi.ts @@ -41,9 +41,7 @@ namespace API.Client { url: localVarPath, json: true, data: body, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -68,9 +66,7 @@ namespace API.Client { url: localVarPath, json: true, data: body, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -95,9 +91,7 @@ namespace API.Client { url: localVarPath, json: true, data: body, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -126,9 +120,7 @@ namespace API.Client { method: 'DELETE', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -141,7 +133,7 @@ namespace API.Client { /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/user/{username}' @@ -157,9 +149,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -192,9 +182,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -217,9 +205,7 @@ namespace API.Client { method: 'GET', url: localVarPath, json: true, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; @@ -250,9 +236,7 @@ namespace API.Client { url: localVarPath, json: true, data: body, - - - params: queryParameters, + params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angular/API/Client/api.d.ts b/samples/client/petstore/typescript-angular/API/Client/api.d.ts index c9e5e7a2f57..f2a86d96e96 100644 --- a/samples/client/petstore/typescript-angular/API/Client/api.d.ts +++ b/samples/client/petstore/typescript-angular/API/Client/api.d.ts @@ -1,11 +1,6 @@ /// -/// -/// -/// -/// /// /// -/// /// /// diff --git a/samples/client/petstore/typescript-angular/git_push.sh b/samples/client/petstore/typescript-angular/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/typescript-angular/git_push.sh +++ b/samples/client/petstore/typescript-angular/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index 3e25b5e718c..c2bd53e8ca2 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -129,8 +129,8 @@ export class PetApi { protected authentications = { 'default': new VoidAuth(), - 'petstore_auth': new OAuth(), 'api_key': new ApiKeyAuth('header', 'api_key'), + 'petstore_auth': new OAuth(), } constructor(basePath?: string); @@ -409,10 +409,10 @@ export class PetApi { json: true, } - this.authentications.petstore_auth.applyToRequest(requestOptions); - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { @@ -632,8 +632,8 @@ export class StoreApi { protected authentications = { 'default': new VoidAuth(), - 'petstore_auth': new OAuth(), 'api_key': new ApiKeyAuth('header', 'api_key'), + 'petstore_auth': new OAuth(), } constructor(basePath?: string); @@ -881,8 +881,8 @@ export class UserApi { protected authentications = { 'default': new VoidAuth(), - 'petstore_auth': new OAuth(), 'api_key': new ApiKeyAuth('header', 'api_key'), + 'petstore_auth': new OAuth(), } constructor(basePath?: string); diff --git a/samples/client/petstore/typescript-node/default/git_push.sh b/samples/client/petstore/typescript-node/default/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/typescript-node/default/git_push.sh +++ b/samples/client/petstore/typescript-node/default/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index 3e25b5e718c..c2bd53e8ca2 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -129,8 +129,8 @@ export class PetApi { protected authentications = { 'default': new VoidAuth(), - 'petstore_auth': new OAuth(), 'api_key': new ApiKeyAuth('header', 'api_key'), + 'petstore_auth': new OAuth(), } constructor(basePath?: string); @@ -409,10 +409,10 @@ export class PetApi { json: true, } - this.authentications.petstore_auth.applyToRequest(requestOptions); - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { @@ -632,8 +632,8 @@ export class StoreApi { protected authentications = { 'default': new VoidAuth(), - 'petstore_auth': new OAuth(), 'api_key': new ApiKeyAuth('header', 'api_key'), + 'petstore_auth': new OAuth(), } constructor(basePath?: string); @@ -881,8 +881,8 @@ export class UserApi { protected authentications = { 'default': new VoidAuth(), - 'petstore_auth': new OAuth(), 'api_key': new ApiKeyAuth('header', 'api_key'), + 'petstore_auth': new OAuth(), } constructor(basePath?: string); diff --git a/samples/client/petstore/typescript-node/npm/git_push.sh b/samples/client/petstore/typescript-node/npm/git_push.sh index 1a36388db02..ed374619b13 100644 --- a/samples/client/petstore/typescript-node/npm/git_push.sh +++ b/samples/client/petstore/typescript-node/npm/git_push.sh @@ -8,12 +8,12 @@ git_repo_id=$2 release_note=$3 if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" + git_user_id="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="YOUR_GIT_REPO_ID" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/samples/client/petstore/typescript-node/npm/package.json b/samples/client/petstore/typescript-node/npm/package.json index 67a7cc03a36..5654c9ed4a3 100644 --- a/samples/client/petstore/typescript-node/npm/package.json +++ b/samples/client/petstore/typescript-node/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201604282147", + "version": "0.0.1-SNAPSHOT.201605022215", "description": "NodeJS client for @swagger/angular2-typescript-petstore", "main": "api.js", "scripts": { diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiException.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiException.java index 24a37938400..269b2e95c5e 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiException.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class ApiException extends Exception{ private int code; public ApiException (int code, String msg) { diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiOriginFilter.java index 48b4d658725..a12422230ec 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiOriginFilter.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiOriginFilter.java @@ -5,7 +5,7 @@ import java.io.IOException; import javax.servlet.*; import javax.servlet.http.HttpServletResponse; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class ApiOriginFilter implements javax.servlet.Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiResponseMessage.java index b1b2df77e20..43cc54796d5 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiResponseMessage.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiResponseMessage.java @@ -3,7 +3,7 @@ package io.swagger.api; import javax.xml.bind.annotation.XmlTransient; @javax.xml.bind.annotation.XmlRootElement -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class ApiResponseMessage { public static final int ERROR = 1; public static final int WARNING = 2; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/NotFoundException.java index 77bd497a379..a367cfec514 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/NotFoundException.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/NotFoundException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class NotFoundException extends ApiException { private int code; public NotFoundException (int code, String msg) { diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApi.java index 11870e95f1e..6e360c1e23f 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApi.java @@ -22,7 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; @Path("/pet") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class PetApi { private final PetApiService delegate = PetApiServiceFactory.getPetApi(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApiService.java index def447f5695..f1a3e2465c2 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApiService.java @@ -17,7 +17,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public abstract class PetApiService { public abstract Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApi.java index dea36a07275..ed21293f466 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApi.java @@ -20,7 +20,7 @@ import javax.ws.rs.*; @Path("/store") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApiService.java index dc740cd491d..52ea6fba817 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApiService.java @@ -15,7 +15,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public abstract class StoreApiService { public abstract Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StringUtil.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StringUtil.java index 0cfee024b00..2fce17c06ce 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StringUtil.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApi.java index 02e6d6b24da..55bd0c185d9 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApi.java @@ -20,7 +20,7 @@ import javax.ws.rs.*; @Path("/user") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class UserApi { private final UserApiService delegate = UserApiServiceFactory.getUserApi(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApiService.java index e900b146061..ea30abb522f 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApiService.java @@ -15,7 +15,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public abstract class UserApiService { public abstract Response createUser(User body,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Category.java index bfeecafe689..165fce2a49d 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Category.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class Category { private Long id = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/ModelApiResponse.java index a46b64b8bbd..8c1bdbf106e 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class ModelApiResponse { private Integer code = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Order.java index e8af2984ef9..f33876b9c65 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Order.java @@ -9,7 +9,7 @@ import java.util.Date; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class Order { private Long id = null; @@ -17,12 +17,15 @@ public class Order { private Integer quantity = null; private Date shipDate = null; - + /** + * Order Status + */ public enum StatusEnum { PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); + APPROVED("approved"), + + DELIVERED("delivered"); private String value; StatusEnum(String value) { @@ -32,7 +35,7 @@ public class Order { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Pet.java index 740ed352c9d..a14c7269931 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Pet.java @@ -11,7 +11,7 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class Pet { private Long id = null; @@ -20,12 +20,15 @@ public class Pet { private List photoUrls = new ArrayList(); private List tags = new ArrayList(); - + /** + * pet status in the store + */ public enum StatusEnum { AVAILABLE("available"), - PENDING("pending"), - SOLD("sold"); + PENDING("pending"), + + SOLD("sold"); private String value; StatusEnum(String value) { @@ -35,7 +38,7 @@ public class Pet { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Tag.java index 0a7e01df75b..74ec375d7e2 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Tag.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class Tag { private Long id = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/User.java index 3c144892193..f01215a829e 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/User.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T19:32:21.945+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") public class User { private Long id = null; diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java index 825fa282b8b..fd36213d128 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java @@ -19,12 +19,15 @@ public class Order { private Integer quantity = null; private Date shipDate = null; - + /** + * Order Status + */ public enum StatusEnum { PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); + APPROVED("approved"), + + DELIVERED("delivered"); private String value; StatusEnum(String value) { @@ -34,7 +37,7 @@ public class Order { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java index 24092cbee25..69fe2ca44db 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java @@ -23,12 +23,15 @@ public class Pet { private List photoUrls = new ArrayList(); private List tags = new ArrayList(); - + /** + * pet status in the store + */ public enum StatusEnum { AVAILABLE("available"), - PENDING("pending"), - SOLD("sold"); + PENDING("pending"), + + SOLD("sold"); private String value; StatusEnum(String value) { @@ -38,7 +41,7 @@ public class Pet { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } diff --git a/samples/server/petstore/jersey2/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jersey2/src/gen/java/io/swagger/model/Pet.java index 514bb24508d..64032c00f8b 100644 --- a/samples/server/petstore/jersey2/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jersey2/src/gen/java/io/swagger/model/Pet.java @@ -1,29 +1,30 @@ -package io.swagger.model; +package io.swagger.client.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.swagger.model.Category; -import io.swagger.model.Tag; +import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; - - - - -public class Pet { +/** + * InlineResponse200 + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T22:48:50.833+08:00") +public class InlineResponse200 { - private Long id = null; - private Category category = null; - private String name = null; private List photoUrls = new ArrayList(); + private String name = null; + private Long id = null; + private Object category = null; private List tags = new ArrayList(); - + /** + * pet status in the store + */ public enum StatusEnum { AVAILABLE("available"), PENDING("pending"), @@ -38,7 +39,7 @@ public class Pet { @Override @JsonValue public String toString() { - return value; + return String.valueOf(value); } } @@ -47,67 +48,12 @@ public class Pet { /** **/ - public Pet id(Long id) { - this.id = id; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - - /** - **/ - public Pet category(Category category) { - this.category = category; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("category") - public Category getCategory() { - return category; - } - public void setCategory(Category category) { - this.category = category; - } - - - /** - **/ - public Pet name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - /** - **/ - public Pet photoUrls(List photoUrls) { + public InlineResponse200 photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } - - @ApiModelProperty(required = true, value = "") + @ApiModelProperty(example = "null", value = "") @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; @@ -119,13 +65,63 @@ public class Pet { /** **/ - public Pet tags(List tags) { - this.tags = tags; + public InlineResponse200 name(String name) { + this.name = name; return this; } + + @ApiModelProperty(example = "doggie", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - @ApiModelProperty(value = "") + /** + **/ + public InlineResponse200 id(Long id) { + this.id = id; + return this; + } + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + + /** + **/ + public InlineResponse200 category(Object category) { + this.category = category; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Object getCategory() { + return category; + } + public void setCategory(Object category) { + this.category = category; + } + + + /** + **/ + public InlineResponse200 tags(List tags) { + this.tags = tags; + return this; + } + + @ApiModelProperty(example = "null", value = "") @JsonProperty("tags") public List getTags() { return tags; @@ -138,13 +134,12 @@ public class Pet { /** * pet status in the store **/ - public Pet status(StatusEnum status) { + public InlineResponse200 status(StatusEnum status) { this.status = status; return this; } - - @ApiModelProperty(value = "pet status in the store") + @ApiModelProperty(example = "null", value = "pet status in the store") @JsonProperty("status") public StatusEnum getStatus() { return status; @@ -156,36 +151,36 @@ public class Pet { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } - Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); + InlineResponse200 inlineResponse200 = (InlineResponse200) o; + return Objects.equals(this.photoUrls, inlineResponse200.photoUrls) && + Objects.equals(this.name, inlineResponse200.name) && + Objects.equals(this.id, inlineResponse200.id) && + Objects.equals(this.category, inlineResponse200.category) && + Objects.equals(this.tags, inlineResponse200.tags) && + Objects.equals(this.status, inlineResponse200.status); } @Override public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); + return Objects.hash(photoUrls, name, id, category, tags, status); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); + sb.append("class InlineResponse200 {\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}"); @@ -196,7 +191,7 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; }