diff --git a/README.md b/README.md
index 1d97c7675d8c..5d43198847dc 100644
--- a/README.md
+++ b/README.md
@@ -790,6 +790,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
- [uShip](https://www.uship.com/)
- [Zalando](https://tech.zalando.com)
- [ZEEF.com](https://zeef.com/)
+- [REstore](https://www.restore.eu)
License
-------
diff --git a/bin/all-petstore.sh b/bin/all-petstore.sh
index af322af4820e..2bb63f6d573f 100755
--- a/bin/all-petstore.sh
+++ b/bin/all-petstore.sh
@@ -49,5 +49,6 @@ cd $APP_DIR
./bin/tizen-petstore.sh
./bin/typescript-angular-petstore.sh
./bin/typescript-angular2-petstore.sh
+./bin/typescript-angular2-petstore-with-npm.sh
./bin/typescript-node-petstore.sh
./bin/lumen-petstore-server.sh
\ No newline at end of file
diff --git a/bin/go-petstore.sh b/bin/go-petstore.sh
index 35c5c0e60642..eea1aaaf6f3d 100755
--- a/bin/go-petstore.sh
+++ b/bin/go-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/go -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l go -o samples/client/petstore/go/go-petstore"
+ags="$@ generate -t modules/swagger-codegen/src/main/resources/go -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l go -o samples/client/petstore/go/go-petstore -DpackageName=petstore "
java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/typescript-angular2-petstore-with-npm.sh b/bin/typescript-angular2-petstore-with-npm.sh
index 9e455715b01d..305a3e0b39de 100755
--- a/bin/typescript-angular2-petstore-with-npm.sh
+++ b/bin/typescript-angular2-petstore-with-npm.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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -c bin/typescript-angular2-petstore-with-npm.json -o samples/client/petstore/typescript-angular2-with-npm"
+ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular2/npm"
java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/typescript-angular2-petstore.sh b/bin/typescript-angular2-petstore.sh
index 4ad341f64f8f..f26dd0f668f2 100755
--- a/bin/typescript-angular2-petstore.sh
+++ b/bin/typescript-angular2-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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2"
+ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2/default"
java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/typescript-node-petstore-with-npm.sh b/bin/typescript-node-petstore-with-npm.sh
new file mode 100755
index 000000000000..e369be758e7b
--- /dev/null
+++ b/bin/typescript-node-petstore-with-npm.sh
@@ -0,0 +1,31 @@
+#!/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.json -l typescript-node -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-node/npm"
+
+java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/typescript-node-petstore.sh b/bin/typescript-node-petstore.sh
index 53c5a6f8d828..c9d16d961133 100755
--- a/bin/typescript-node-petstore.sh
+++ b/bin/typescript-node-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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-node -o samples/client/petstore/typescript-node"
+ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-node -o samples/client/petstore/typescript-node/default"
java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/typescript-angular2-petstore-with-npm.json b/bin/typescript-petstore-npm.json
similarity index 100%
rename from bin/typescript-angular2-petstore-with-npm.json
rename to bin/typescript-petstore-npm.json
diff --git a/bin/windows/spring-mvc-petstore-j8-async-server.bat b/bin/windows/spring-mvc-petstore-j8-async-server.bat
new file mode 100644
index 000000000000..601de1ff6f82
--- /dev/null
+++ b/bin/windows/spring-mvc-petstore-j8-async-server.bat
@@ -0,0 +1,10 @@
+set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
+
+If Not Exist %executable% (
+ mvn clean package
+)
+
+set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties
+set ags=generate -t modules\swagger-codegen\src\main\resources\JavaSpringMVC -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l spring-mvc -o samples/server/petstore/spring-mvc-j8-async -c bin/spring-mvc-petstore-j8-async.json
+
+java %JAVA_OPTS% -jar %executable% %ags%
\ No newline at end of file
diff --git a/bin/windows/spring-mvc-petstore-server.bat b/bin/windows/spring-mvc-petstore-server.bat
new file mode 100644
index 000000000000..f4ab64d5bd89
--- /dev/null
+++ b/bin/windows/spring-mvc-petstore-server.bat
@@ -0,0 +1,10 @@
+set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
+
+If Not Exist %executable% (
+ mvn clean package
+)
+
+set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties
+set ags=generate -t modules\swagger-codegen\src\main\resources\JavaSpringMVC -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l spring-mvc -o samples\server\petstore\spring-mvc
+
+java %JAVA_OPTS% -jar %executable% %ags%
\ No newline at end of file
diff --git a/bin/windows/typescript-angular2-with-npm.bat b/bin/windows/typescript-angular2-with-npm.bat
new file mode 100644
index 000000000000..dcbd6df81554
--- /dev/null
+++ b/bin/windows/typescript-angular2-with-npm.bat
@@ -0,0 +1,10 @@
+set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
+
+If Not Exist %executable% (
+ mvn clean package
+)
+
+set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties
+set ags=generate -t modules\swagger-codegen\src\main\resources\typescript-angular -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -c bin/typescript-petstore-npm.json -l typescript-angular2 -o samples\client\petstore\typescript-angular2\npm
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/typescript-angular2.bat b/bin/windows/typescript-angular2.bat
index 7657d184fd15..ce2f0e0dc8c8 100755
--- a/bin/windows/typescript-angular2.bat
+++ b/bin/windows/typescript-angular2.bat
@@ -5,6 +5,6 @@ If Not Exist %executable% (
)
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties
-set ags=generate -t modules\swagger-codegen\src\main\resources\typescript-angular -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l typescript-angular2 -o samples\client\petstore\typescript-angular
+set ags=generate -t modules\swagger-codegen\src\main\resources\typescript-angular -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l typescript-angular2 -o samples\client\petstore\typescript-angular2\default
java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/typescript-node-with-npm.bat b/bin/windows/typescript-node-with-npm.bat
new file mode 100755
index 000000000000..a433181fde97
--- /dev/null
+++ b/bin/windows/typescript-node-with-npm.bat
@@ -0,0 +1,10 @@
+set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
+
+If Not Exist %executable% (
+ mvn clean package
+)
+
+set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties
+set ags=generate -t modules\swagger-codegen\src\main\resources\typescript-node -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -c bin/typescript-petstore-npm.json -l typescript-node -o samples\client\petstore\typescript-node\npm
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/typescript-node.bat b/bin/windows/typescript-node.bat
index b6d47abd1af0..53f8b34e8430 100755
--- a/bin/windows/typescript-node.bat
+++ b/bin/windows/typescript-node.bat
@@ -5,6 +5,6 @@ If Not Exist %executable% (
)
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties
-set ags=generate -t modules\swagger-codegen\src\main\resources\typescript-node -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l typescript-node -o samples\client\petstore\typescript-node
+set ags=generate -t modules\swagger-codegen\src\main\resources\typescript-node -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l typescript-node -o samples\client\petstore\typescript-node\default
java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ClientOpts.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ClientOpts.java
index 9c4d41f7bfdf..1087de5786db 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ClientOpts.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ClientOpts.java
@@ -54,4 +54,33 @@ public class ClientOpts {
sb.append("}");
return sb.toString();
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ClientOpts that = (ClientOpts) o;
+
+ if (uri != null ? !uri.equals(that.uri) : that.uri != null)
+ return false;
+ if (target != null ? !target.equals(that.target) : that.target != null)
+ return false;
+ if (auth != null ? !auth.equals(that.auth) : that.auth != null)
+ return false;
+ if (properties != null ? !properties.equals(that.properties) : that.properties != null)
+ return false;
+ return outputDirectory != null ? outputDirectory.equals(that.outputDirectory) : that.outputDirectory == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = uri != null ? uri.hashCode() : 0;
+ result = 31 * result + (target != null ? target.hashCode() : 0);
+ result = 31 * result + (auth != null ? auth.hashCode() : 0);
+ result = 31 * result + (properties != null ? properties.hashCode() : 0);
+ result = 31 * result + (outputDirectory != null ? outputDirectory.hashCode() : 0);
+ return result;
+ }
}
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 62f5e27aa051..945388b25886 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
@@ -1,7 +1,6 @@
package io.swagger.codegen;
import io.swagger.models.ExternalDocs;
-
import java.util.*;
public class CodegenModel {
@@ -39,4 +38,113 @@ public class CodegenModel {
allVars = vars;
allMandatory = mandatory;
}
+
+ @Override
+ public String toString() {
+ return String.format("%s(%s)", name, classname);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CodegenModel that = (CodegenModel) o;
+
+ if (parent != null ? !parent.equals(that.parent) : that.parent != null)
+ return false;
+ if (parentSchema != null ? !parentSchema.equals(that.parentSchema) : that.parentSchema != null)
+ return false;
+ if (interfaces != null ? !interfaces.equals(that.interfaces) : that.interfaces != null)
+ return false;
+ if (parentModel != null ? !parentModel.equals(that.parentModel) : that.parentModel != null)
+ return false;
+ if (interfaceModels != null ? !interfaceModels.equals(that.interfaceModels) : that.interfaceModels != null)
+ return false;
+ if (name != null ? !name.equals(that.name) : that.name != null)
+ return false;
+ if (classname != null ? !classname.equals(that.classname) : that.classname != null)
+ return false;
+ if (description != null ? !description.equals(that.description) : that.description != null)
+ return false;
+ if (classVarName != null ? !classVarName.equals(that.classVarName) : that.classVarName != null)
+ return false;
+ if (modelJson != null ? !modelJson.equals(that.modelJson) : that.modelJson != null)
+ return false;
+ if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null)
+ return false;
+ if (classFilename != null ? !classFilename.equals(that.classFilename) : that.classFilename != null)
+ return false;
+ if (unescapedDescription != null ? !unescapedDescription.equals(that.unescapedDescription) : that.unescapedDescription != null)
+ return false;
+ if (discriminator != null ? !discriminator.equals(that.discriminator) : that.discriminator != null)
+ return false;
+ if (defaultValue != null ? !defaultValue.equals(that.defaultValue) : that.defaultValue != null)
+ return false;
+ if (vars != null ? !vars.equals(that.vars) : that.vars != null)
+ return false;
+ if (requiredVars != null ? !requiredVars.equals(that.requiredVars) : that.requiredVars != null)
+ return false;
+ if (optionalVars != null ? !optionalVars.equals(that.optionalVars) : that.optionalVars != null)
+ return false;
+ if (allVars != null ? !allVars.equals(that.allVars) : that.allVars != null)
+ return false;
+ if (allowableValues != null ? !allowableValues.equals(that.allowableValues) : that.allowableValues != null)
+ return false;
+ if (mandatory != null ? !mandatory.equals(that.mandatory) : that.mandatory != null)
+ return false;
+ if (allMandatory != null ? !allMandatory.equals(that.allMandatory) : that.allMandatory != null)
+ return false;
+ if (imports != null ? !imports.equals(that.imports) : that.imports != null)
+ return false;
+ if (hasVars != null ? !hasVars.equals(that.hasVars) : that.hasVars != null)
+ return false;
+ if (emptyVars != null ? !emptyVars.equals(that.emptyVars) : that.emptyVars != null)
+ return false;
+ if (hasMoreModels != null ? !hasMoreModels.equals(that.hasMoreModels) : that.hasMoreModels != null)
+ return false;
+ if (hasEnums != null ? !hasEnums.equals(that.hasEnums) : that.hasEnums != null)
+ return false;
+ if (isEnum != null ? !isEnum.equals(that.isEnum) : that.isEnum != null)
+ return false;
+ if (externalDocs != null ? !externalDocs.equals(that.externalDocs) : that.externalDocs != null)
+ return false;
+ return vendorExtensions != null ? vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = parent != null ? parent.hashCode() : 0;
+ result = 31 * result + (parentSchema != null ? parentSchema.hashCode() : 0);
+ result = 31 * result + (interfaces != null ? interfaces.hashCode() : 0);
+ result = 31 * result + (parentModel != null ? parentModel.hashCode() : 0);
+ result = 31 * result + (interfaceModels != null ? interfaceModels.hashCode() : 0);
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (classname != null ? classname.hashCode() : 0);
+ result = 31 * result + (description != null ? description.hashCode() : 0);
+ result = 31 * result + (classVarName != null ? classVarName.hashCode() : 0);
+ result = 31 * result + (modelJson != null ? modelJson.hashCode() : 0);
+ result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
+ result = 31 * result + (classFilename != null ? classFilename.hashCode() : 0);
+ result = 31 * result + (unescapedDescription != null ? unescapedDescription.hashCode() : 0);
+ result = 31 * result + (discriminator != null ? discriminator.hashCode() : 0);
+ result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0);
+ result = 31 * result + (vars != null ? vars.hashCode() : 0);
+ result = 31 * result + (requiredVars != null ? requiredVars.hashCode() : 0);
+ result = 31 * result + (optionalVars != null ? optionalVars.hashCode() : 0);
+ result = 31 * result + (allVars != null ? allVars.hashCode() : 0);
+ result = 31 * result + (allowableValues != null ? allowableValues.hashCode() : 0);
+ result = 31 * result + (mandatory != null ? mandatory.hashCode() : 0);
+ result = 31 * result + (allMandatory != null ? allMandatory.hashCode() : 0);
+ result = 31 * result + (imports != null ? imports.hashCode() : 0);
+ result = 31 * result + (hasVars != null ? hasVars.hashCode() : 0);
+ result = 31 * result + (emptyVars != null ? emptyVars.hashCode() : 0);
+ result = 31 * result + (hasMoreModels != null ? hasMoreModels.hashCode() : 0);
+ result = 31 * result + (hasEnums != null ? hasEnums.hashCode() : 0);
+ result = 31 * result + (isEnum != null ? isEnum.hashCode() : 0);
+ result = 31 * result + (externalDocs != null ? externalDocs.hashCode() : 0);
+ result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
+ return result;
+ }
}
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java
index 2485e657de27..48858a0d5049 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java
@@ -88,4 +88,157 @@ public class CodegenOperation {
return nonempty(formParams);
}
+ @Override
+ public String toString() {
+ return String.format("%s(%s)", baseName, path);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CodegenOperation that = (CodegenOperation) o;
+
+ if (responseHeaders != null ? !responseHeaders.equals(that.responseHeaders) : that.responseHeaders != null)
+ return false;
+ if (hasAuthMethods != null ? !hasAuthMethods.equals(that.hasAuthMethods) : that.hasAuthMethods != null)
+ return false;
+ if (hasConsumes != null ? !hasConsumes.equals(that.hasConsumes) : that.hasConsumes != null)
+ return false;
+ if (hasProduces != null ? !hasProduces.equals(that.hasProduces) : that.hasProduces != null)
+ return false;
+ if (hasParams != null ? !hasParams.equals(that.hasParams) : that.hasParams != null)
+ return false;
+ if (hasOptionalParams != null ? !hasOptionalParams.equals(that.hasOptionalParams) : that.hasOptionalParams != null)
+ return false;
+ if (returnTypeIsPrimitive != null ? !returnTypeIsPrimitive.equals(that.returnTypeIsPrimitive) : that.returnTypeIsPrimitive != null)
+ return false;
+ if (returnSimpleType != null ? !returnSimpleType.equals(that.returnSimpleType) : that.returnSimpleType != null)
+ return false;
+ if (subresourceOperation != null ? !subresourceOperation.equals(that.subresourceOperation) : that.subresourceOperation != null)
+ return false;
+ if (isMapContainer != null ? !isMapContainer.equals(that.isMapContainer) : that.isMapContainer != null)
+ return false;
+ if (isListContainer != null ? !isListContainer.equals(that.isListContainer) : that.isListContainer != null)
+ return false;
+ if (isMultipart != null ? !isMultipart.equals(that.isMultipart) : that.isMultipart != null)
+ return false;
+ if (hasMore != null ? !hasMore.equals(that.hasMore) : that.hasMore != null)
+ return false;
+ if (isResponseBinary != null ? !isResponseBinary.equals(that.isResponseBinary) : that.isResponseBinary != null)
+ return false;
+ if (hasReference != null ? !hasReference.equals(that.hasReference) : that.hasReference != null)
+ return false;
+ if (path != null ? !path.equals(that.path) : that.path != null)
+ return false;
+ if (operationId != null ? !operationId.equals(that.operationId) : that.operationId != null)
+ return false;
+ if (returnType != null ? !returnType.equals(that.returnType) : that.returnType != null)
+ return false;
+ if (httpMethod != null ? !httpMethod.equals(that.httpMethod) : that.httpMethod != null)
+ return false;
+ if (returnBaseType != null ? !returnBaseType.equals(that.returnBaseType) : that.returnBaseType != null)
+ return false;
+ if (returnContainer != null ? !returnContainer.equals(that.returnContainer) : that.returnContainer != null)
+ return false;
+ if (summary != null ? !summary.equals(that.summary) : that.summary != null)
+ return false;
+ if (unescapedNotes != null ? !unescapedNotes.equals(that.unescapedNotes) : that.unescapedNotes != null)
+ return false;
+ if (notes != null ? !notes.equals(that.notes) : that.notes != null)
+ return false;
+ if (baseName != null ? !baseName.equals(that.baseName) : that.baseName != null)
+ return false;
+ if (defaultResponse != null ? !defaultResponse.equals(that.defaultResponse) : that.defaultResponse != null)
+ return false;
+ if (discriminator != null ? !discriminator.equals(that.discriminator) : that.discriminator != null)
+ return false;
+ if (consumes != null ? !consumes.equals(that.consumes) : that.consumes != null)
+ return false;
+ if (produces != null ? !produces.equals(that.produces) : that.produces != null)
+ return false;
+ if (bodyParam != null ? !bodyParam.equals(that.bodyParam) : that.bodyParam != null)
+ return false;
+ if (allParams != null ? !allParams.equals(that.allParams) : that.allParams != null)
+ return false;
+ if (bodyParams != null ? !bodyParams.equals(that.bodyParams) : that.bodyParams != null)
+ return false;
+ if (pathParams != null ? !pathParams.equals(that.pathParams) : that.pathParams != null)
+ return false;
+ if (queryParams != null ? !queryParams.equals(that.queryParams) : that.queryParams != null)
+ return false;
+ if (headerParams != null ? !headerParams.equals(that.headerParams) : that.headerParams != null)
+ return false;
+ if (formParams != null ? !formParams.equals(that.formParams) : that.formParams != null)
+ return false;
+ if (authMethods != null ? !authMethods.equals(that.authMethods) : that.authMethods != null)
+ return false;
+ if (tags != null ? !tags.equals(that.tags) : that.tags != null)
+ return false;
+ if (responses != null ? !responses.equals(that.responses) : that.responses != null)
+ return false;
+ if (imports != null ? !imports.equals(that.imports) : that.imports != null)
+ return false;
+ if (examples != null ? !examples.equals(that.examples) : that.examples != null)
+ return false;
+ if (externalDocs != null ? !externalDocs.equals(that.externalDocs) : that.externalDocs != null)
+ return false;
+ if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null)
+ return false;
+ if (nickname != null ? !nickname.equals(that.nickname) : that.nickname != null)
+ return false;
+ return operationIdLowerCase != null ? operationIdLowerCase.equals(that.operationIdLowerCase) : that.operationIdLowerCase == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = responseHeaders != null ? responseHeaders.hashCode() : 0;
+ result = 31 * result + (hasAuthMethods != null ? hasAuthMethods.hashCode() : 0);
+ result = 31 * result + (hasConsumes != null ? hasConsumes.hashCode() : 0);
+ result = 31 * result + (hasProduces != null ? hasProduces.hashCode() : 0);
+ result = 31 * result + (hasParams != null ? hasParams.hashCode() : 0);
+ result = 31 * result + (hasOptionalParams != null ? hasOptionalParams.hashCode() : 0);
+ result = 31 * result + (returnTypeIsPrimitive != null ? returnTypeIsPrimitive.hashCode() : 0);
+ result = 31 * result + (returnSimpleType != null ? returnSimpleType.hashCode() : 0);
+ result = 31 * result + (subresourceOperation != null ? subresourceOperation.hashCode() : 0);
+ result = 31 * result + (isMapContainer != null ? isMapContainer.hashCode() : 0);
+ result = 31 * result + (isListContainer != null ? isListContainer.hashCode() : 0);
+ result = 31 * result + (isMultipart != null ? isMultipart.hashCode() : 0);
+ result = 31 * result + (hasMore != null ? hasMore.hashCode() : 0);
+ result = 31 * result + (isResponseBinary != null ? isResponseBinary.hashCode() : 0);
+ result = 31 * result + (hasReference != null ? hasReference.hashCode() : 0);
+ result = 31 * result + (path != null ? path.hashCode() : 0);
+ result = 31 * result + (operationId != null ? operationId.hashCode() : 0);
+ result = 31 * result + (returnType != null ? returnType.hashCode() : 0);
+ result = 31 * result + (httpMethod != null ? httpMethod.hashCode() : 0);
+ result = 31 * result + (returnBaseType != null ? returnBaseType.hashCode() : 0);
+ result = 31 * result + (returnContainer != null ? returnContainer.hashCode() : 0);
+ result = 31 * result + (summary != null ? summary.hashCode() : 0);
+ result = 31 * result + (unescapedNotes != null ? unescapedNotes.hashCode() : 0);
+ result = 31 * result + (notes != null ? notes.hashCode() : 0);
+ result = 31 * result + (baseName != null ? baseName.hashCode() : 0);
+ result = 31 * result + (defaultResponse != null ? defaultResponse.hashCode() : 0);
+ result = 31 * result + (discriminator != null ? discriminator.hashCode() : 0);
+ result = 31 * result + (consumes != null ? consumes.hashCode() : 0);
+ result = 31 * result + (produces != null ? produces.hashCode() : 0);
+ result = 31 * result + (bodyParam != null ? bodyParam.hashCode() : 0);
+ result = 31 * result + (allParams != null ? allParams.hashCode() : 0);
+ result = 31 * result + (bodyParams != null ? bodyParams.hashCode() : 0);
+ result = 31 * result + (pathParams != null ? pathParams.hashCode() : 0);
+ result = 31 * result + (queryParams != null ? queryParams.hashCode() : 0);
+ result = 31 * result + (headerParams != null ? headerParams.hashCode() : 0);
+ result = 31 * result + (formParams != null ? formParams.hashCode() : 0);
+ result = 31 * result + (authMethods != null ? authMethods.hashCode() : 0);
+ result = 31 * result + (tags != null ? tags.hashCode() : 0);
+ result = 31 * result + (responses != null ? responses.hashCode() : 0);
+ result = 31 * result + (imports != null ? imports.hashCode() : 0);
+ result = 31 * result + (examples != null ? examples.hashCode() : 0);
+ result = 31 * result + (externalDocs != null ? externalDocs.hashCode() : 0);
+ result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
+ result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
+ result = 31 * result + (operationIdLowerCase != null ? operationIdLowerCase.hashCode() : 0);
+ return result;
+ }
}
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java
index 3f38d391e703..a69f71971813 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java
@@ -137,5 +137,185 @@ public class CodegenParameter {
return output;
}
+
+ @Override
+ public String toString() {
+ return String.format("%s(%s)", baseName, dataType);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CodegenParameter that = (CodegenParameter) o;
+
+ if (isEnum != that.isEnum) return false;
+ if (isFormParam != null ? !isFormParam.equals(that.isFormParam) : that.isFormParam != null)
+ return false;
+ if (isQueryParam != null ? !isQueryParam.equals(that.isQueryParam) : that.isQueryParam != null)
+ return false;
+ if (isPathParam != null ? !isPathParam.equals(that.isPathParam) : that.isPathParam != null)
+ return false;
+ if (isHeaderParam != null ? !isHeaderParam.equals(that.isHeaderParam) : that.isHeaderParam != null)
+ return false;
+ if (isCookieParam != null ? !isCookieParam.equals(that.isCookieParam) : that.isCookieParam != null)
+ return false;
+ if (isBodyParam != null ? !isBodyParam.equals(that.isBodyParam) : that.isBodyParam != null)
+ return false;
+ if (hasMore != null ? !hasMore.equals(that.hasMore) : that.hasMore != null)
+ return false;
+ if (isContainer != null ? !isContainer.equals(that.isContainer) : that.isContainer != null)
+ return false;
+ if (secondaryParam != null ? !secondaryParam.equals(that.secondaryParam) : that.secondaryParam != null)
+ return false;
+ if (isCollectionFormatMulti != null ? !isCollectionFormatMulti.equals(that.isCollectionFormatMulti) : that.isCollectionFormatMulti != null)
+ return false;
+ if (isPrimitiveType != null ? !isPrimitiveType.equals(that.isPrimitiveType) : that.isPrimitiveType != null)
+ return false;
+ if (baseName != null ? !baseName.equals(that.baseName) : that.baseName != null)
+ return false;
+ if (paramName != null ? !paramName.equals(that.paramName) : that.paramName != null)
+ return false;
+ if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null)
+ return false;
+ if (datatypeWithEnum != null ? !datatypeWithEnum.equals(that.datatypeWithEnum) : that.datatypeWithEnum != null)
+ return false;
+ if (collectionFormat != null ? !collectionFormat.equals(that.collectionFormat) : that.collectionFormat != null)
+ return false;
+ if (description != null ? !description.equals(that.description) : that.description != null)
+ return false;
+ if (unescapedDescription != null ? !unescapedDescription.equals(that.unescapedDescription) : that.unescapedDescription != null)
+ return false;
+ if (baseType != null ? !baseType.equals(that.baseType) : that.baseType != null)
+ return false;
+ if (defaultValue != null ? !defaultValue.equals(that.defaultValue) : that.defaultValue != null)
+ return false;
+ if (example != null ? !example.equals(that.example) : that.example != null)
+ return false;
+ if (jsonSchema != null ? !jsonSchema.equals(that.jsonSchema) : that.jsonSchema != null)
+ return false;
+ if (isString != null ? !isString.equals(that.isString) : that.isString != null)
+ return false;
+ if (isInteger != null ? !isInteger.equals(that.isInteger) : that.isInteger != null)
+ return false;
+ if (isLong != null ? !isLong.equals(that.isLong) : that.isLong != null)
+ return false;
+ if (isFloat != null ? !isFloat.equals(that.isFloat) : that.isFloat != null)
+ return false;
+ if (isDouble != null ? !isDouble.equals(that.isDouble) : that.isDouble != null)
+ return false;
+ if (isByteArray != null ? !isByteArray.equals(that.isByteArray) : that.isByteArray != null)
+ return false;
+ if (isBinary != null ? !isBinary.equals(that.isBinary) : that.isBinary != null)
+ return false;
+ if (isBoolean != null ? !isBoolean.equals(that.isBoolean) : that.isBoolean != null)
+ return false;
+ if (isDate != null ? !isDate.equals(that.isDate) : that.isDate != null)
+ return false;
+ if (isDateTime != null ? !isDateTime.equals(that.isDateTime) : that.isDateTime != null)
+ return false;
+ if (isListContainer != null ? !isListContainer.equals(that.isListContainer) : that.isListContainer != null)
+ return false;
+ if (isMapContainer != null ? !isMapContainer.equals(that.isMapContainer) : that.isMapContainer != null)
+ return false;
+ if (isFile != null ? !isFile.equals(that.isFile) : that.isFile != null)
+ return false;
+ if (notFile != null ? !notFile.equals(that.notFile) : that.notFile != null)
+ return false;
+ if (_enum != null ? !_enum.equals(that._enum) : that._enum != null)
+ return false;
+ if (allowableValues != null ? !allowableValues.equals(that.allowableValues) : that.allowableValues != null)
+ return false;
+ if (items != null ? !items.equals(that.items) : that.items != null)
+ return false;
+ if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null)
+ return false;
+ if (hasValidation != null ? !hasValidation.equals(that.hasValidation) : that.hasValidation != null)
+ return false;
+ if (required != null ? !required.equals(that.required) : that.required != null)
+ return false;
+ if (maximum != null ? !maximum.equals(that.maximum) : that.maximum != null)
+ return false;
+ if (exclusiveMaximum != null ? !exclusiveMaximum.equals(that.exclusiveMaximum) : that.exclusiveMaximum != null)
+ return false;
+ if (minimum != null ? !minimum.equals(that.minimum) : that.minimum != null)
+ return false;
+ if (exclusiveMinimum != null ? !exclusiveMinimum.equals(that.exclusiveMinimum) : that.exclusiveMinimum != null)
+ return false;
+ if (maxLength != null ? !maxLength.equals(that.maxLength) : that.maxLength != null)
+ return false;
+ if (minLength != null ? !minLength.equals(that.minLength) : that.minLength != null)
+ return false;
+ if (pattern != null ? !pattern.equals(that.pattern) : that.pattern != null)
+ return false;
+ if (maxItems != null ? !maxItems.equals(that.maxItems) : that.maxItems != null)
+ return false;
+ if (minItems != null ? !minItems.equals(that.minItems) : that.minItems != null)
+ return false;
+ if (uniqueItems != null ? !uniqueItems.equals(that.uniqueItems) : that.uniqueItems != null)
+ return false;
+ return multipleOf != null ? multipleOf.equals(that.multipleOf) : that.multipleOf == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = isFormParam != null ? isFormParam.hashCode() : 0;
+ result = 31 * result + (isQueryParam != null ? isQueryParam.hashCode() : 0);
+ result = 31 * result + (isPathParam != null ? isPathParam.hashCode() : 0);
+ result = 31 * result + (isHeaderParam != null ? isHeaderParam.hashCode() : 0);
+ result = 31 * result + (isCookieParam != null ? isCookieParam.hashCode() : 0);
+ result = 31 * result + (isBodyParam != null ? isBodyParam.hashCode() : 0);
+ result = 31 * result + (hasMore != null ? hasMore.hashCode() : 0);
+ result = 31 * result + (isContainer != null ? isContainer.hashCode() : 0);
+ result = 31 * result + (secondaryParam != null ? secondaryParam.hashCode() : 0);
+ result = 31 * result + (isCollectionFormatMulti != null ? isCollectionFormatMulti.hashCode() : 0);
+ result = 31 * result + (isPrimitiveType != null ? isPrimitiveType.hashCode() : 0);
+ result = 31 * result + (baseName != null ? baseName.hashCode() : 0);
+ result = 31 * result + (paramName != null ? paramName.hashCode() : 0);
+ result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
+ result = 31 * result + (datatypeWithEnum != null ? datatypeWithEnum.hashCode() : 0);
+ result = 31 * result + (collectionFormat != null ? collectionFormat.hashCode() : 0);
+ result = 31 * result + (description != null ? description.hashCode() : 0);
+ result = 31 * result + (unescapedDescription != null ? unescapedDescription.hashCode() : 0);
+ result = 31 * result + (baseType != null ? baseType.hashCode() : 0);
+ result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0);
+ result = 31 * result + (example != null ? example.hashCode() : 0);
+ result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0);
+ result = 31 * result + (isString != null ? isString.hashCode() : 0);
+ result = 31 * result + (isInteger != null ? isInteger.hashCode() : 0);
+ result = 31 * result + (isLong != null ? isLong.hashCode() : 0);
+ result = 31 * result + (isFloat != null ? isFloat.hashCode() : 0);
+ result = 31 * result + (isDouble != null ? isDouble.hashCode() : 0);
+ result = 31 * result + (isByteArray != null ? isByteArray.hashCode() : 0);
+ result = 31 * result + (isBinary != null ? isBinary.hashCode() : 0);
+ result = 31 * result + (isBoolean != null ? isBoolean.hashCode() : 0);
+ result = 31 * result + (isDate != null ? isDate.hashCode() : 0);
+ result = 31 * result + (isDateTime != null ? isDateTime.hashCode() : 0);
+ result = 31 * result + (isListContainer != null ? isListContainer.hashCode() : 0);
+ result = 31 * result + (isMapContainer != null ? isMapContainer.hashCode() : 0);
+ result = 31 * result + (isFile != null ? isFile.hashCode() : 0);
+ result = 31 * result + (notFile != null ? notFile.hashCode() : 0);
+ result = 31 * result + (isEnum ? 1 : 0);
+ result = 31 * result + (_enum != null ? _enum.hashCode() : 0);
+ result = 31 * result + (allowableValues != null ? allowableValues.hashCode() : 0);
+ result = 31 * result + (items != null ? items.hashCode() : 0);
+ result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
+ result = 31 * result + (hasValidation != null ? hasValidation.hashCode() : 0);
+ result = 31 * result + (required != null ? required.hashCode() : 0);
+ result = 31 * result + (maximum != null ? maximum.hashCode() : 0);
+ result = 31 * result + (exclusiveMaximum != null ? exclusiveMaximum.hashCode() : 0);
+ result = 31 * result + (minimum != null ? minimum.hashCode() : 0);
+ result = 31 * result + (exclusiveMinimum != null ? exclusiveMinimum.hashCode() : 0);
+ result = 31 * result + (maxLength != null ? maxLength.hashCode() : 0);
+ result = 31 * result + (minLength != null ? minLength.hashCode() : 0);
+ result = 31 * result + (pattern != null ? pattern.hashCode() : 0);
+ result = 31 * result + (maxItems != null ? maxItems.hashCode() : 0);
+ result = 31 * result + (minItems != null ? minItems.hashCode() : 0);
+ result = 31 * result + (uniqueItems != null ? uniqueItems.hashCode() : 0);
+ result = 31 * result + (multipleOf != null ? multipleOf.hashCode() : 0);
+ return result;
+ }
}
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java
index 79b7c60a9eb8..d58a1a81b1d3 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java
@@ -44,6 +44,12 @@ public class CodegenProperty {
public Map
* A non-AMD browser application (discouraged) might do something like this: @@ -37,23 +37,23 @@ * ... * *
- * @module index + * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index * @version {{projectVersion}} */{{/emitJSDoc}} {{=< >=}} var exports = {<#emitJSDoc> /** * The ApiClient constructor. - * @property {module:ApiClient} + * @property {module:<#invokerPackage>{{classname}}.{{#description}}
* {{description}}{{/description}}
- * @alias module:{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
+ * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
* @class{{#useInheritance}}{{#parent}}
- * @extends module:{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{parent}}{{/parent}}{{#interfaces}}
- * @implements module:{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}}
+ * @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}}) {
-{{#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}} };
+ */
+{{/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:<#modelPackage>{{classname}} instance.
+ * @param {{=< >=}}{module:<#invokerPackage>{{classname}} instance.
*/
{{/emitJSDoc}} exports.constructFromObject = function(data, obj) {
- if (data) { {{!// TODO: support polymorphism: discriminator property on data determines class to instantiate.}}
+ if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} {
obj = obj || new exports();
-{{#useInheritance}}{{#parent}} {{.}}.constructFromObject(data, obj);{{/parent}}
+{{#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}}}
@@ -54,10 +59,10 @@
{{/vars}} }
return obj;
}
-{{#useInheritance}}{{#parent}}
- exports.prototype = Object.create({{parent}}.prototype);
+{{#useInheritance}}{{#parentModel}}
+ exports.prototype = Object.create({{classname}}.prototype);
exports.prototype.constructor = exports;
-{{/parent}}{{/useInheritance}}
+{{/parentModel}}{{/useInheritance}}
{{#vars}}{{#emitJSDoc}}
/**{{#description}}
* {{{description}}}{{/description}}
diff --git a/modules/swagger-codegen/src/main/resources/Javascript/package.mustache b/modules/swagger-codegen/src/main/resources/Javascript/package.mustache
index 55c33e3f2808..ca84decf9d39 100644
--- a/modules/swagger-codegen/src/main/resources/Javascript/package.mustache
+++ b/modules/swagger-codegen/src/main/resources/Javascript/package.mustache
@@ -3,7 +3,7 @@
"version": "{{{projectVersion}}}",
"description": "{{{projectDescription}}}",{{#projectLicenseName}}
"license": "{{{projectLicenseName}}}",{{/projectLicenseName}}
- "main": "{{sourceFolder}}/index.js",
+ "main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js",
"scripts": {
"test": "./node_modules/mocha/bin/mocha --recursive"
},
diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache
index bf6b76d6b41b..25e152a9e344 100644
--- a/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache
@@ -40,14 +40,14 @@ export namespace {{classname}} {
{{/model}}
{{/models}}
-interface Authentication {
+export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: request.Options): void;
}
-class HttpBasicAuth implements Authentication {
+export class HttpBasicAuth implements Authentication {
public username: string;
public password: string;
applyToRequest(requestOptions: request.Options): void {
@@ -57,7 +57,7 @@ class HttpBasicAuth implements Authentication {
}
}
-class ApiKeyAuth implements Authentication {
+export class ApiKeyAuth implements Authentication {
public apiKey: string;
constructor(private location: string, private paramName: string) {
@@ -72,7 +72,7 @@ class ApiKeyAuth implements Authentication {
}
}
-class OAuth implements Authentication {
+export class OAuth implements Authentication {
public accessToken: string;
applyToRequest(requestOptions: request.Options): void {
@@ -80,7 +80,7 @@ class OAuth implements Authentication {
}
}
-class VoidAuth implements Authentication {
+export class VoidAuth implements Authentication {
public username: string;
public password: string;
applyToRequest(requestOptions: request.Options): void {
diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache
index 6e540d3f8767..9b8998cf6146 100644
--- a/modules/swagger-codegen/src/main/resources/go/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/go/api.mustache
@@ -4,7 +4,6 @@ package {{packageName}}
import (
"strings"
"fmt"
- "encoding/json"
"errors"
{{#imports}} "{{import}}"
{{/imports}}
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 2a34a8cf35ac..9f81de76d624 100644
--- a/modules/swagger-codegen/src/main/resources/go/api_response.mustache
+++ b/modules/swagger-codegen/src/main/resources/go/api_response.mustache
@@ -1,4 +1,4 @@
-package swagger
+package {{packageName}}
import (
"net/http"
diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache
index 2692ba66f94f..c0401940b484 100644
--- a/modules/swagger-codegen/src/main/resources/php/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/php/api.mustache
@@ -122,7 +122,37 @@ use \{{invokerPackage}}\ObjectSerializer;
// verify the required parameter '{{paramName}}' is set
if (${{paramName}} === null) {
throw new \InvalidArgumentException('Missing the required parameter ${{paramName}} when calling {{operationId}}');
- }{{/required}}{{/allParams}}
+ }
+ {{/required}}
+ {{#hasValidation}}
+ {{#maxLength}}
+ if (strlen(${{paramName}}) > {{maxLength}}) {
+ throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.');
+ }
+ {{/maxLength}}
+ {{#minLength}}
+ if (strlen(${{paramName}}) > {{minLength}}) {
+ throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.');
+ }
+ {{/minLength}}
+ {{#maximum}}
+ if (${{paramName}} > {{maximum}}) {
+ throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maximum}}.');
+ }
+ {{/maximum}}
+ {{#minimum}}
+ if (${{paramName}} < {{minimum}}) {
+ throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minimum}}.');
+ }
+ {{/minimum}}
+ {{#pattern}}
+ if (!preg_match("{{pattern}}", ${{paramName}})) {
+ throw new \InvalidArgumentException('invalid value for "{{paramName}}" when calling {{classname}}.{{operationId}}, must conform to the pattern {{pattern}}.');
+ }
+ {{/pattern}}
+
+ {{/hasValidation}}
+ {{/allParams}}
// parse inputs
$resourcePath = "{{path}}";
diff --git a/modules/swagger-codegen/src/main/resources/python/__init__test.mustache b/modules/swagger-codegen/src/main/resources/python/__init__test.mustache
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/modules/swagger-codegen/src/main/resources/python/api_test.mustache b/modules/swagger-codegen/src/main/resources/python/api_test.mustache
new file mode 100644
index 000000000000..5f0b0ab6ecb1
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/python/api_test.mustache
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.apis.{{classVarName}} import {{classname}}
+
+
+class {{#operations}}Test{{classname}}(unittest.TestCase):
+ """ {{classname}} unit test stubs """
+
+ def setUp(self):
+ self.api = swagger_client.apis.{{classVarName}}.{{classname}}()
+
+ def tearDown(self):
+ pass
+
+ {{#operation}}
+ def test_{{operationId}}(self):
+ """
+ Test case for {{{operationId}}}
+
+ {{{summary}}}
+ """
+ pass
+
+ {{/operation}}
+{{/operations}}
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/main/resources/python/model_test.mustache b/modules/swagger-codegen/src/main/resources/python/model_test.mustache
new file mode 100644
index 000000000000..c00a10a9b510
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/python/model_test.mustache
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+{{#models}}
+{{#model}}
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.{{classFilename}} import {{classname}}
+
+
+class Test{{classname}}(unittest.TestCase):
+ """ {{classname}} unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def test{{classname}}(self):
+ """
+ Test {{classname}}
+ """
+ model = swagger_client.models.{{classFilename}}.{{classname}}()
+
+{{/model}}
+{{/models}}
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/main/resources/ruby/model.mustache b/modules/swagger-codegen/src/main/resources/ruby/model.mustache
index b95b55bcee93..14f26898d2bb 100644
--- a/modules/swagger-codegen/src/main/resources/ruby/model.mustache
+++ b/modules/swagger-codegen/src/main/resources/ruby/model.mustache
@@ -38,7 +38,7 @@ module {{moduleName}}{{#models}}{{#model}}{{#description}}
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
{{#vars}}
- if attributes[:'{{{baseName}}}']
+ if attributes.has_key?(:'{{{baseName}}}')
{{#isContainer}}
if (value = attributes[:'{{{baseName}}}']).is_a?(Array)
self.{{{name}}} = value
diff --git a/modules/swagger-codegen/src/main/resources/swift/Models.mustache b/modules/swagger-codegen/src/main/resources/swift/Models.mustache
index 795fdd3d5e78..378c83525f14 100644
--- a/modules/swagger-codegen/src/main/resources/swift/Models.mustache
+++ b/modules/swagger-codegen/src/main/resources/swift/Models.mustache
@@ -137,9 +137,22 @@ class Decoders {
// Decoder for {{{classname}}}
Decoders.addDecoder(clazz: {{{classname}}}.self) { (source: AnyObject) -> {{{classname}}} in
let sourceDictionary = source as! [NSObject:AnyObject]
+ {{#unwrapRequired}}
+ let instance = {{classname}}({{#requiredVars}}{{^-first}}, {{/-first}}{{#isEnum}}{{name}}: {{classname}}.{{datatypeWithEnum}}(rawValue: (sourceDictionary["{{baseName}}"] as? String) ?? "")! {{/isEnum}}{{^isEnum}}{{name}}: Decoders.decode(clazz: {{{baseType}}}.self, source: sourceDictionary["{{baseName}}"]!){{/isEnum}}{{/requiredVars}})
+ {{#optionalVars}}
+ {{#isEnum}}
+ instance.{{name}} = {{classname}}.{{datatypeWithEnum}}(rawValue: (sourceDictionary["{{baseName}}"] as? String) ?? "")
+ {{/isEnum}}
+ {{^isEnum}}
+ instance.{{name}} = Decoders.decodeOptional(clazz: {{{baseType}}}.self, source: sourceDictionary["{{baseName}}"])
+ {{/isEnum}}
+ {{/optionalVars}}
+ {{/unwrapRequired}}
+ {{^unwrapRequired}}
let instance = {{classname}}(){{#vars}}{{#isEnum}}
- instance.{{name}} = {{classname}}.{{datatypeWithEnum}}(rawValue: (sourceDictionary["{{baseName}}"] as? String) ?? ""){{#unwrapRequired}}{{#required}}!{{/required}}{{/unwrapRequired}} {{/isEnum}}{{^isEnum}}
- instance.{{name}} = Decoders.decode{{^unwrapRequired}}Optional{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}Optional{{/required}}{{/unwrapRequired}}(clazz: {{{baseType}}}.self, source: sourceDictionary["{{baseName}}"]{{#unwrapRequired}}{{#required}}!{{/required}}{{/unwrapRequired}}){{/isEnum}}{{/vars}}
+ instance.{{name}} = {{classname}}.{{datatypeWithEnum}}(rawValue: (sourceDictionary["{{baseName}}"] as? String) ?? "") {{/isEnum}}{{^isEnum}}
+ instance.{{name}} = Decoders.decodeOptional(clazz: {{{baseType}}}.self, source: sourceDictionary["{{baseName}}"]){{/isEnum}}{{/vars}}
+ {{/unwrapRequired}}
return instance
}{{/model}}
{{/models}}
diff --git a/modules/swagger-codegen/src/main/resources/swift/model.mustache b/modules/swagger-codegen/src/main/resources/swift/model.mustache
index 3c0a47c2987d..96c4d2ff6837 100644
--- a/modules/swagger-codegen/src/main/resources/swift/model.mustache
+++ b/modules/swagger-codegen/src/main/resources/swift/model.mustache
@@ -21,15 +21,24 @@ public class {{classname}}: JSONEncodable {
{{#vars}}
{{#isEnum}}
{{#description}}/** {{description}} */
- {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{#required}}!{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
+ {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
{{/isEnum}}
{{^isEnum}}
{{#description}}/** {{description}} */
- {{/description}}public var {{name}}: {{{datatype}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{#required}}!{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
+ {{/description}}public var {{name}}: {{{datatype}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
{{/isEnum}}
{{/vars}}
+{{^unwrapRequired}}
public init() {}
+{{/unwrapRequired}}
+{{#unwrapRequired}}
+ public init({{#requiredVars}}{{^-first}}, {{/-first}}{{name}}: {{#isEnum}}{{datatypeWithEnum}}!{{/isEnum}}{{^isEnum}}{{datatype}}!{{/isEnum}}{{/requiredVars}}) {
+ {{#requiredVars}}
+ self.{{name}} = {{name}}
+ {{/requiredVars}}
+ }
+{{/unwrapRequired}}
// MARK: JSONEncodable
func encodeToJSON() -> AnyObject {
diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache
index 18b375097c12..0b2e50acb442 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache
@@ -2,6 +2,7 @@
"name": "{{npmName}}",
"version": "{{npmVersion}}",
"description": "swagger client for {{npmName}}",
+ "author": "Swagger Codegen Contributors",
"keywords": [
"swagger-client"
],
@@ -31,5 +32,4 @@
"registry":"{{npmRepository}}"
}
{{/npmRepository}}
-
}
diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/typings.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/typings.mustache
index 32530eeb63dd..0848dcffe31e 100644
--- a/modules/swagger-codegen/src/main/resources/typescript-angular2/typings.mustache
+++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/typings.mustache
@@ -2,4 +2,4 @@
"ambientDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654"
}
-}
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache
new file mode 100644
index 000000000000..967145002087
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache
@@ -0,0 +1,22 @@
+{
+ "name": "{{npmName}}",
+ "version": "{{npmVersion}}",
+ "description": "NodeJS client for {{npmName}}",
+ "main": "api.js",
+ "scripts": {
+ "build": "typings install && tsc"
+ },
+ "author": "Swagger Codegen Contributors",
+ "license": "MIT",
+ "dependencies": {
+ "bluebird": "^3.3.5",
+ "request": "^2.72.0"
+ },
+ "devDependencies": {
+ "typescript": "^1.8.10",
+ "typings": "^0.8.1"
+ }{{#npmRepository}},
+ "publishConfig":{
+ "registry":"{{npmRepository}}"
+ }{{/npmRepository}}
+}
diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache
new file mode 100644
index 000000000000..2dd166566e97
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "noImplicitAny": false,
+ "suppressImplicitAnyIndexErrors": true,
+ "target": "ES5",
+ "moduleResolution": "node",
+ "removeComments": true,
+ "sourceMap": true,
+ "noLib": false,
+ "declaration": true
+ },
+ "files": [
+ "api.ts",
+ "typings/main.d.ts"
+ ]
+}
+
diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache
new file mode 100644
index 000000000000..76c4cc8e6af3
--- /dev/null
+++ b/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache
@@ -0,0 +1,10 @@
+{
+ "ambientDependencies": {
+ "bluebird": "registry:dt/bluebird#2.0.0+20160319051630",
+ "core-js": "registry:dt/core-js#0.0.0+20160317120654",
+ "node": "registry:dt/node#4.0.0+20160423143914"
+ },
+ "dependencies": {
+ "request": "registry:npm/request#2.69.0+20160304121250"
+ }
+}
\ No newline at end of file
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java
index 927d4d7755b8..eda6602607dc 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java
@@ -30,6 +30,8 @@ public class JavaScriptClientOptionsTest extends AbstractOptionsTest {
protected void setExpectations() {
// Commented generic options not yet supported by JavaScript codegen.
new Expectations(clientCodegen) {{
+ clientCodegen.setInvokerPackage(JavaScriptOptionsProvider.INVOKER_PACKAGE_VALUE);
+ times = 1;
clientCodegen.setModelPackage(JavaScriptOptionsProvider.MODEL_PACKAGE_VALUE);
times = 1;
clientCodegen.setApiPackage(JavaScriptOptionsProvider.API_PACKAGE_VALUE);
diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java
index 9b0f06a10312..b445fc1c528f 100644
--- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java
+++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java
@@ -10,9 +10,9 @@ import java.util.Map;
public class JavaScriptOptionsProvider implements OptionsProvider {
public static final String ARTIFACT_ID_VALUE = "swagger-javascript-client-test";
+ public static final String INVOKER_PACKAGE_VALUE = "invoker";
public static final String MODEL_PACKAGE_VALUE = "model";
public static final String API_PACKAGE_VALUE = "api";
-// public static final String INVOKER_PACKAGE_VALUE = "js";
public static final String SORT_PARAMS_VALUE = "false";
public static final String GROUP_ID_VALUE = "io.swagger.test";
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
@@ -38,11 +38,11 @@ public class JavaScriptOptionsProvider implements OptionsProvider {
public JavaScriptOptionsProvider() {
// Commented generic options not yet supported by JavaScript codegen.
options = new ImmutableMap.Builder* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: *
- * var SwaggerPetstore = require('./index'); // See note below*.
+ * var SwaggerPetstore = require('index'); // See note below*.
* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
* var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
@@ -23,8 +23,8 @@
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
*
- * *NOTE: For a top-level AMD script, use require(['./index'], function(){...}) and put the application logic within the
- * callback function.
+ * *NOTE: For a top-level AMD script, use require(['index'], function(){...})
+ * and put the application logic within the callback function.
*
*
* A non-AMD browser application (discouraged) might do something like this:
@@ -46,51 +46,11 @@
* @property {module:ApiClient}
*/
ApiClient: ApiClient,
- /**
- * The Animal model constructor.
- * @property {module:model/Animal}
- */
- Animal: Animal,
- /**
- * 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 FormatTest model constructor.
- * @property {module:model/FormatTest}
- */
- FormatTest: FormatTest,
- /**
- * The InlineResponse200 model constructor.
- * @property {module:model/InlineResponse200}
- */
- InlineResponse200: InlineResponse200,
- /**
- * 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}
@@ -101,11 +61,6 @@
* @property {module:model/Pet}
*/
Pet: Pet,
- /**
- * The SpecialModelName model constructor.
- * @property {module:model/SpecialModelName}
- */
- SpecialModelName: SpecialModelName,
/**
* The Tag model constructor.
* @property {module:model/Tag}
diff --git a/samples/client/petstore/javascript-promise/src/model/Category.js b/samples/client/petstore/javascript-promise/src/model/Category.js
index 473f4b783d58..9956525e037c 100644
--- a/samples/client/petstore/javascript-promise/src/model/Category.js
+++ b/samples/client/petstore/javascript-promise/src/model/Category.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -40,7 +41,7 @@
* @return {module:model/Category} The populated
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
* Category instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript-promise/src/model/InlineResponse200.js b/samples/client/petstore/javascript-promise/src/model/InlineResponse200.js
index f9ecda79491a..f2abaf1bd1b7 100644
--- a/samples/client/petstore/javascript-promise/src/model/InlineResponse200.js
+++ b/samples/client/petstore/javascript-promise/src/model/InlineResponse200.js
@@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
- define(['../ApiClient', './Tag'], factory);
+ define(['ApiClient', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Tag'));
diff --git a/samples/client/petstore/javascript-promise/src/model/Model200Response.js b/samples/client/petstore/javascript-promise/src/model/Model200Response.js
index 1682ed079fce..8381185d9d08 100644
--- a/samples/client/petstore/javascript-promise/src/model/Model200Response.js
+++ b/samples/client/petstore/javascript-promise/src/model/Model200Response.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'));
diff --git a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js
index 86d28d038a9f..9549db64d465 100644
--- a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js
+++ b/samples/client/petstore/javascript-promise/src/model/ModelReturn.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'));
diff --git a/samples/client/petstore/javascript-promise/src/model/Name.js b/samples/client/petstore/javascript-promise/src/model/Name.js
index c8bd6862c978..08a5a34c29a6 100644
--- a/samples/client/petstore/javascript-promise/src/model/Name.js
+++ b/samples/client/petstore/javascript-promise/src/model/Name.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'));
diff --git a/samples/client/petstore/javascript-promise/src/model/Order.js b/samples/client/petstore/javascript-promise/src/model/Order.js
index 81f1feb78000..664908b77a9a 100644
--- a/samples/client/petstore/javascript-promise/src/model/Order.js
+++ b/samples/client/petstore/javascript-promise/src/model/Order.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -44,7 +45,7 @@
* @return {module:model/Order} The populated Order instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript-promise/src/model/Pet.js b/samples/client/petstore/javascript-promise/src/model/Pet.js
index 39a09b471700..ae907d35ca2f 100644
--- a/samples/client/petstore/javascript-promise/src/model/Pet.js
+++ b/samples/client/petstore/javascript-promise/src/model/Pet.js
@@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
- define(['../ApiClient', './Category', './Tag'], factory);
+ define(['ApiClient', 'model/Category', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Category'), require('./Tag'));
@@ -29,11 +29,12 @@
* @param photoUrls
*/
var exports = function(name, photoUrls) {
+ var _this = this;
- this['name'] = name;
- this['photoUrls'] = photoUrls;
+ _this['name'] = name;
+ _this['photoUrls'] = photoUrls;
};
@@ -46,7 +47,7 @@
* @return {module:model/Pet} The populated Pet instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js
index fb6b4765d3fc..8694196cdd96 100644
--- a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js
+++ b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.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'));
diff --git a/samples/client/petstore/javascript-promise/src/model/Tag.js b/samples/client/petstore/javascript-promise/src/model/Tag.js
index 8a0739b2ef5b..d9ab35fb8b53 100644
--- a/samples/client/petstore/javascript-promise/src/model/Tag.js
+++ b/samples/client/petstore/javascript-promise/src/model/Tag.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -40,7 +41,7 @@
* @return {module:model/Tag} The populated Tag instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js
index 1d960a89914b..3bc6aaab630e 100644
--- a/samples/client/petstore/javascript-promise/src/model/User.js
+++ b/samples/client/petstore/javascript-promise/src/model/User.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -46,7 +47,7 @@
* @return {module:model/User} The populated User instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript-promise/test/ApiClientTest.js b/samples/client/petstore/javascript-promise/test/ApiClientTest.js
index c91fbb037830..085983688bbb 100644
--- a/samples/client/petstore/javascript-promise/test/ApiClientTest.js
+++ b/samples/client/petstore/javascript-promise/test/ApiClientTest.js
@@ -13,7 +13,11 @@ describe('ApiClient', function() {
expect(apiClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(apiClient.authentications).to.eql({
petstore_auth: {type: 'oauth2'},
- api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'},
+ api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}
+ /* comment out the following as these fake security def (testing purpose)
+ * are removed from the spec, we'll add these back after updating the
+ * petstore server
+ *
test_http_basic: {type: 'basic'},
test_api_client_id: {
type: 'apiKey',
@@ -34,7 +38,7 @@ describe('ApiClient', function() {
type: 'apiKey',
'in': 'header',
name: 'test_api_key_header'
- }
+ }*/
});
});
diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md
index c57237d7cebd..2d707697bf27 100644
--- a/samples/client/petstore/javascript/README.md
+++ b/samples/client/petstore/javascript/README.md
@@ -6,7 +6,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-11T22:17:15.122+08:00
+- Build date: 2016-05-01T12:06:44.623+08:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation
@@ -27,11 +27,11 @@ npm install swagger-petstore --save
#### git
#
If the library is hosted at a git repository, e.g.
-https://github.com/YOUR_USERNAME/YOUR_GIT_REPO_ID
+https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:
```shell
-npm install YOUR_USERNAME/YOUR_GIT_REPO_ID --save
+ npm install GIT_USER_ID/GIT_REPO_ID --save
```
### For browser
@@ -83,20 +83,15 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
-*SwaggerPetstore.PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding 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
*SwaggerPetstore.PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
*SwaggerPetstore.PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
-*SwaggerPetstore.PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
-*SwaggerPetstore.PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
*SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
*SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
*SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
-*SwaggerPetstore.StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
*SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
-*SwaggerPetstore.StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
*SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
*SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
@@ -111,18 +106,9 @@ Class | Method | HTTP request | Description
## Documentation for Models
- - [SwaggerPetstore.Animal](docs/Animal.md)
- - [SwaggerPetstore.Cat](docs/Cat.md)
- [SwaggerPetstore.Category](docs/Category.md)
- - [SwaggerPetstore.Dog](docs/Dog.md)
- - [SwaggerPetstore.FormatTest](docs/FormatTest.md)
- - [SwaggerPetstore.InlineResponse200](docs/InlineResponse200.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)
@@ -130,40 +116,12 @@ Class | Method | HTTP request | Description
## Documentation for Authorization
-### test_api_key_header
-
-- **Type**: API key
-- **API key parameter name**: test_api_key_header
-- **Location**: HTTP header
-
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
-### test_http_basic
-
-- **Type**: HTTP basic authentication
-
-### test_api_client_secret
-
-- **Type**: API key
-- **API key parameter name**: x-test_api_client_secret
-- **Location**: HTTP header
-
-### test_api_client_id
-
-- **Type**: API key
-- **API key parameter name**: x-test_api_client_id
-- **Location**: HTTP header
-
-### test_api_key_query
-
-- **Type**: API key
-- **API key parameter name**: test_api_key_query
-- **Location**: URL query string
-
### petstore_auth
- **Type**: OAuth
diff --git a/samples/client/petstore/javascript/docs/PetApi.md b/samples/client/petstore/javascript/docs/PetApi.md
index 35a760e218be..39b8726b0b63 100644
--- a/samples/client/petstore/javascript/docs/PetApi.md
+++ b/samples/client/petstore/javascript/docs/PetApi.md
@@ -5,13 +5,10 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
-[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
-[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
-[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
@@ -32,12 +29,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
- 'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
+ 'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store
};
var callback = function(error, data, response) {
@@ -47,7 +44,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.addPet(opts, callback);
+apiInstance.addPet(opts, callback);
```
### Parameters
@@ -64,58 +61,6 @@ null (empty response body)
[petstore_auth](../README.md#petstore_auth)
-### HTTP request headers
-
- - **Content-Type**: application/json, application/xml
- - **Accept**: application/json, application/xml
-
-
-# **addPetUsingByteArray**
-> addPetUsingByteArray(opts)
-
-Fake endpoint to test byte array in body parameter for adding a new pet to the store
-
-
-
-### Example
-```javascript
-var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-
-// 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 opts = {
- 'body': "B" // {String} Pet object in the form of byte array
-};
-
-var callback = function(error, data, response) {
- if (error) {
- console.error(error);
- } else {
- console.log('API called successfully.');
- }
-};
-api.addPetUsingByteArray(opts, callback);
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | **String**| Pet object in the form of byte array | [optional]
-
-### Return type
-
-null (empty response body)
-
-### Authorization
-
-[petstore_auth](../README.md#petstore_auth)
-
### HTTP request headers
- **Content-Type**: application/json, application/xml
@@ -136,14 +81,14 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
-var petId = 789; // {Integer} Pet id to delete
+var petId = 789; // Integer | Pet id to delete
var opts = {
- 'apiKey': "apiKey_example" // {String}
+ 'apiKey': "apiKey_example" // String |
};
var callback = function(error, data, response) {
@@ -153,7 +98,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.deletePet(petId, opts, callback);
+apiInstance.deletePet(petId, opts, callback);
```
### Parameters
@@ -182,7 +127,7 @@ null (empty response body)
Finds Pets by status
-Multiple status values can be provided with comma separated strings
+Multiple status values can be provided with comma seperated strings
### Example
```javascript
@@ -191,12 +136,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
- 'status': ["available"] // {[String]} Status values that need to be considered for query
+ 'status': ["available"] // [String] | Status values that need to be considered for filter
};
var callback = function(error, data, response) {
@@ -206,14 +151,14 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.findPetsByStatus(opts, callback);
+apiInstance.findPetsByStatus(opts, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **status** | [**[String]**](String.md)| Status values that need to be considered for query | [optional] [default to available]
+ **status** | [**[String]**](String.md)| Status values that need to be considered for filter | [optional] [default to available]
### Return type
@@ -243,12 +188,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
- 'tags': ["tags_example"] // {[String]} Tags to filter by
+ 'tags': ["tags_example"] // [String] | Tags to filter by
};
var callback = function(error, data, response) {
@@ -258,7 +203,7 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.findPetsByTags(opts, callback);
+apiInstance.findPetsByTags(opts, callback);
```
### Parameters
@@ -295,17 +240,17 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
-api_key.apiKey = "YOUR API KEY"
+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['api_key'] = "Token"
+//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"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
-var petId = 789; // {Integer} ID of pet that needs to be fetched
+var petId = 789; // Integer | ID of pet that needs to be fetched
var callback = function(error, data, response) {
@@ -315,7 +260,7 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.getPetById(petId, callback);
+apiInstance.getPetById(petId, callback);
```
### Parameters
@@ -332,120 +277,6 @@ Name | Type | Description | Notes
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
-
-
-# **getPetByIdInObject**
-> InlineResponse200 getPetByIdInObject(petId)
-
-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
-
-### Example
-```javascript
-var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-
-// Configure API key authorization: api_key
-var api_key = defaultClient.authentications['api_key'];
-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['api_key'] = "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 callback = function(error, data, response) {
- if (error) {
- console.error(error);
- } else {
- console.log('API called successfully. Returned data: ' + data);
- }
-};
-api.getPetByIdInObject(petId, callback);
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **petId** | **Integer**| ID of pet that needs to be fetched |
-
-### Return type
-
-[**InlineResponse200**](InlineResponse200.md)
-
-### Authorization
-
-[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
-
-
-# **petPetIdtestingByteArraytrueGet**
-> 'String' petPetIdtestingByteArraytrueGet(petId)
-
-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
-
-### Example
-```javascript
-var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-
-// Configure API key authorization: api_key
-var api_key = defaultClient.authentications['api_key'];
-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['api_key'] = "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 callback = function(error, data, response) {
- if (error) {
- console.error(error);
- } else {
- console.log('API called successfully. Returned data: ' + data);
- }
-};
-api.petPetIdtestingByteArraytrueGet(petId, callback);
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **petId** | **Integer**| ID of pet that needs to be fetched |
-
-### Return type
-
-**'String'**
-
-### Authorization
-
-[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
-
### HTTP request headers
- **Content-Type**: Not defined
@@ -466,12 +297,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
- 'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
+ 'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store
};
var callback = function(error, data, response) {
@@ -481,7 +312,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.updatePet(opts, callback);
+apiInstance.updatePet(opts, callback);
```
### Parameters
@@ -518,15 +349,15 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
-var petId = "petId_example"; // {String} ID of pet that needs to be updated
+var petId = "petId_example"; // String | ID of pet that needs to be updated
var opts = {
- 'name': "name_example", // {String} Updated name of the pet
- 'status': "status_example" // {String} Updated status of the pet
+ 'name': "name_example", // String | Updated name of the pet
+ 'status': "status_example" // String | Updated status of the pet
};
var callback = function(error, data, response) {
@@ -536,7 +367,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.updatePetWithForm(petId, opts, callback);
+apiInstance.updatePetWithForm(petId, opts, callback);
```
### Parameters
@@ -575,15 +406,15 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
-petstore_auth.accessToken = "YOUR ACCESS TOKEN"
+petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
-var apiInstance = new SwaggerPetstore.PetApi()
+var apiInstance = new SwaggerPetstore.PetApi();
-var petId = 789; // {Integer} ID of pet to update
+var petId = 789; // Integer | ID of pet to update
var opts = {
- 'additionalMetadata': "additionalMetadata_example", // {String} Additional data to pass to server
- 'file': "/path/to/file.txt" // {File} file to upload
+ 'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
+ 'file': "/path/to/file.txt" // File | file to upload
};
var callback = function(error, data, response) {
@@ -593,7 +424,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.uploadFile(petId, opts, callback);
+apiInstance.uploadFile(petId, opts, callback);
```
### Parameters
diff --git a/samples/client/petstore/javascript/docs/StoreApi.md b/samples/client/petstore/javascript/docs/StoreApi.md
index 6ad8406dfc9b..563157be5b0d 100644
--- a/samples/client/petstore/javascript/docs/StoreApi.md
+++ b/samples/client/petstore/javascript/docs/StoreApi.md
@@ -5,9 +5,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
-[**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
-[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
@@ -24,9 +22,9 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.StoreApi()
+var apiInstance = new SwaggerPetstore.StoreApi();
-var orderId = "orderId_example"; // {String} ID of the order that needs to be deleted
+var orderId = "orderId_example"; // String | ID of the order that needs to be deleted
var callback = function(error, data, response) {
@@ -36,7 +34,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.deleteOrder(orderId, callback);
+apiInstance.deleteOrder(orderId, callback);
```
### Parameters
@@ -53,66 +51,6 @@ null (empty response body)
No authorization required
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
-
-
-# **findOrdersByStatus**
-> [Order] findOrdersByStatus(opts)
-
-Finds orders by status
-
-A single status value can be provided as a string
-
-### Example
-```javascript
-var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-
-// Configure API key authorization: test_api_client_id
-var test_api_client_id = defaultClient.authentications['test_api_client_id'];
-test_api_client_id.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//test_api_client_id.apiKeyPrefix['x-test_api_client_id'] = "Token"
-
-// Configure API key authorization: test_api_client_secret
-var test_api_client_secret = defaultClient.authentications['test_api_client_secret'];
-test_api_client_secret.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
-
-var apiInstance = new SwaggerPetstore.StoreApi()
-
-var opts = {
- 'status': "placed" // {String} Status value that needs to be considered for query
-};
-
-var callback = function(error, data, response) {
- if (error) {
- console.error(error);
- } else {
- console.log('API called successfully. Returned data: ' + data);
- }
-};
-api.findOrdersByStatus(opts, callback);
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **status** | **String**| Status value that needs to be considered for query | [optional] [default to placed]
-
-### Return type
-
-[**[Order]**](Order.md)
-
-### Authorization
-
-[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
-
### HTTP request headers
- **Content-Type**: Not defined
@@ -120,7 +58,7 @@ Name | Type | Description | Notes
# **getInventory**
-> {'String': 'Integer'} getInventory
+> {'String': 'Integer'} getInventory()
Returns pet inventories by status
@@ -133,11 +71,11 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
-api_key.apiKey = "YOUR API KEY"
+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['api_key'] = "Token"
+//api_key.apiKeyPrefix = 'Token';
-var apiInstance = new SwaggerPetstore.StoreApi()
+var apiInstance = new SwaggerPetstore.StoreApi();
var callback = function(error, data, response) {
if (error) {
@@ -146,7 +84,7 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.getInventory(callback);
+apiInstance.getInventory(callback);
```
### Parameters
@@ -160,53 +98,6 @@ This endpoint does not need any parameter.
[api_key](../README.md#api_key)
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
-
-
-# **getInventoryInObject**
-> Object getInventoryInObject
-
-Fake endpoint to test arbitrary object return by 'Get inventory'
-
-Returns an arbitrary object which is actually a map of status codes to quantities
-
-### Example
-```javascript
-var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-
-// Configure API key authorization: api_key
-var api_key = defaultClient.authentications['api_key'];
-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['api_key'] = "Token"
-
-var apiInstance = new SwaggerPetstore.StoreApi()
-
-var callback = function(error, data, response) {
- if (error) {
- console.error(error);
- } else {
- console.log('API called successfully. Returned data: ' + data);
- }
-};
-api.getInventoryInObject(callback);
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-**Object**
-
-### Authorization
-
-[api_key](../README.md#api_key)
-
### HTTP request headers
- **Content-Type**: Not defined
@@ -223,23 +114,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other val
### Example
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-// Configure API key authorization: test_api_key_header
-var test_api_key_header = defaultClient.authentications['test_api_key_header'];
-test_api_key_header.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//test_api_key_header.apiKeyPrefix['test_api_key_header'] = "Token"
+var apiInstance = new SwaggerPetstore.StoreApi();
-// Configure API key authorization: test_api_key_query
-var test_api_key_query = defaultClient.authentications['test_api_key_query'];
-test_api_key_query.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//test_api_key_query.apiKeyPrefix['test_api_key_query'] = "Token"
-
-var apiInstance = new SwaggerPetstore.StoreApi()
-
-var orderId = "orderId_example"; // {String} ID of pet that needs to be fetched
+var orderId = "orderId_example"; // String | ID of pet that needs to be fetched
var callback = function(error, data, response) {
@@ -249,7 +127,7 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.getOrderById(orderId, callback);
+apiInstance.getOrderById(orderId, callback);
```
### Parameters
@@ -264,7 +142,7 @@ Name | Type | Description | Notes
### Authorization
-[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
+No authorization required
### HTTP request headers
@@ -282,24 +160,11 @@ Place an order for a pet
### Example
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-// Configure API key authorization: test_api_client_id
-var test_api_client_id = defaultClient.authentications['test_api_client_id'];
-test_api_client_id.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//test_api_client_id.apiKeyPrefix['x-test_api_client_id'] = "Token"
-
-// Configure API key authorization: test_api_client_secret
-var test_api_client_secret = defaultClient.authentications['test_api_client_secret'];
-test_api_client_secret.apiKey = "YOUR API KEY"
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
-
-var apiInstance = new SwaggerPetstore.StoreApi()
+var apiInstance = new SwaggerPetstore.StoreApi();
var opts = {
- 'body': new SwaggerPetstore.Order() // {Order} order placed for purchasing the pet
+ 'body': new SwaggerPetstore.Order() // Order | order placed for purchasing the pet
};
var callback = function(error, data, response) {
@@ -309,7 +174,7 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.placeOrder(opts, callback);
+apiInstance.placeOrder(opts, callback);
```
### Parameters
@@ -324,7 +189,7 @@ Name | Type | Description | Notes
### Authorization
-[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
+No authorization required
### HTTP request headers
diff --git a/samples/client/petstore/javascript/docs/UserApi.md b/samples/client/petstore/javascript/docs/UserApi.md
index 4e990c894263..5f9faae29b57 100644
--- a/samples/client/petstore/javascript/docs/UserApi.md
+++ b/samples/client/petstore/javascript/docs/UserApi.md
@@ -26,10 +26,10 @@ This can only be done by the logged in user.
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.UserApi()
+var apiInstance = new SwaggerPetstore.UserApi();
var opts = {
- 'body': new SwaggerPetstore.User() // {User} Created user object
+ 'body': new SwaggerPetstore.User() // User | Created user object
};
var callback = function(error, data, response) {
@@ -39,7 +39,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.createUser(opts, callback);
+apiInstance.createUser(opts, callback);
```
### Parameters
@@ -73,10 +73,10 @@ Creates list of users with given input array
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.UserApi()
+var apiInstance = new SwaggerPetstore.UserApi();
var opts = {
- 'body': [new SwaggerPetstore.User()] // {[User]} List of user object
+ 'body': [new SwaggerPetstore.User()] // [User] | List of user object
};
var callback = function(error, data, response) {
@@ -86,7 +86,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.createUsersWithArrayInput(opts, callback);
+apiInstance.createUsersWithArrayInput(opts, callback);
```
### Parameters
@@ -120,10 +120,10 @@ Creates list of users with given input array
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.UserApi()
+var apiInstance = new SwaggerPetstore.UserApi();
var opts = {
- 'body': [new SwaggerPetstore.User()] // {[User]} List of user object
+ 'body': [new SwaggerPetstore.User()] // [User] | List of user object
};
var callback = function(error, data, response) {
@@ -133,7 +133,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.createUsersWithListInput(opts, callback);
+apiInstance.createUsersWithListInput(opts, callback);
```
### Parameters
@@ -166,16 +166,10 @@ This can only be done by the logged in user.
### Example
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var defaultClient = SwaggerPetstore.ApiClient.default;
-// Configure HTTP basic authorization: test_http_basic
-var test_http_basic = defaultClient.authentications['test_http_basic'];
-test_http_basic.username = 'YOUR USERNAME'
-test_http_basic.password = 'YOUR PASSWORD'
+var apiInstance = new SwaggerPetstore.UserApi();
-var apiInstance = new SwaggerPetstore.UserApi()
-
-var username = "username_example"; // {String} The name that needs to be deleted
+var username = "username_example"; // String | The name that needs to be deleted
var callback = function(error, data, response) {
@@ -185,7 +179,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.deleteUser(username, callback);
+apiInstance.deleteUser(username, callback);
```
### Parameters
@@ -200,7 +194,7 @@ null (empty response body)
### Authorization
-[test_http_basic](../README.md#test_http_basic)
+No authorization required
### HTTP request headers
@@ -219,9 +213,9 @@ Get user by user name
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.UserApi()
+var apiInstance = new SwaggerPetstore.UserApi();
-var username = "username_example"; // {String} The name that needs to be fetched. Use user1 for testing.
+var username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
var callback = function(error, data, response) {
@@ -231,7 +225,7 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.getUserByName(username, callback);
+apiInstance.getUserByName(username, callback);
```
### Parameters
@@ -265,11 +259,11 @@ Logs user into the system
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.UserApi()
+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
+ 'username': "username_example", // String | The user name for login
+ 'password': "password_example" // String | The password for login in clear text
};
var callback = function(error, data, response) {
@@ -279,7 +273,7 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
-api.loginUser(opts, callback);
+apiInstance.loginUser(opts, callback);
```
### Parameters
@@ -304,7 +298,7 @@ No authorization required
# **logoutUser**
-> logoutUser
+> logoutUser()
Logs out current logged in user session
@@ -314,7 +308,7 @@ Logs out current logged in user session
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.UserApi()
+var apiInstance = new SwaggerPetstore.UserApi();
var callback = function(error, data, response) {
if (error) {
@@ -323,7 +317,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.logoutUser(callback);
+apiInstance.logoutUser(callback);
```
### Parameters
@@ -354,12 +348,12 @@ This can only be done by the logged in user.
```javascript
var SwaggerPetstore = require('swagger-petstore');
-var apiInstance = new SwaggerPetstore.UserApi()
+var apiInstance = new SwaggerPetstore.UserApi();
-var username = "username_example"; // {String} name that need to be deleted
+var username = "username_example"; // String | name that need to be deleted
var opts = {
- 'body': new SwaggerPetstore.User() // {User} Updated user object
+ 'body': new SwaggerPetstore.User() // User | Updated user object
};
var callback = function(error, data, response) {
@@ -369,7 +363,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
-api.updateUser(username, opts, callback);
+apiInstance.updateUser(username, opts, callback);
```
### Parameters
diff --git a/samples/client/petstore/javascript/git_push.sh b/samples/client/petstore/javascript/git_push.sh
index 1a36388db023..0d041ad0ba49 100644
--- a/samples/client/petstore/javascript/git_push.sh
+++ b/samples/client/petstore/javascript/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
@@ -36,7 +36,7 @@ git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
- echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js
index 2b6c0c5b1922..d45704dcdac9 100644
--- a/samples/client/petstore/javascript/src/ApiClient.js
+++ b/samples/client/petstore/javascript/src/ApiClient.js
@@ -40,12 +40,7 @@
* @type {Array.
- * var SwaggerPetstore = require('./index'); // See note below*.
+ * var SwaggerPetstore = require('index'); // See note below*.
* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
* var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
@@ -23,8 +23,8 @@
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
*
- * *NOTE: For a top-level AMD script, use require(['./index'], function(){...}) and put the application logic within the
- * callback function.
+ * *NOTE: For a top-level AMD script, use require(['index'], function(){...})
+ * and put the application logic within the callback function.
*
* A non-AMD browser application (discouraged) might do something like this:
@@ -46,51 +46,11 @@
* @property {module:ApiClient}
*/
ApiClient: ApiClient,
- /**
- * The Animal model constructor.
- * @property {module:model/Animal}
- */
- Animal: Animal,
- /**
- * 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 FormatTest model constructor.
- * @property {module:model/FormatTest}
- */
- FormatTest: FormatTest,
- /**
- * The InlineResponse200 model constructor.
- * @property {module:model/InlineResponse200}
- */
- InlineResponse200: InlineResponse200,
- /**
- * 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}
@@ -101,11 +61,6 @@
* @property {module:model/Pet}
*/
Pet: Pet,
- /**
- * The SpecialModelName model constructor.
- * @property {module:model/SpecialModelName}
- */
- SpecialModelName: SpecialModelName,
/**
* The Tag model constructor.
* @property {module:model/Tag}
diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js
index 473f4b783d58..9956525e037c 100644
--- a/samples/client/petstore/javascript/src/model/Category.js
+++ b/samples/client/petstore/javascript/src/model/Category.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -40,7 +41,7 @@
* @return {module:model/Category} The populated Category instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript/src/model/InlineResponse200.js b/samples/client/petstore/javascript/src/model/InlineResponse200.js
index f9ecda79491a..f2abaf1bd1b7 100644
--- a/samples/client/petstore/javascript/src/model/InlineResponse200.js
+++ b/samples/client/petstore/javascript/src/model/InlineResponse200.js
@@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
- define(['../ApiClient', './Tag'], factory);
+ define(['ApiClient', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Tag'));
diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js
index 1682ed079fce..8381185d9d08 100644
--- a/samples/client/petstore/javascript/src/model/Model200Response.js
+++ b/samples/client/petstore/javascript/src/model/Model200Response.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'));
diff --git a/samples/client/petstore/javascript/src/model/ModelReturn.js b/samples/client/petstore/javascript/src/model/ModelReturn.js
index 86d28d038a9f..9549db64d465 100644
--- a/samples/client/petstore/javascript/src/model/ModelReturn.js
+++ b/samples/client/petstore/javascript/src/model/ModelReturn.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'));
diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js
index c8bd6862c978..08a5a34c29a6 100644
--- a/samples/client/petstore/javascript/src/model/Name.js
+++ b/samples/client/petstore/javascript/src/model/Name.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'));
diff --git a/samples/client/petstore/javascript/src/model/Order.js b/samples/client/petstore/javascript/src/model/Order.js
index 81f1feb78000..664908b77a9a 100644
--- a/samples/client/petstore/javascript/src/model/Order.js
+++ b/samples/client/petstore/javascript/src/model/Order.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -44,7 +45,7 @@
* @return {module:model/Order} The populated Order instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js
index 39a09b471700..ae907d35ca2f 100644
--- a/samples/client/petstore/javascript/src/model/Pet.js
+++ b/samples/client/petstore/javascript/src/model/Pet.js
@@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
- define(['../ApiClient', './Category', './Tag'], factory);
+ define(['ApiClient', 'model/Category', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Category'), require('./Tag'));
@@ -29,11 +29,12 @@
* @param photoUrls
*/
var exports = function(name, photoUrls) {
+ var _this = this;
- this['name'] = name;
- this['photoUrls'] = photoUrls;
+ _this['name'] = name;
+ _this['photoUrls'] = photoUrls;
};
@@ -46,7 +47,7 @@
* @return {module:model/Pet} The populated Pet instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js
index fb6b4765d3fc..8694196cdd96 100644
--- a/samples/client/petstore/javascript/src/model/SpecialModelName.js
+++ b/samples/client/petstore/javascript/src/model/SpecialModelName.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'));
diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js
index 8a0739b2ef5b..d9ab35fb8b53 100644
--- a/samples/client/petstore/javascript/src/model/Tag.js
+++ b/samples/client/petstore/javascript/src/model/Tag.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -40,7 +41,7 @@
* @return {module:model/Tag} The populated Tag instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js
index 1d960a89914b..3bc6aaab630e 100644
--- a/samples/client/petstore/javascript/src/model/User.js
+++ b/samples/client/petstore/javascript/src/model/User.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'));
@@ -27,6 +27,7 @@
* @class
*/
var exports = function() {
+ var _this = this;
@@ -46,7 +47,7 @@
* @return {module:model/User} The populated User instance.
*/
exports.constructFromObject = function(data, obj) {
- if (data) {
+ if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
diff --git a/samples/client/petstore/javascript/test/ApiClientTest.js b/samples/client/petstore/javascript/test/ApiClientTest.js
index d259ad54c147..3a8eb843d74d 100644
--- a/samples/client/petstore/javascript/test/ApiClientTest.js
+++ b/samples/client/petstore/javascript/test/ApiClientTest.js
@@ -13,7 +13,11 @@ describe('ApiClient', function() {
expect(apiClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(apiClient.authentications).to.eql({
petstore_auth: {type: 'oauth2'},
- api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'},
+ api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}
+ /* commented out the following as these fake security def (testing purpose)
+ * has been removed from the spec, we'll add it back after updating the
+ * petstore server
+ *
test_http_basic: {type: 'basic'},
test_api_client_id: {
type: 'apiKey',
@@ -34,7 +38,7 @@ describe('ApiClient', function() {
type: 'apiKey',
'in': 'header',
name: 'test_api_key_header'
- }
+ }*/
});
});
diff --git a/samples/client/petstore/javascript/test/api/PetApiTest.js b/samples/client/petstore/javascript/test/api/PetApiTest.js
index d5f7ba3424c7..700b30ac5059 100644
--- a/samples/client/petstore/javascript/test/api/PetApiTest.js
+++ b/samples/client/petstore/javascript/test/api/PetApiTest.js
@@ -79,6 +79,8 @@
});
});
+ /* commented out the following as the fake endpoint has been removed from the spec
+ * we'll add it back after updating the Petstore server
it('getPetByIdInObject', function(done) {
var pet = createRandomPet();
api.addPet({body: pet}, function(error) {
@@ -104,6 +106,7 @@
});
});
});
+ */
});
}));
diff --git a/samples/client/petstore/javascript/test/api/StoreApiTest.js b/samples/client/petstore/javascript/test/api/StoreApiTest.js
index 6347148221a8..65fb06b3fd08 100644
--- a/samples/client/petstore/javascript/test/api/StoreApiTest.js
+++ b/samples/client/petstore/javascript/test/api/StoreApiTest.js
@@ -19,6 +19,9 @@
});
describe('StoreApi', function() {
+ /* commented out the following as the fake endpoint has been removed from the spec
+ * we'll add it back after updating the petstore server
+ *
it('getInventoryInObject', function(done) {
api.getInventoryInObject(function(error, obj) {
if (error) throw error;
@@ -36,6 +39,7 @@
done();
});
});
+ */
});
}));
diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md
index 80e8d1bae7a9..e7d9b552b043 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-23T22:48:00.795+08:00
+- Build date: 2016-04-29T03:01:58.276Z
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements
@@ -58,16 +58,24 @@ Please follow the [installation procedure](#installation--usage) and then run th
setAccessToken('YOUR_ACCESS_TOKEN');
-
-$api_instance = new Swagger\Client\Api\PetApi();
-$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
+$api_instance = new Swagger\Client\Api\FakeApi();
+$number = "number_example"; // string | None
+$double = 1.2; // double | None
+$string = "string_example"; // string | None
+$byte = "B"; // string | None
+$integer = 56; // int | None
+$int32 = 56; // int | None
+$int64 = 789; // int | None
+$float = 3.4; // float | None
+$binary = "B"; // string | None
+$date = new \DateTime(); // \DateTime | None
+$date_time = new \DateTime(); // \DateTime | None
+$password = "password_example"; // string | None
try {
- $api_instance->addPet($body);
+ $api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
} catch (Exception $e) {
- echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n";
+ echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n";
}
?>
@@ -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
diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md
new file mode 100644
index 000000000000..bc47365c9e0d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md
@@ -0,0 +1,75 @@
+# Swagger\Client\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, $date_time, $password)
+
+Fake endpoint for testing various parameters
+
+Fake endpoint for testing various parameters
+
+### Example
+```php
+testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
+} catch (Exception $e) {
+ echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n";
+}
+?>
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **string**| None |
+ **double** | **double**| None |
+ **string** | **string**| None |
+ **byte** | **string**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **binary** | **string**| None | [optional]
+ **date** | **\DateTime**| None | [optional]
+ **date_time** | **\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/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php
new file mode 100644
index 000000000000..ee15a10d025a
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php
@@ -0,0 +1,285 @@
+getConfig()->setHost('http://petstore.swagger.io/v2');
+ }
+
+ $this->apiClient = $apiClient;
+ }
+
+ /**
+ * Get API client
+ * @return \Swagger\Client\ApiClient get the API client
+ */
+ public function getApiClient()
+ {
+ return $this->apiClient;
+ }
+
+ /**
+ * Set the API client
+ * @param \Swagger\Client\ApiClient $apiClient set the API client
+ * @return FakeApi
+ */
+ public function setApiClient(ApiClient $apiClient)
+ {
+ $this->apiClient = $apiClient;
+ return $this;
+ }
+
+ /**
+ * testEndpointParameters
+ *
+ * Fake endpoint for testing various parameters
+ *
+ * @param string $number None (required)
+ * @param double $double None (required)
+ * @param string $string None (required)
+ * @param string $byte None (required)
+ * @param int $integer None (optional)
+ * @param int $int32 None (optional)
+ * @param int $int64 None (optional)
+ * @param float $float None (optional)
+ * @param string $binary None (optional)
+ * @param \DateTime $date None (optional)
+ * @param \DateTime $date_time None (optional)
+ * @param string $password None (optional)
+ * @return void
+ * @throws \Swagger\Client\ApiException on non-2xx response
+ */
+ public function testEndpointParameters($number, $double, $string, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $binary = null, $date = null, $date_time = null, $password = null)
+ {
+ list($response) = $this->testEndpointParametersWithHttpInfo ($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
+ return $response;
+ }
+
+
+ /**
+ * testEndpointParametersWithHttpInfo
+ *
+ * Fake endpoint for testing various parameters
+ *
+ * @param string $number None (required)
+ * @param double $double None (required)
+ * @param string $string None (required)
+ * @param string $byte None (required)
+ * @param int $integer None (optional)
+ * @param int $int32 None (optional)
+ * @param int $int64 None (optional)
+ * @param float $float None (optional)
+ * @param string $binary None (optional)
+ * @param \DateTime $date None (optional)
+ * @param \DateTime $date_time None (optional)
+ * @param string $password None (optional)
+ * @return Array of null, HTTP status code, HTTP response headers (array of strings)
+ * @throws \Swagger\Client\ApiException on non-2xx response
+ */
+ public function testEndpointParametersWithHttpInfo($number, $double, $string, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $binary = null, $date = null, $date_time = null, $password = null)
+ {
+
+ // verify the required parameter 'number' is set
+ if ($number === null) {
+ throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters');
+ }
+ if ($number > 543.2) {
+ throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.');
+ }
+ if ($number < 32.1) {
+ throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.');
+ }
+
+
+ // verify the required parameter 'double' is set
+ if ($double === null) {
+ throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters');
+ }
+ if ($double > 123.4) {
+ throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.');
+ }
+ if ($double < 67.8) {
+ throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.');
+ }
+
+
+ // verify the required parameter 'string' is set
+ if ($string === null) {
+ throw new \InvalidArgumentException('Missing the required parameter $string when calling testEndpointParameters');
+ }
+ if (!preg_match("/[a-z]/i", $string)) {
+ throw new \InvalidArgumentException('invalid value for "string" when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i.');
+ }
+
+
+ // verify the required parameter 'byte' is set
+ if ($byte === null) {
+ throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters');
+ }
+ if ($integer > 100.0) {
+ throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.0.');
+ }
+ if ($integer < 10.0) {
+ throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.0.');
+ }
+
+ if ($int32 > 200.0) {
+ throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.0.');
+ }
+ if ($int32 < 20.0) {
+ throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.0.');
+ }
+
+ if ($float > 987.6) {
+ throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.');
+ }
+
+ if (strlen($password) > 64) {
+ throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.');
+ }
+ if (strlen($password) > 10) {
+ throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.');
+ }
+
+
+ // parse inputs
+ $resourcePath = "/fake";
+ $httpBody = '';
+ $queryParams = array();
+ $headerParams = array();
+ $formParams = array();
+ $_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
+ if (!is_null($_header_accept)) {
+ $headerParams['Accept'] = $_header_accept;
+ }
+ $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
+
+
+
+
+ // default format to json
+ $resourcePath = str_replace("{format}", "json", $resourcePath);
+
+ // form params
+ if ($integer !== null) {
+ $formParams['integer'] = $this->apiClient->getSerializer()->toFormValue($integer);
+ }// form params
+ if ($int32 !== null) {
+ $formParams['int32'] = $this->apiClient->getSerializer()->toFormValue($int32);
+ }// form params
+ if ($int64 !== null) {
+ $formParams['int64'] = $this->apiClient->getSerializer()->toFormValue($int64);
+ }// form params
+ if ($number !== null) {
+ $formParams['number'] = $this->apiClient->getSerializer()->toFormValue($number);
+ }// form params
+ if ($float !== null) {
+ $formParams['float'] = $this->apiClient->getSerializer()->toFormValue($float);
+ }// form params
+ if ($double !== null) {
+ $formParams['double'] = $this->apiClient->getSerializer()->toFormValue($double);
+ }// form params
+ if ($string !== null) {
+ $formParams['string'] = $this->apiClient->getSerializer()->toFormValue($string);
+ }// form params
+ if ($byte !== null) {
+ $formParams['byte'] = $this->apiClient->getSerializer()->toFormValue($byte);
+ }// form params
+ if ($binary !== null) {
+ $formParams['binary'] = $this->apiClient->getSerializer()->toFormValue($binary);
+ }// form params
+ if ($date !== null) {
+ $formParams['date'] = $this->apiClient->getSerializer()->toFormValue($date);
+ }// form params
+ if ($date_time !== null) {
+ $formParams['dateTime'] = $this->apiClient->getSerializer()->toFormValue($date_time);
+ }// form params
+ if ($password !== null) {
+ $formParams['password'] = $this->apiClient->getSerializer()->toFormValue($password);
+ }
+
+
+ // for model (json/xml)
+ if (isset($_tempBody)) {
+ $httpBody = $_tempBody; // $_tempBody is the method argument, if present
+ } elseif (count($formParams) > 0) {
+ $httpBody = $formParams; // for HTTP post (form)
+ }
+ // make the API Call
+ try {
+ list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
+ $resourcePath, 'POST',
+ $queryParams, $httpBody,
+ $headerParams
+ );
+
+ return array(null, $statusCode, $httpHeader);
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ }
+
+ throw $e;
+ }
+ }
+}
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 e5bf83b4463d..27253a09f4fc 100644
--- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php
+++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php
@@ -122,6 +122,10 @@ class StoreApi
if ($order_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
}
+ if ($order_id < 1.0) {
+ throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.');
+ }
+
// parse inputs
$resourcePath = "/store/order/{orderId}";
@@ -198,8 +202,7 @@ class StoreApi
*/
public function getInventoryWithHttpInfo()
{
-
-
+
// parse inputs
$resourcePath = "/store/inventory";
$httpBody = '';
@@ -289,6 +292,13 @@ class StoreApi
if ($order_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling getOrderById');
}
+ if ($order_id > 5.0) {
+ throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.0.');
+ }
+ if ($order_id < 1.0) {
+ throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.');
+ }
+
// parse inputs
$resourcePath = "/store/order/{orderId}";
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 4882ccd97640..96c9fa6fc09a 100644
--- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php
+++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php
@@ -537,6 +537,7 @@ class UserApi
if ($username === null) {
throw new \InvalidArgumentException('Missing the required parameter $username when calling loginUser');
}
+
// verify the required parameter 'password' is set
if ($password === null) {
throw new \InvalidArgumentException('Missing the required parameter $password when calling loginUser');
@@ -623,8 +624,7 @@ class UserApi
*/
public function logoutUserWithHttpInfo()
{
-
-
+
// parse inputs
$resourcePath = "/user/logout";
$httpBody = '';
@@ -702,6 +702,7 @@ class UserApi
if ($username === null) {
throw new \InvalidArgumentException('Missing the required parameter $username when calling updateUser');
}
+
// verify the required parameter 'body' is set
if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling updateUser');
diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/FakeApiTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/FakeApiTest.php
new file mode 100644
index 000000000000..47b8fa21b68b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/FakeApiTest.php
@@ -0,0 +1,76 @@
+add_pet: %s\n" % e
+ print "Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e
```
@@ -71,6 +79,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
+*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md
new file mode 100644
index 000000000000..66d9a04434a5
--- /dev/null
+++ b/samples/client/petstore/python/docs/FakeApi.md
@@ -0,0 +1,77 @@
+# swagger_client.FakeApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters
+
+
+# **test_endpoint_parameters**
+> test_endpoint_parameters(number, double, string, byte, integer=integer, int32=int32, int64=int64, float=float, binary=binary, date=date, date_time=date_time, password=password)
+
+Fake endpoint for testing various parameters
+
+Fake endpoint for testing various parameters
+
+### Example
+```python
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# create an instance of the API class
+api_instance = swagger_client.FakeApi()
+number = 3.4 # float | None
+double = 1.2 # float | None
+string = 'string_example' # str | None
+byte = 'B' # str | None
+integer = 56 # int | None (optional)
+int32 = 56 # int | None (optional)
+int64 = 789 # int | None (optional)
+float = 3.4 # float | None (optional)
+binary = 'B' # str | None (optional)
+date = '2013-10-20' # date | None (optional)
+date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
+password = 'password_example' # str | None (optional)
+
+try:
+ # Fake endpoint for testing various parameters
+ api_instance.test_endpoint_parameters(number, double, string, byte, integer=integer, int32=int32, int64=int64, float=float, binary=binary, date=date, date_time=date_time, password=password)
+except ApiException as e:
+ print "Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **string** | **str**| None |
+ **byte** | **str**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **binary** | **str**| None | [optional]
+ **date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional]
+ **password** | **str**| 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/python/docs/FormatTest.md b/samples/client/petstore/python/docs/FormatTest.md
index 4182a4470860..3e489e863fa0 100644
--- a/samples/client/petstore/python/docs/FormatTest.md
+++ b/samples/client/petstore/python/docs/FormatTest.md
@@ -10,11 +10,12 @@ Name | Type | Description | Notes
**float** | **float** | | [optional]
**double** | **float** | | [optional]
**string** | **str** | | [optional]
-**byte** | **str** | | [optional]
+**byte** | **str** | |
**binary** | **str** | | [optional]
-**date** | **date** | | [optional]
+**date** | **date** | |
**date_time** | **datetime** | | [optional]
-**password** | **str** | | [optional]
+**uuid** | **str** | | [optional]
+**password** | **str** | |
[[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/python/swagger_client.egg-info/top_level.txt b/samples/client/petstore/python/swagger_client.egg-info/top_level.txt
index 9a02a75c0585..01f6691e7caf 100644
--- a/samples/client/petstore/python/swagger_client.egg-info/top_level.txt
+++ b/samples/client/petstore/python/swagger_client.egg-info/top_level.txt
@@ -1,2 +1,3 @@
swagger_client
+test
tests
diff --git a/samples/client/petstore/python/swagger_client/__init__.py b/samples/client/petstore/python/swagger_client/__init__.py
index 2169ecd37e79..783f8b9713ad 100644
--- a/samples/client/petstore/python/swagger_client/__init__.py
+++ b/samples/client/petstore/python/swagger_client/__init__.py
@@ -17,6 +17,7 @@ from .models.tag import Tag
from .models.user import User
# import apis into sdk package
+from .apis.fake_api import FakeApi
from .apis.pet_api import PetApi
from .apis.store_api import StoreApi
from .apis.user_api import UserApi
diff --git a/samples/client/petstore/python/swagger_client/apis/__init__.py b/samples/client/petstore/python/swagger_client/apis/__init__.py
index a3a12ea9ac1a..ddde8c164bf4 100644
--- a/samples/client/petstore/python/swagger_client/apis/__init__.py
+++ b/samples/client/petstore/python/swagger_client/apis/__init__.py
@@ -1,6 +1,7 @@
from __future__ import absolute_import
# import apis into api package
+from .fake_api import FakeApi
from .pet_api import PetApi
from .store_api import StoreApi
from .user_api import UserApi
diff --git a/samples/client/petstore/python/swagger_client/apis/fake_api.py b/samples/client/petstore/python/swagger_client/apis/fake_api.py
new file mode 100644
index 000000000000..2b183794ef16
--- /dev/null
+++ b/samples/client/petstore/python/swagger_client/apis/fake_api.py
@@ -0,0 +1,165 @@
+# coding: utf-8
+
+"""
+FakeApi.py
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+"""
+
+from __future__ import absolute_import
+
+import sys
+import os
+
+# python 2 and python 3 compatibility library
+from six import iteritems
+
+from ..configuration import Configuration
+from ..api_client import ApiClient
+
+
+class FakeApi(object):
+ """
+ NOTE: This class is auto generated by the swagger code generator program.
+ Do not edit the class manually.
+ Ref: https://github.com/swagger-api/swagger-codegen
+ """
+
+ def __init__(self, api_client=None):
+ config = Configuration()
+ if api_client:
+ self.api_client = api_client
+ else:
+ if not config.api_client:
+ config.api_client = ApiClient()
+ self.api_client = config.api_client
+
+ def test_endpoint_parameters(self, number, double, string, byte, **kwargs):
+ """
+ Fake endpoint for testing various parameters
+ Fake endpoint for testing various parameters
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please define a `callback` function
+ to be invoked when receiving the response.
+ >>> def callback_function(response):
+ >>> pprint(response)
+ >>>
+ >>> thread = api.test_endpoint_parameters(number, double, string, byte, callback=callback_function)
+
+ :param callback function: The callback function
+ for asynchronous request. (optional)
+ :param float number: None (required)
+ :param float double: None (required)
+ :param str string: None (required)
+ :param str byte: None (required)
+ :param int integer: None
+ :param int int32: None
+ :param int int64: None
+ :param float float: None
+ :param str binary: None
+ :param date date: None
+ :param datetime date_time: None
+ :param str password: None
+ :return: None
+ If the method is called asynchronously,
+ returns the request thread.
+ """
+
+ all_params = ['number', 'double', 'string', 'byte', 'integer', 'int32', 'int64', 'float', 'binary', 'date', 'date_time', 'password']
+ all_params.append('callback')
+
+ params = locals()
+ for key, val in iteritems(params['kwargs']):
+ if key not in all_params:
+ raise TypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_endpoint_parameters" % key
+ )
+ params[key] = val
+ del params['kwargs']
+
+ # verify the required parameter 'number' is set
+ if ('number' not in params) or (params['number'] is None):
+ raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`")
+ # verify the required parameter 'double' is set
+ if ('double' not in params) or (params['double'] is None):
+ raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`")
+ # verify the required parameter 'string' is set
+ if ('string' not in params) or (params['string'] is None):
+ raise ValueError("Missing the required parameter `string` when calling `test_endpoint_parameters`")
+ # verify the required parameter 'byte' is set
+ if ('byte' not in params) or (params['byte'] is None):
+ raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`")
+
+ resource_path = '/fake'.replace('{format}', 'json')
+ path_params = {}
+
+ query_params = {}
+
+ header_params = {}
+
+ form_params = []
+ local_var_files = {}
+ if 'integer' in params:
+ form_params.append(('integer', params['integer']))
+ if 'int32' in params:
+ form_params.append(('int32', params['int32']))
+ if 'int64' in params:
+ form_params.append(('int64', params['int64']))
+ if 'number' in params:
+ form_params.append(('number', params['number']))
+ if 'float' in params:
+ form_params.append(('float', params['float']))
+ if 'double' in params:
+ form_params.append(('double', params['double']))
+ if 'string' in params:
+ form_params.append(('string', params['string']))
+ if 'byte' in params:
+ form_params.append(('byte', params['byte']))
+ if 'binary' in params:
+ form_params.append(('binary', params['binary']))
+ if 'date' in params:
+ form_params.append(('date', params['date']))
+ if 'date_time' in params:
+ form_params.append(('dateTime', params['date_time']))
+ if 'password' in params:
+ form_params.append(('password', params['password']))
+
+ body_params = None
+
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.\
+ select_header_accept(['application/xml', 'application/json'])
+ if not header_params['Accept']:
+ del header_params['Accept']
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = self.api_client.\
+ select_header_content_type([])
+
+ # Authentication setting
+ auth_settings = []
+
+ response = self.api_client.call_api(resource_path, 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_type=None,
+ auth_settings=auth_settings,
+ callback=params.get('callback'))
+ return response
diff --git a/samples/client/petstore/python/swagger_client/models/format_test.py b/samples/client/petstore/python/swagger_client/models/format_test.py
index 8654d79bc3c6..28f348edf047 100644
--- a/samples/client/petstore/python/swagger_client/models/format_test.py
+++ b/samples/client/petstore/python/swagger_client/models/format_test.py
@@ -48,6 +48,7 @@ class FormatTest(object):
'binary': 'str',
'date': 'date',
'date_time': 'datetime',
+ 'uuid': 'str',
'password': 'str'
}
@@ -63,6 +64,7 @@ class FormatTest(object):
'binary': 'binary',
'date': 'date',
'date_time': 'dateTime',
+ 'uuid': 'uuid',
'password': 'password'
}
@@ -77,6 +79,7 @@ class FormatTest(object):
self._binary = None
self._date = None
self._date_time = None
+ self._uuid = None
self._password = None
@property
@@ -321,6 +324,28 @@ class FormatTest(object):
"""
self._date_time = date_time
+ @property
+ def uuid(self):
+ """
+ Gets the uuid of this FormatTest.
+
+
+ :return: The uuid of this FormatTest.
+ :rtype: str
+ """
+ return self._uuid
+
+ @uuid.setter
+ def uuid(self, uuid):
+ """
+ Sets the uuid of this FormatTest.
+
+
+ :param uuid: The uuid of this FormatTest.
+ :type: str
+ """
+ self._uuid = uuid
+
@property
def password(self):
"""
diff --git a/samples/client/petstore/python/test/__init__.py b/samples/client/petstore/python/test/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python/test/test_animal.py
new file mode 100644
index 000000000000..279ed1850dd7
--- /dev/null
+++ b/samples/client/petstore/python/test/test_animal.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.animal import Animal
+
+
+class TestAnimal(unittest.TestCase):
+ """ Animal unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testAnimal(self):
+ """
+ Test Animal
+ """
+ model = swagger_client.models.animal.Animal()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_api_response.py b/samples/client/petstore/python/test/test_api_response.py
new file mode 100644
index 000000000000..be73dbf373d2
--- /dev/null
+++ b/samples/client/petstore/python/test/test_api_response.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.api_response import ApiResponse
+
+
+class TestApiResponse(unittest.TestCase):
+ """ ApiResponse unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testApiResponse(self):
+ """
+ Test ApiResponse
+ """
+ model = swagger_client.models.api_response.ApiResponse()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python/test/test_cat.py
new file mode 100644
index 000000000000..728a824fa5b1
--- /dev/null
+++ b/samples/client/petstore/python/test/test_cat.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.cat import Cat
+
+
+class TestCat(unittest.TestCase):
+ """ Cat unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testCat(self):
+ """
+ Test Cat
+ """
+ model = swagger_client.models.cat.Cat()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python/test/test_category.py
new file mode 100644
index 000000000000..793fbdf41b05
--- /dev/null
+++ b/samples/client/petstore/python/test/test_category.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.category import Category
+
+
+class TestCategory(unittest.TestCase):
+ """ Category unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testCategory(self):
+ """
+ Test Category
+ """
+ model = swagger_client.models.category.Category()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py
new file mode 100644
index 000000000000..044dc5be51fc
--- /dev/null
+++ b/samples/client/petstore/python/test/test_dog.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.dog import Dog
+
+
+class TestDog(unittest.TestCase):
+ """ Dog unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testDog(self):
+ """
+ Test Dog
+ """
+ model = swagger_client.models.dog.Dog()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py
new file mode 100644
index 000000000000..29b71bdf81a2
--- /dev/null
+++ b/samples/client/petstore/python/test/test_fake_api.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.apis.fake_api import FakeApi
+
+
+class TestFakeApi(unittest.TestCase):
+ """ FakeApi unit test stubs """
+
+ def setUp(self):
+ self.api = swagger_client.apis.fake_api.FakeApi()
+
+ def tearDown(self):
+ pass
+
+ def test_test_endpoint_parameters(self):
+ """
+ Test case for test_endpoint_parameters
+
+ Fake endpoint for testing various parameters
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py
new file mode 100644
index 000000000000..11101ad52da3
--- /dev/null
+++ b/samples/client/petstore/python/test/test_format_test.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.format_test import FormatTest
+
+
+class TestFormatTest(unittest.TestCase):
+ """ FormatTest unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testFormatTest(self):
+ """
+ Test FormatTest
+ """
+ model = swagger_client.models.format_test.FormatTest()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_model_200_response.py b/samples/client/petstore/python/test/test_model_200_response.py
new file mode 100644
index 000000000000..8328d2b97578
--- /dev/null
+++ b/samples/client/petstore/python/test/test_model_200_response.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.model_200_response import Model200Response
+
+
+class TestModel200Response(unittest.TestCase):
+ """ Model200Response unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testModel200Response(self):
+ """
+ Test Model200Response
+ """
+ model = swagger_client.models.model_200_response.Model200Response()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_model_return.py b/samples/client/petstore/python/test/test_model_return.py
new file mode 100644
index 000000000000..4ff3f38b2eb5
--- /dev/null
+++ b/samples/client/petstore/python/test/test_model_return.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.model_return import ModelReturn
+
+
+class TestModelReturn(unittest.TestCase):
+ """ ModelReturn unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testModelReturn(self):
+ """
+ Test ModelReturn
+ """
+ model = swagger_client.models.model_return.ModelReturn()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_name.py b/samples/client/petstore/python/test/test_name.py
new file mode 100644
index 000000000000..c3b27897eb1e
--- /dev/null
+++ b/samples/client/petstore/python/test/test_name.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.name import Name
+
+
+class TestName(unittest.TestCase):
+ """ Name unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testName(self):
+ """
+ Test Name
+ """
+ model = swagger_client.models.name.Name()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_order.py b/samples/client/petstore/python/test/test_order.py
new file mode 100644
index 000000000000..23beefe346c6
--- /dev/null
+++ b/samples/client/petstore/python/test/test_order.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.order import Order
+
+
+class TestOrder(unittest.TestCase):
+ """ Order unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOrder(self):
+ """
+ Test Order
+ """
+ model = swagger_client.models.order.Order()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python/test/test_pet.py
new file mode 100644
index 000000000000..471b7b4f67c8
--- /dev/null
+++ b/samples/client/petstore/python/test/test_pet.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.pet import Pet
+
+
+class TestPet(unittest.TestCase):
+ """ Pet unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testPet(self):
+ """
+ Test Pet
+ """
+ model = swagger_client.models.pet.Pet()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_pet_api.py b/samples/client/petstore/python/test/test_pet_api.py
new file mode 100644
index 000000000000..81ee6c76e9c7
--- /dev/null
+++ b/samples/client/petstore/python/test/test_pet_api.py
@@ -0,0 +1,107 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.apis.pet_api import PetApi
+
+
+class TestPetApi(unittest.TestCase):
+ """ PetApi unit test stubs """
+
+ def setUp(self):
+ self.api = swagger_client.apis.pet_api.PetApi()
+
+ def tearDown(self):
+ pass
+
+ def test_add_pet(self):
+ """
+ Test case for add_pet
+
+ Add a new pet to the store
+ """
+ pass
+
+ def test_delete_pet(self):
+ """
+ Test case for delete_pet
+
+ Deletes a pet
+ """
+ pass
+
+ def test_find_pets_by_status(self):
+ """
+ Test case for find_pets_by_status
+
+ Finds Pets by status
+ """
+ pass
+
+ def test_find_pets_by_tags(self):
+ """
+ Test case for find_pets_by_tags
+
+ Finds Pets by tags
+ """
+ pass
+
+ def test_get_pet_by_id(self):
+ """
+ Test case for get_pet_by_id
+
+ Find pet by ID
+ """
+ pass
+
+ def test_update_pet(self):
+ """
+ Test case for update_pet
+
+ Update an existing pet
+ """
+ pass
+
+ def test_update_pet_with_form(self):
+ """
+ Test case for update_pet_with_form
+
+ Updates a pet in the store with form data
+ """
+ pass
+
+ def test_upload_file(self):
+ """
+ Test case for upload_file
+
+ uploads an image
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_special_model_name.py b/samples/client/petstore/python/test/test_special_model_name.py
new file mode 100644
index 000000000000..17c12655031e
--- /dev/null
+++ b/samples/client/petstore/python/test/test_special_model_name.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.special_model_name import SpecialModelName
+
+
+class TestSpecialModelName(unittest.TestCase):
+ """ SpecialModelName unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testSpecialModelName(self):
+ """
+ Test SpecialModelName
+ """
+ model = swagger_client.models.special_model_name.SpecialModelName()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_store_api.py b/samples/client/petstore/python/test/test_store_api.py
new file mode 100644
index 000000000000..e8dc0a64b1ca
--- /dev/null
+++ b/samples/client/petstore/python/test/test_store_api.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.apis.store_api import StoreApi
+
+
+class TestStoreApi(unittest.TestCase):
+ """ StoreApi unit test stubs """
+
+ def setUp(self):
+ self.api = swagger_client.apis.store_api.StoreApi()
+
+ def tearDown(self):
+ pass
+
+ def test_delete_order(self):
+ """
+ Test case for delete_order
+
+ Delete purchase order by ID
+ """
+ pass
+
+ def test_get_inventory(self):
+ """
+ Test case for get_inventory
+
+ Returns pet inventories by status
+ """
+ pass
+
+ def test_get_order_by_id(self):
+ """
+ Test case for get_order_by_id
+
+ Find purchase order by ID
+ """
+ pass
+
+ def test_place_order(self):
+ """
+ Test case for place_order
+
+ Place an order for a pet
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_tag.py b/samples/client/petstore/python/test/test_tag.py
new file mode 100644
index 000000000000..35b51e4d7d2e
--- /dev/null
+++ b/samples/client/petstore/python/test/test_tag.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.tag import Tag
+
+
+class TestTag(unittest.TestCase):
+ """ Tag unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testTag(self):
+ """
+ Test Tag
+ """
+ model = swagger_client.models.tag.Tag()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_user.py b/samples/client/petstore/python/test/test_user.py
new file mode 100644
index 000000000000..1aad154cbf8c
--- /dev/null
+++ b/samples/client/petstore/python/test/test_user.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.models.user import User
+
+
+class TestUser(unittest.TestCase):
+ """ User unit test stubs """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testUser(self):
+ """
+ Test User
+ """
+ model = swagger_client.models.user.User()
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/python/test/test_user_api.py b/samples/client/petstore/python/test/test_user_api.py
new file mode 100644
index 000000000000..0205fe7383ab
--- /dev/null
+++ b/samples/client/petstore/python/test/test_user_api.py
@@ -0,0 +1,107 @@
+# coding: utf-8
+
+"""
+Copyright 2016 SmartBear Software
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ref: https://github.com/swagger-api/swagger-codegen
+"""
+
+from __future__ import absolute_import
+
+import os
+import sys
+import unittest
+
+import swagger_client
+from swagger_client.rest import ApiException
+from swagger_client.apis.user_api import UserApi
+
+
+class TestUserApi(unittest.TestCase):
+ """ UserApi unit test stubs """
+
+ def setUp(self):
+ self.api = swagger_client.apis.user_api.UserApi()
+
+ def tearDown(self):
+ pass
+
+ def test_create_user(self):
+ """
+ Test case for create_user
+
+ Create user
+ """
+ pass
+
+ def test_create_users_with_array_input(self):
+ """
+ Test case for create_users_with_array_input
+
+ Creates list of users with given input array
+ """
+ pass
+
+ def test_create_users_with_list_input(self):
+ """
+ Test case for create_users_with_list_input
+
+ Creates list of users with given input array
+ """
+ pass
+
+ def test_delete_user(self):
+ """
+ Test case for delete_user
+
+ Delete user
+ """
+ pass
+
+ def test_get_user_by_name(self):
+ """
+ Test case for get_user_by_name
+
+ Get user by user name
+ """
+ pass
+
+ def test_login_user(self):
+ """
+ Test case for login_user
+
+ Logs user into the system
+ """
+ pass
+
+ def test_logout_user(self):
+ """
+ Test case for logout_user
+
+ Logs out current logged in user session
+ """
+ pass
+
+ def test_update_user(self):
+ """
+ Test case for update_user
+
+ Updated user
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
\ No newline at end of file
diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md
index 9d9deefd9eec..da8816ec7113 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-25T23:58:59.140+08:00
+- Build date: 2016-04-29T11:03:36.514+08:00
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
## Installation
@@ -57,7 +57,7 @@ require 'petstore'
api_instance = Petstore::FakeApi.new
-number = "number_example" # String | None
+number = 3.4 # Float | None
double = 1.2 # Float | None
diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md
index a7c0b42a4759..32f2902d930a 100644
--- a/samples/client/petstore/ruby/docs/FakeApi.md
+++ b/samples/client/petstore/ruby/docs/FakeApi.md
@@ -21,7 +21,7 @@ require 'petstore'
api_instance = Petstore::FakeApi.new
-number = "number_example" # String | None
+number = 3.4 # Float | None
double = 1.2 # Float | None
@@ -52,7 +52,7 @@ end
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **number** | **String**| None |
+ **number** | **Float**| None |
**double** | **Float**| None |
**string** | **String**| None |
**byte** | **String**| None |
diff --git a/samples/client/petstore/ruby/docs/FormatTest.md b/samples/client/petstore/ruby/docs/FormatTest.md
index 7197a7a6584f..014f2431f122 100644
--- a/samples/client/petstore/ruby/docs/FormatTest.md
+++ b/samples/client/petstore/ruby/docs/FormatTest.md
@@ -14,6 +14,7 @@ Name | Type | Description | Notes
**binary** | **String** | | [optional]
**date** | **Date** | |
**date_time** | **DateTime** | | [optional]
+**uuid** | [**UUID**](UUID.md) | | [optional]
**password** | **String** | |
diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb
index 2f26f9b4bb0e..5612f227d097 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb
@@ -42,7 +42,7 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'className']
+ if attributes.has_key?(:'className')
self.class_name = attributes[:'className']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb
index da0418eda508..79da573e9413 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb
@@ -50,15 +50,15 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'code']
+ if attributes.has_key?(:'code')
self.code = attributes[:'code']
end
- if attributes[:'type']
+ if attributes.has_key?(:'type')
self.type = attributes[:'type']
end
- if attributes[:'message']
+ if attributes.has_key?(:'message')
self.message = attributes[:'message']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb
index 0f8c34f0896e..12f17b85553e 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb
@@ -46,11 +46,11 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'className']
+ if attributes.has_key?(:'className')
self.class_name = attributes[:'className']
end
- if attributes[:'declawed']
+ if attributes.has_key?(:'declawed')
self.declawed = attributes[:'declawed']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb
index 33e4a539fb3e..c4879d65bb4b 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/category.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb
@@ -46,11 +46,11 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'id']
+ if attributes.has_key?(:'id')
self.id = attributes[:'id']
end
- if attributes[:'name']
+ if attributes.has_key?(:'name')
self.name = attributes[:'name']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb
index 66fd396e753b..90d213dbf45e 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb
@@ -46,11 +46,11 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'className']
+ if attributes.has_key?(:'className')
self.class_name = attributes[:'className']
end
- if attributes[:'breed']
+ if attributes.has_key?(:'breed')
self.breed = attributes[:'breed']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb
index e4373bb955f1..807a8f4d605b 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb
@@ -40,6 +40,8 @@ module Petstore
attr_accessor :date_time
+ attr_accessor :uuid
+
attr_accessor :password
# Attribute mapping from ruby-style variable name to JSON key.
@@ -56,6 +58,7 @@ module Petstore
:'binary' => :'binary',
:'date' => :'date',
:'date_time' => :'dateTime',
+ :'uuid' => :'uuid',
:'password' => :'password'
}
end
@@ -74,6 +77,7 @@ module Petstore
:'binary' => :'String',
:'date' => :'Date',
:'date_time' => :'DateTime',
+ :'uuid' => :'UUID',
:'password' => :'String'
}
end
@@ -86,51 +90,55 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'integer']
+ if attributes.has_key?(:'integer')
self.integer = attributes[:'integer']
end
- if attributes[:'int32']
+ if attributes.has_key?(:'int32')
self.int32 = attributes[:'int32']
end
- if attributes[:'int64']
+ if attributes.has_key?(:'int64')
self.int64 = attributes[:'int64']
end
- if attributes[:'number']
+ if attributes.has_key?(:'number')
self.number = attributes[:'number']
end
- if attributes[:'float']
+ if attributes.has_key?(:'float')
self.float = attributes[:'float']
end
- if attributes[:'double']
+ if attributes.has_key?(:'double')
self.double = attributes[:'double']
end
- if attributes[:'string']
+ if attributes.has_key?(:'string')
self.string = attributes[:'string']
end
- if attributes[:'byte']
+ if attributes.has_key?(:'byte')
self.byte = attributes[:'byte']
end
- if attributes[:'binary']
+ if attributes.has_key?(:'binary')
self.binary = attributes[:'binary']
end
- if attributes[:'date']
+ if attributes.has_key?(:'date')
self.date = attributes[:'date']
end
- if attributes[:'dateTime']
+ if attributes.has_key?(:'dateTime')
self.date_time = attributes[:'dateTime']
end
- if attributes[:'password']
+ if attributes.has_key?(:'uuid')
+ self.uuid = attributes[:'uuid']
+ end
+
+ if attributes.has_key?(:'password')
self.password = attributes[:'password']
end
@@ -354,6 +362,7 @@ module Petstore
binary == o.binary &&
date == o.date &&
date_time == o.date_time &&
+ uuid == o.uuid &&
password == o.password
end
@@ -366,7 +375,7 @@ module Petstore
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
- [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, password].hash
+ [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password].hash
end
# Builds the object from hash
diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb
index 71b4501d99e8..7a2473fb8b90 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb
@@ -43,7 +43,7 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'name']
+ if attributes.has_key?(:'name')
self.name = attributes[:'name']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb
index bb015662bc48..0361451b290d 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb
@@ -43,7 +43,7 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'return']
+ if attributes.has_key?(:'return')
self._return = attributes[:'return']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb
index bec29f9c69eb..d5e3ef4adb80 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/name.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb
@@ -51,15 +51,15 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'name']
+ if attributes.has_key?(:'name')
self.name = attributes[:'name']
end
- if attributes[:'snake_case']
+ if attributes.has_key?(:'snake_case')
self.snake_case = attributes[:'snake_case']
end
- if attributes[:'property']
+ if attributes.has_key?(:'property')
self.property = attributes[:'property']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb
index b243b70cfb87..6c021e50ec7a 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/order.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb
@@ -63,27 +63,27 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'id']
+ if attributes.has_key?(:'id')
self.id = attributes[:'id']
end
- if attributes[:'petId']
+ if attributes.has_key?(:'petId')
self.pet_id = attributes[:'petId']
end
- if attributes[:'quantity']
+ if attributes.has_key?(:'quantity')
self.quantity = attributes[:'quantity']
end
- if attributes[:'shipDate']
+ if attributes.has_key?(:'shipDate')
self.ship_date = attributes[:'shipDate']
end
- if attributes[:'status']
+ if attributes.has_key?(:'status')
self.status = attributes[:'status']
end
- if attributes[:'complete']
+ if attributes.has_key?(:'complete')
self.complete = attributes[:'complete']
else
self.complete = false
diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb
index cdd312f1dad6..ba4d466df21c 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb
@@ -63,31 +63,31 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'id']
+ if attributes.has_key?(:'id')
self.id = attributes[:'id']
end
- if attributes[:'category']
+ if attributes.has_key?(:'category')
self.category = attributes[:'category']
end
- if attributes[:'name']
+ if attributes.has_key?(:'name')
self.name = attributes[:'name']
end
- if attributes[:'photoUrls']
+ if attributes.has_key?(:'photoUrls')
if (value = attributes[:'photoUrls']).is_a?(Array)
self.photo_urls = value
end
end
- if attributes[:'tags']
+ if attributes.has_key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end
- if attributes[:'status']
+ if attributes.has_key?(:'status')
self.status = attributes[:'status']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb
index 94aa62981aab..853d1e496001 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb
@@ -42,7 +42,7 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'$special[property.name]']
+ if attributes.has_key?(:'$special[property.name]')
self.special_property_name = attributes[:'$special[property.name]']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb
index 3ef49f71eaa0..d6d49068e374 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb
@@ -46,11 +46,11 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'id']
+ if attributes.has_key?(:'id')
self.id = attributes[:'id']
end
- if attributes[:'name']
+ if attributes.has_key?(:'name')
self.name = attributes[:'name']
end
diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb
index b9e7b91b08bb..f0c39b741d55 100644
--- a/samples/client/petstore/ruby/lib/petstore/models/user.rb
+++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb
@@ -71,35 +71,35 @@ module Petstore
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
- if attributes[:'id']
+ if attributes.has_key?(:'id')
self.id = attributes[:'id']
end
- if attributes[:'username']
+ if attributes.has_key?(:'username')
self.username = attributes[:'username']
end
- if attributes[:'firstName']
+ if attributes.has_key?(:'firstName')
self.first_name = attributes[:'firstName']
end
- if attributes[:'lastName']
+ if attributes.has_key?(:'lastName')
self.last_name = attributes[:'lastName']
end
- if attributes[:'email']
+ if attributes.has_key?(:'email')
self.email = attributes[:'email']
end
- if attributes[:'password']
+ if attributes.has_key?(:'password')
self.password = attributes[:'password']
end
- if attributes[:'phone']
+ if attributes.has_key?(:'phone')
self.phone = attributes[:'phone']
end
- if attributes[:'userStatus']
+ if attributes.has_key?(:'userStatus')
self.user_status = attributes[:'userStatus']
end
diff --git a/samples/client/petstore/ruby/spec/base_object_spec.rb b/samples/client/petstore/ruby/spec/base_object_spec.rb
index 61dcb4d6d9d3..a315d52276b7 100644
--- a/samples/client/petstore/ruby/spec/base_object_spec.rb
+++ b/samples/client/petstore/ruby/spec/base_object_spec.rb
@@ -30,8 +30,16 @@ class ArrayMapObject < Petstore::Category
end
end
-
describe 'BaseObject' do
+ describe 'boolean values' do
+ let(:obj) { Petstore::Cat.new({declawed: false}) }
+
+ it 'should have values set' do
+ obj.declawed.should_not eq nil
+ obj.declawed.should eq false
+ end
+ end
+
describe 'array and map properties' do
let(:obj) { ArrayMapObject.new }
diff --git a/samples/client/petstore/typescript-angular2-with-npm/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/api/PetApi.ts
rename to samples/client/petstore/typescript-angular2/default/api/PetApi.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/api/StoreApi.ts
rename to samples/client/petstore/typescript-angular2/default/api/StoreApi.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/api/UserApi.ts
rename to samples/client/petstore/typescript-angular2/default/api/UserApi.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/api/api.ts b/samples/client/petstore/typescript-angular2/default/api/api.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/api/api.ts
rename to samples/client/petstore/typescript-angular2/default/api/api.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/index.ts b/samples/client/petstore/typescript-angular2/default/index.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/index.ts
rename to samples/client/petstore/typescript-angular2/default/index.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/model/Category.ts b/samples/client/petstore/typescript-angular2/default/model/Category.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/model/Category.ts
rename to samples/client/petstore/typescript-angular2/default/model/Category.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/model/Order.ts b/samples/client/petstore/typescript-angular2/default/model/Order.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/model/Order.ts
rename to samples/client/petstore/typescript-angular2/default/model/Order.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/model/Pet.ts b/samples/client/petstore/typescript-angular2/default/model/Pet.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/model/Pet.ts
rename to samples/client/petstore/typescript-angular2/default/model/Pet.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/model/Tag.ts b/samples/client/petstore/typescript-angular2/default/model/Tag.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/model/Tag.ts
rename to samples/client/petstore/typescript-angular2/default/model/Tag.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/model/User.ts b/samples/client/petstore/typescript-angular2/default/model/User.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/model/User.ts
rename to samples/client/petstore/typescript-angular2/default/model/User.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/model/models.ts b/samples/client/petstore/typescript-angular2/default/model/models.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/model/models.ts
rename to samples/client/petstore/typescript-angular2/default/model/models.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md
similarity index 84%
rename from samples/client/petstore/typescript-angular2-with-npm/README.md
rename to samples/client/petstore/typescript-angular2/npm/README.md
index 5c393dc49065..8120c59916e1 100644
--- a/samples/client/petstore/typescript-angular2-with-npm/README.md
+++ b/samples/client/petstore/typescript-angular2/npm/README.md
@@ -1,4 +1,4 @@
-## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201604211551
+## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201604282253
### Building
@@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's.
_published:_
```
-npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201604211551 --save
+npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201604282253 --save
```
_unPublished (not recommended):_
diff --git a/samples/client/petstore/typescript-angular2/api/PetApi.ts b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/api/PetApi.ts
rename to samples/client/petstore/typescript-angular2/npm/api/PetApi.ts
diff --git a/samples/client/petstore/typescript-angular2/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/api/StoreApi.ts
rename to samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts
diff --git a/samples/client/petstore/typescript-angular2/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/api/UserApi.ts
rename to samples/client/petstore/typescript-angular2/npm/api/UserApi.ts
diff --git a/samples/client/petstore/typescript-angular2/api/api.ts b/samples/client/petstore/typescript-angular2/npm/api/api.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/api/api.ts
rename to samples/client/petstore/typescript-angular2/npm/api/api.ts
diff --git a/samples/client/petstore/typescript-angular2/index.ts b/samples/client/petstore/typescript-angular2/npm/index.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/index.ts
rename to samples/client/petstore/typescript-angular2/npm/index.ts
diff --git a/samples/client/petstore/typescript-angular2/model/Category.ts b/samples/client/petstore/typescript-angular2/npm/model/Category.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/model/Category.ts
rename to samples/client/petstore/typescript-angular2/npm/model/Category.ts
diff --git a/samples/client/petstore/typescript-angular2/model/Order.ts b/samples/client/petstore/typescript-angular2/npm/model/Order.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/model/Order.ts
rename to samples/client/petstore/typescript-angular2/npm/model/Order.ts
diff --git a/samples/client/petstore/typescript-angular2/model/Pet.ts b/samples/client/petstore/typescript-angular2/npm/model/Pet.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/model/Pet.ts
rename to samples/client/petstore/typescript-angular2/npm/model/Pet.ts
diff --git a/samples/client/petstore/typescript-angular2/model/Tag.ts b/samples/client/petstore/typescript-angular2/npm/model/Tag.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/model/Tag.ts
rename to samples/client/petstore/typescript-angular2/npm/model/Tag.ts
diff --git a/samples/client/petstore/typescript-angular2/model/User.ts b/samples/client/petstore/typescript-angular2/npm/model/User.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/model/User.ts
rename to samples/client/petstore/typescript-angular2/npm/model/User.ts
diff --git a/samples/client/petstore/typescript-angular2/model/models.ts b/samples/client/petstore/typescript-angular2/npm/model/models.ts
similarity index 100%
rename from samples/client/petstore/typescript-angular2/model/models.ts
rename to samples/client/petstore/typescript-angular2/npm/model/models.ts
diff --git a/samples/client/petstore/typescript-angular2-with-npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json
similarity index 89%
rename from samples/client/petstore/typescript-angular2-with-npm/package.json
rename to samples/client/petstore/typescript-angular2/npm/package.json
index f88c08d4df0b..cab5097a4edf 100644
--- a/samples/client/petstore/typescript-angular2-with-npm/package.json
+++ b/samples/client/petstore/typescript-angular2/npm/package.json
@@ -1,7 +1,8 @@
{
"name": "@swagger/angular2-typescript-petstore",
- "version": "0.0.1-SNAPSHOT.201604211551",
+ "version": "0.0.1-SNAPSHOT.201604282253",
"description": "swagger client for @swagger/angular2-typescript-petstore",
+ "author": "Swagger Codegen Contributors",
"keywords": [
"swagger-client"
],
@@ -30,5 +31,4 @@
"publishConfig":{
"registry":"https://skimdb.npmjs.com/registry"
}
-
}
diff --git a/samples/client/petstore/typescript-angular2-with-npm/tsconfig.json b/samples/client/petstore/typescript-angular2/npm/tsconfig.json
similarity index 100%
rename from samples/client/petstore/typescript-angular2-with-npm/tsconfig.json
rename to samples/client/petstore/typescript-angular2/npm/tsconfig.json
diff --git a/samples/client/petstore/typescript-angular2-with-npm/typings.json b/samples/client/petstore/typescript-angular2/npm/typings.json
similarity index 97%
rename from samples/client/petstore/typescript-angular2-with-npm/typings.json
rename to samples/client/petstore/typescript-angular2/npm/typings.json
index 32530eeb63dd..0848dcffe31e 100644
--- a/samples/client/petstore/typescript-angular2-with-npm/typings.json
+++ b/samples/client/petstore/typescript-angular2/npm/typings.json
@@ -2,4 +2,4 @@
"ambientDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654"
}
-}
+}
\ No newline at end of file
diff --git a/samples/client/petstore/typescript-node/.gitignore b/samples/client/petstore/typescript-node/.gitignore
deleted file mode 100644
index 5c06ad7bc24c..000000000000
--- a/samples/client/petstore/typescript-node/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/node_modules
-/typings
-/*.js
diff --git a/samples/client/petstore/typescript-node/README.md b/samples/client/petstore/typescript-node/README.md
deleted file mode 100644
index 02d993a5de9e..000000000000
--- a/samples/client/petstore/typescript-node/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# SwaggerClient
-
-Sample of TypeScript Node.js petstore client
-
-## Testing the generated code
-
-```
-npm install
-npm test
-```
-
-This will compile the code and run a small test application that will do some simple test calls to the Swagger Petstore API.
-
-To clean the workspace run:
-```
-npm run clean
-```
-
-
-## Author
-
-mads@maetzke-tandrup.dk, Swagger-Codegen community
diff --git a/samples/client/petstore/typescript-node/client.ts b/samples/client/petstore/typescript-node/client.ts
deleted file mode 100644
index 51a7f687e09f..000000000000
--- a/samples/client/petstore/typescript-node/client.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import api = require('./api');
-import fs = require('fs');
-
-var petApi = new api.PetApi();
-petApi.setApiKey(api.PetApiApiKeys.api_key, 'special-key');
-petApi.setApiKey(api.PetApiApiKeys.test_api_key_header, 'query-key');
-
-var tag1 = new api.Tag();
-tag1.id = 18291;
-tag1.name = 'TS tag 1';
-
-var pet = new api.Pet();
-pet.name = 'TypeScriptDoggie';
-pet.id = 18291;
-pet.photoUrls = ["http://url1", "http://url2"];
-pet.tags = [tag1];
-
-var petId: any;
-
-var exitCode = 0;
-
-// Test various API calls to the petstore
-petApi.addPet(pet)
- .then((res) => {
- var newPet =