forked from loafle/openapi-generator-original
Merge branch 'master' into issue-5753
This commit is contained in:
commit
73df07d64c
2
.gitignore
vendored
2
.gitignore
vendored
@ -76,6 +76,8 @@ samples/client/petstore/java/retrofit2/build/
|
||||
samples/client/petstore/java/retrofit2rx/build/
|
||||
samples/client/petstore/java/default/build/
|
||||
samples/client/petstore/scala/build/
|
||||
samples/client/petstore/java/resttemplate/hello.txt
|
||||
samples/client/petstore/java/retrofit2/hello.txt
|
||||
|
||||
#PHP
|
||||
samples/client/petstore/php/SwaggerClient-php/composer.lock
|
||||
|
@ -24,7 +24,7 @@
|
||||
## Overview
|
||||
This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported:
|
||||
|
||||
- **API clients**: **ActionScript**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Kotlin**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node)
|
||||
- **API clients**: **ActionScript**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Kotlin**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node)
|
||||
- **Server stubs**: **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra)
|
||||
- **API documentation generators**: **HTML**, **Confluence Wiki**
|
||||
- **Others**: **JMeter**
|
||||
@ -815,6 +815,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
|
||||
- [Upwork](http://upwork.com/)
|
||||
- [uShip](https://www.uship.com/)
|
||||
- [VMware](https://vmware.com/)
|
||||
- [Viavi Solutions Inc.](https://www.viavisolutions.com)
|
||||
- [W.UP](http://wup.hu/?siteLang=en)
|
||||
- [Wealthfront](https://www.wealthfront.com/)
|
||||
- [Webever GmbH](https://www.webever.de/)
|
||||
@ -842,6 +843,7 @@ Presentations/Videos/Tutorials/Books
|
||||
- 2017/04/27 - [Swagger Codegen のPHP実装があまりにアレだったので、ライブラリ自作して公開してみた](http://qiita.com/imunew/items/2e9c472e0097e329f2cd) by [imunew](http://qiita.com/imunew)
|
||||
- 2017/05/17 - [Diseño de APIs con OpenAPI](https://www.slideshare.net/pjmolina/diseo-de-apis-con-openapi) by [Pedro J. Molina](https://github.com/pjmolina) @ [JSDayES 2017](http://2017.jsday.es/)
|
||||
- 2017/05/22 - [Presentation of the Vert.x-Swagger project](http://vertx.io/blog/presentation-of-the-vert-x-swagger-project/) by [@phiz71](http://github.com/phiz71)
|
||||
- 2017/06/21 - [Swagger Presentation (Warsaw Ruby Users Group](https://www.youtube.com/watch?v=uCnnDMFQB8U) by [@rafalpetryka](http://github.com/rafalpetryka)
|
||||
|
||||
# Swagger Codegen Core Team
|
||||
|
||||
@ -902,6 +904,7 @@ Here is a list of template creators:
|
||||
* C++ REST: @Danielku15
|
||||
* C# (.NET 2.0): @who
|
||||
* C# (.NET Standard 1.3 ): @Gronsak
|
||||
* C# (.NET 4.5 refactored): @jim
|
||||
* Clojure: @xhh
|
||||
* Dart: @yissachar
|
||||
* Elixir: @niku
|
||||
@ -915,13 +918,13 @@ Here is a list of template creators:
|
||||
* Java (okhttp-gson): @xhh
|
||||
* Java (RestTemplate): @nbruno
|
||||
* Java (RESTEasy): @gayathrigs
|
||||
* Kotlin: @jimschubert
|
||||
* Javascript/NodeJS: @jfiala
|
||||
* Javascript (Closure-annotated Angular) @achew22
|
||||
* JMeter @davidkiss
|
||||
* Kotlin @jimschubert
|
||||
* Perl: @wing328
|
||||
* PHP (Guzzle): @baartosz
|
||||
* PowerShell: @beatcracker
|
||||
* Swift: @tkqubo
|
||||
* Swift 3: @hexelon
|
||||
* TypeScript (Node): @mhardorf
|
||||
|
@ -26,9 +26,9 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript \
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \
|
||||
-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \
|
||||
-o samples/client/petstore/javascript-es6 \
|
||||
--additional-properties useEs6=true"
|
||||
--additional-properties useES6=true"
|
||||
|
||||
java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples/client/petstore/javascript -DappName=PetstoreClient"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples/client/petstore/javascript -DappName=PetstoreClient --additional-properties useES6=false"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -26,10 +26,9 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript \
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \
|
||||
-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \
|
||||
-o samples/client/petstore/javascript-promise-es6 \
|
||||
--additional-properties useEs6=true \
|
||||
--additional-properties usePromises=true"
|
||||
--additional-properties usePromises=true,useES6=true"
|
||||
|
||||
java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -31,7 +31,7 @@ ags="$@ generate \
|
||||
-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml \
|
||||
-l javascript \
|
||||
-o samples/client/petstore/javascript-promise \
|
||||
--additional-properties usePromises=true \
|
||||
--additional-properties usePromises=true,useES6=false \
|
||||
-DappName=PetstoreClient"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
31
bin/powershell-petstore.sh
Executable file
31
bin/powershell-petstore.sh
Executable file
@ -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 -t modules/swagger-codegen/src/main/resources/powershell -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l powershell -o samples/client/petstore/powershell_test --additional-properties packageGuid=a27b908d-2a20-467f-bc32-af6f3a654ac5,csharpClientPath=\$ScriptDir\..\..\petstore\csharp\SwaggerClient $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript-es6 --additional-properties useEs6=true
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript\es6 --additional-properties useES6=true
|
||||
|
||||
java -DappName=PetstoreClient %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -1,3 +1,4 @@
|
||||
call .\bin\windows\javascript-petstore.bat
|
||||
call .\bin\windows\javascript-promise-petstore.bat
|
||||
call .\bin\windows\javascript-es6-petstore.bat
|
||||
call .\bin\windows\javascript-promise-es6-petstore.bat
|
||||
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript -DappName=PetstoreClient
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript -DappName=PetstoreClient --additional-properties useES6=false
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript-promise-es6 --additional-properties useEs6=true --additional-properties usePromises=true
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript-promise-es6 --additional-properties useES6=true,usePromises=true
|
||||
|
||||
java -DappName=PetstoreClient %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript-promise --additional-properties usePromises=true -DappName=PetstoreClient
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript-promise --additional-properties usePromises=true,useES6=false -DappName=PetstoreClient
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
10
bin/windows/powershell-petsstore.bat
Normal file
10
bin/windows/powershell-petsstore.bat
Normal file
@ -0,0 +1,10 @@
|
||||
set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l powershell -o samples\client\petstore\powershell --additional-properties packageGuid=a27b908d-2a20-467f-bc32-af6f3a654ac5,csharpClientPath=$ScriptDir\..\..\petstore\csharp\SwaggerClient
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
@ -2410,7 +2410,12 @@ public class DefaultCodegen {
|
||||
p.baseType = pr.datatype;
|
||||
p.isContainer = true;
|
||||
p.isListContainer = true;
|
||||
imports.add(pr.baseType);
|
||||
|
||||
// recursively add import
|
||||
while (pr != null) {
|
||||
imports.add(pr.baseType);
|
||||
pr = pr.items;
|
||||
}
|
||||
} else if ("object".equals(type)) { // for map parameter
|
||||
Property inner = qp.getItems();
|
||||
if (inner == null) {
|
||||
@ -2424,7 +2429,11 @@ public class DefaultCodegen {
|
||||
p.baseType = pr.datatype;
|
||||
p.isContainer = true;
|
||||
p.isMapContainer = true;
|
||||
imports.add(pr.baseType);
|
||||
// recursively add import
|
||||
while (pr != null) {
|
||||
imports.add(pr.baseType);
|
||||
pr = pr.items;
|
||||
}
|
||||
} else {
|
||||
Map<PropertyId, Object> args = new HashMap<PropertyId, Object>();
|
||||
String format = qp.getFormat();
|
||||
@ -2545,6 +2554,14 @@ public class DefaultCodegen {
|
||||
imports.add(cp.complexType);
|
||||
}
|
||||
imports.add(cp.baseType);
|
||||
|
||||
// recursively add import
|
||||
CodegenProperty innerCp = cp;
|
||||
while(innerCp != null) {
|
||||
imports.add(innerCp.complexType);
|
||||
innerCp = innerCp.items;
|
||||
}
|
||||
|
||||
p.items = cp;
|
||||
p.dataType = cp.datatype;
|
||||
p.baseType = cp.complexType;
|
||||
|
@ -65,7 +65,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.1. JSON processing: Jackson 2.7.0. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
|
||||
supportedLibraries.put("feign", "HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.8.7");
|
||||
supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.22.2. JSON processing: Jackson 2.7.0");
|
||||
supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.6.2. Enable Parcelable modles on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
|
||||
supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.6.2. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
|
||||
supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.");
|
||||
supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.2.0. JSON processing: Gson 2.6.1 (Retrofit 2.0.2). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)");
|
||||
supportedLibraries.put("resttemplate", "HTTP client: Spring RestTemplate 4.3.7-RELEASE. JSON processing: Jackson 2.8.8");
|
||||
|
@ -96,7 +96,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
protected String modelDocPath = "docs/";
|
||||
protected String apiTestPath = "api/";
|
||||
protected String modelTestPath = "model/";
|
||||
protected boolean useES6;
|
||||
protected boolean useES6 = false; // default is ES5
|
||||
|
||||
public JavascriptClientCodegen() {
|
||||
super();
|
||||
@ -105,7 +105,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
modelTestTemplateFiles.put("model_test.mustache", ".js");
|
||||
apiTemplateFiles.put("api.mustache", ".js");
|
||||
apiTestTemplateFiles.put("api_test.mustache", ".js");
|
||||
embeddedTemplateDir = templateDir = "Javascript";
|
||||
// subfolder Javascript/es6
|
||||
embeddedTemplateDir = templateDir = "Javascript" + File.separator + "es6";
|
||||
apiPackage = "api";
|
||||
modelPackage = "model";
|
||||
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||
@ -196,7 +197,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
.defaultValue(Boolean.TRUE.toString()));
|
||||
cliOptions.add(new CliOption(USE_ES6,
|
||||
"use JavaScript ES6 (ECMAScript 6)")
|
||||
.defaultValue(Boolean.TRUE.toString()));
|
||||
.defaultValue(Boolean.FALSE.toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -267,6 +268,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
}
|
||||
if (additionalProperties.containsKey(USE_ES6)) {
|
||||
setUseES6(convertPropertyToBooleanAndWriteBack(USE_ES6));
|
||||
} else {
|
||||
setUseES6(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -430,9 +433,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
public void setUseES6(boolean useES6) {
|
||||
this.useES6 = useES6;
|
||||
if (useES6) {
|
||||
embeddedTemplateDir = templateDir = "Javascript-es6";
|
||||
embeddedTemplateDir = templateDir = "Javascript/es6";
|
||||
LOGGER.info("Using JS ES6 templates");
|
||||
} else {
|
||||
embeddedTemplateDir = templateDir = "Javascript";
|
||||
LOGGER.info("Using JS ES5 templates");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,405 @@
|
||||
package io.swagger.codegen.languages;
|
||||
|
||||
import io.swagger.codegen.*;
|
||||
import io.swagger.models.properties.ArrayProperty;
|
||||
import io.swagger.models.properties.MapProperty;
|
||||
import io.swagger.models.properties.Property;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static java.util.UUID.randomUUID;
|
||||
|
||||
public class PowerShellClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
static Logger LOGGER = LoggerFactory.getLogger(PowerShellClientCodegen.class);
|
||||
|
||||
private String packageGuid = "{" + randomUUID().toString().toUpperCase() + "}";
|
||||
|
||||
protected String sourceFolder = "src";
|
||||
protected String packageName = "IO.Swagger";
|
||||
protected String csharpClientPath = "$ScriptDir\\csharp\\SwaggerClient";
|
||||
protected String apiDocPath = "docs/";
|
||||
protected String modelDocPath = "docs/";
|
||||
|
||||
/**
|
||||
* Constructs an instance of `PowerShellClientCodegen`.
|
||||
*/
|
||||
public PowerShellClientCodegen() {
|
||||
super();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "powershell";
|
||||
modelTemplateFiles.put("model.mustache", ".ps1");
|
||||
apiTemplateFiles.put("api.mustache", ".ps1");
|
||||
modelTestTemplateFiles.put("model_test.mustache", ".ps1");
|
||||
apiTestTemplateFiles.put("api_test.mustache", ".ps1");
|
||||
modelDocTemplateFiles.clear();
|
||||
apiDocTemplateFiles.clear();
|
||||
embeddedTemplateDir = templateDir = "powershell";
|
||||
apiPackage = packageName + File.separator + "API";
|
||||
modelPackage = packageName + File.separator + "Model";
|
||||
|
||||
// https://blogs.msdn.microsoft.com/powershell/2010/01/07/how-objects-are-sent-to-and-from-remote-sessions/
|
||||
languageSpecificPrimitives = new HashSet<String>(Arrays.asList(
|
||||
"Byte",
|
||||
"SByte",
|
||||
"Byte[]",
|
||||
"Int16",
|
||||
"Int32",
|
||||
"Int64",
|
||||
"UInt16",
|
||||
"UInt32",
|
||||
"UInt64",
|
||||
"Decimal",
|
||||
"Single",
|
||||
"Double",
|
||||
"TimeSpan",
|
||||
"System.DateTime",
|
||||
"ProgressRecord",
|
||||
"Char",
|
||||
"String",
|
||||
"XmlDocument",
|
||||
"SecureString",
|
||||
"Boolean",
|
||||
"Guid",
|
||||
"Uri",
|
||||
"Version"
|
||||
));
|
||||
|
||||
// https://richardspowershellblog.wordpress.com/2009/05/02/powershell-reserved-words/
|
||||
reservedWords = new HashSet<String>(Arrays.asList(
|
||||
"Begin",
|
||||
"Break",
|
||||
"Catch",
|
||||
"Continue",
|
||||
"Data",
|
||||
"Do",
|
||||
"Dynamicparam",
|
||||
"Else",
|
||||
"Elseif",
|
||||
"End",
|
||||
"Exit",
|
||||
"Filter",
|
||||
"Finally",
|
||||
"For",
|
||||
"Foreach",
|
||||
"From",
|
||||
"Function",
|
||||
"If",
|
||||
"In",
|
||||
"Param",
|
||||
"Process",
|
||||
"Return",
|
||||
"Switch",
|
||||
"Throw",
|
||||
"Trap",
|
||||
"Try",
|
||||
"Until",
|
||||
"While",
|
||||
"Local",
|
||||
"Private",
|
||||
"Where"
|
||||
));
|
||||
|
||||
|
||||
defaultIncludes = new HashSet<String>(Arrays.asList(
|
||||
"Byte",
|
||||
"SByte",
|
||||
"Byte[]",
|
||||
"Int16",
|
||||
"Int32",
|
||||
"Int64",
|
||||
"UInt16",
|
||||
"UInt32",
|
||||
"UInt64",
|
||||
"Decimal",
|
||||
"Single",
|
||||
"Double",
|
||||
"TimeSpan",
|
||||
"System.DateTime",
|
||||
"ProgressRecord",
|
||||
"Char",
|
||||
"String",
|
||||
"XmlDocument",
|
||||
"SecureString",
|
||||
"Boolean",
|
||||
"Guid",
|
||||
"Uri",
|
||||
"Version"
|
||||
));
|
||||
|
||||
typeMapping = new HashMap<String, String>();
|
||||
typeMapping.put("string", "String");
|
||||
typeMapping.put("boolean", "Boolean");
|
||||
typeMapping.put("integer", "Int32");
|
||||
typeMapping.put("float", "Double");
|
||||
typeMapping.put("long", "Int64");
|
||||
typeMapping.put("double", "Double");
|
||||
typeMapping.put("number", "Decimal");
|
||||
typeMapping.put("date-time", "System.DateTime");
|
||||
typeMapping.put("date", "System.DateTime");
|
||||
typeMapping.put("file", "String");
|
||||
typeMapping.put("object", "String");
|
||||
typeMapping.put("binary", "String");
|
||||
typeMapping.put("Date", "System.DateTime");
|
||||
typeMapping.put("DateTime", "System.DateTime");
|
||||
|
||||
cliOptions.clear();
|
||||
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Client package name (e.g. io.swagger.client).").defaultValue(this.packageName));
|
||||
cliOptions.add(new CliOption(CodegenConstants.OPTIONAL_PROJECT_GUID, "GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default."));
|
||||
cliOptions.add(new CliOption("csharpClientPath", "Path to the C# API client generated by Swagger Codegen, e.g. $ScriptDir\\..\\csharp\\SwaggerClient where $ScriptDir is the current directory.").defaultValue(this.csharpClientPath));
|
||||
|
||||
}
|
||||
|
||||
public CodegenType getTag() {
|
||||
return CodegenType.CLIENT;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "powershell";
|
||||
}
|
||||
|
||||
public String getHelp() {
|
||||
return "Generates a PowerShell API client (beta).";
|
||||
}
|
||||
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
public void setCsharpClientPath(String csharpClientPath) {
|
||||
this.csharpClientPath = csharpClientPath;
|
||||
}
|
||||
|
||||
public void setSourceFolder(String sourceFolder) {
|
||||
this.sourceFolder = sourceFolder;
|
||||
}
|
||||
|
||||
public void setPackageGuid(String packageGuid) {
|
||||
this.packageGuid = packageGuid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_PROJECT_GUID)) {
|
||||
setPackageGuid((String) additionalProperties.get(CodegenConstants.OPTIONAL_PROJECT_GUID));
|
||||
}
|
||||
additionalProperties.put("packageGuid", packageGuid);
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
this.setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||
} else {
|
||||
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey("csharpClientPath")) {
|
||||
this.setCsharpClientPath((String) additionalProperties.get("csharpClientPath"));
|
||||
} else {
|
||||
additionalProperties.put("csharpClientPath", csharpClientPath);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) {
|
||||
LOGGER.warn(CodegenConstants.MODEL_PACKAGE + " with " + this.getName() + " generator is ignored. Setting this value independently of " + CodegenConstants.PACKAGE_NAME + " is not currently supported.");
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
|
||||
LOGGER.warn(CodegenConstants.API_PACKAGE + " with " + this.getName() + " generator is ignored. Setting this value independently of " + CodegenConstants.PACKAGE_NAME + " is not currently supported.");
|
||||
}
|
||||
|
||||
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage());
|
||||
additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage());
|
||||
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
additionalProperties.put("modelDocPath", modelDocPath);
|
||||
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
supportingFiles.add(new SupportingFile("Build.ps1.mustache", "", "Build.ps1"));
|
||||
|
||||
final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator);
|
||||
|
||||
supportingFiles.add(new SupportingFile("IO.Swagger.psm1.mustache", infrastructureFolder, packageName + ".psm1"));
|
||||
|
||||
// private
|
||||
supportingFiles.add(new SupportingFile("Get-CommonParameters.ps1", infrastructureFolder + File.separator + "Private" + File.separator, "Get-CommonParameters.ps1"));
|
||||
supportingFiles.add(new SupportingFile("Out-DebugParameter.ps1", infrastructureFolder + File.separator + "Private" + File.separator, "Out-DebugParameter.ps1"));
|
||||
|
||||
// en-US
|
||||
supportingFiles.add(new SupportingFile("about_IO.Swagger.help.txt.mustache", infrastructureFolder + File.separator + "en-US" + File.separator + "about_" + packageName + ".help.txt"));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeUnsafeCharacters(String input) {
|
||||
return input.replace("#>", "#_>").replace("<#", "<_#");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeQuotationMark(String input) {
|
||||
// remove " to avoid code injection
|
||||
return input.replace("\"", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiTestFileFolder() {
|
||||
return (outputFolder + "/test").replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiDocFileFolder() {
|
||||
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiFileFolder() {
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + apiPackage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelTestFileFolder() {
|
||||
return (outputFolder + "/test").replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelDocFileFolder() {
|
||||
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + modelPackage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeReservedWord(String name) {
|
||||
return "_" + name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the proper model name (capitalized).
|
||||
* In case the name belongs to the TypeSystem it won't be renamed.
|
||||
*
|
||||
* @param name the name of the model
|
||||
* @return capitalized model name
|
||||
*/
|
||||
@Override
|
||||
public String toModelName(String name) {
|
||||
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||
name = modelNamePrefix + "_" + name;
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(modelNameSuffix)) {
|
||||
name = name + "_" + modelNameSuffix;
|
||||
}
|
||||
|
||||
name = sanitizeName(name);
|
||||
|
||||
// model name cannot use reserved keyword, e.g. return
|
||||
if (isReservedWord(name)) {
|
||||
LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name));
|
||||
name = "model_" + name; // e.g. return => ModelReturn (after camelize)
|
||||
}
|
||||
|
||||
// model name starts with number
|
||||
if (name.matches("^\\d.*")) {
|
||||
LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name));
|
||||
name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
|
||||
}
|
||||
|
||||
// camelize the model name
|
||||
// phone_number => PhoneNumber
|
||||
return camelize(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toModelFilename(String name) {
|
||||
// should be the same as the model name
|
||||
return "New-" + toModelName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the swagger type for the property
|
||||
*
|
||||
* @param p Swagger property object
|
||||
* @return string presentation of the type
|
||||
**/
|
||||
@Override
|
||||
public String getSwaggerType(Property p) {
|
||||
String swaggerType = super.getSwaggerType(p);
|
||||
String type;
|
||||
|
||||
// This maps, for example, long -> Long based on hashes in this type's constructor
|
||||
if (typeMapping.containsKey(swaggerType)) {
|
||||
type = typeMapping.get(swaggerType);
|
||||
if (languageSpecificPrimitives.contains(type)) {
|
||||
return type;
|
||||
}
|
||||
} else {
|
||||
type = swaggerType;
|
||||
}
|
||||
|
||||
// model/object
|
||||
return toModelName(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the type declaration of the property
|
||||
*
|
||||
* @param p Swagger Property object
|
||||
* @return a string presentation of the property type
|
||||
*/
|
||||
@Override
|
||||
public String getTypeDeclaration(Property p) {
|
||||
if (p instanceof ArrayProperty) {
|
||||
ArrayProperty ap = (ArrayProperty) p;
|
||||
Property inner = ap.getItems();
|
||||
return getTypeDeclaration(inner) + "[]";
|
||||
} else if (p instanceof MapProperty) {
|
||||
MapProperty mp = (MapProperty) p;
|
||||
Property inner = mp.getAdditionalProperties();
|
||||
// TODO not sure if the following map/hash declaration is correct
|
||||
return "{String, " + getTypeDeclaration(inner) + "}";
|
||||
} else if (!languageSpecificPrimitives.contains(getSwaggerType(p))) {
|
||||
return packageName + ".Model." + super.getTypeDeclaration(p);
|
||||
}
|
||||
return super.getTypeDeclaration(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toOperationId(String operationId) {
|
||||
// throw exception if method name is empty (should not occur as an auto-generated method name will be used)
|
||||
if (StringUtils.isEmpty(operationId)) {
|
||||
throw new RuntimeException("Empty method name (operationId) not allowed");
|
||||
}
|
||||
|
||||
// method name cannot use reserved keyword, e.g. return
|
||||
if (isReservedWord(operationId)) {
|
||||
LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId)));
|
||||
operationId = "call_" + operationId;
|
||||
}
|
||||
|
||||
return camelize(sanitizeName(operationId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
|
||||
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
||||
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
||||
for (CodegenOperation op : operationList) {
|
||||
int index = 0;
|
||||
for (CodegenParameter p : op.allParams) {
|
||||
p.vendorExtensions.put("x-index", index);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
return objs;
|
||||
}
|
||||
}
|
@ -26,14 +26,11 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod
|
||||
public static final String NPM_VERSION = "npmVersion";
|
||||
public static final String NPM_REPOSITORY = "npmRepository";
|
||||
public static final String SNAPSHOT = "snapshot";
|
||||
public static final String USE_OPAQUE_TOKEN = "useOpaqueToken";
|
||||
public static final String INJECTION_TOKEN = "injectionToken";
|
||||
public static final String WITH_INTERFACES = "withInterfaces";
|
||||
|
||||
protected String npmName = null;
|
||||
protected String npmVersion = "1.0.0";
|
||||
protected String npmRepository = null;
|
||||
protected String injectionToken = "InjectionToken<string>";
|
||||
|
||||
public TypeScriptAngular2ClientCodegen() {
|
||||
super();
|
||||
@ -51,7 +48,6 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod
|
||||
this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package"));
|
||||
this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
|
||||
this.cliOptions.add(new CliOption(SNAPSHOT, "When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
this.cliOptions.add(new CliOption(USE_OPAQUE_TOKEN, "When setting this property to true, OpaqueToken is used instead of InjectionToken", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
}
|
||||
|
||||
@ -86,11 +82,6 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod
|
||||
addNpmPackageGeneration();
|
||||
}
|
||||
|
||||
if(additionalProperties.containsKey(USE_OPAQUE_TOKEN) && Boolean.valueOf(additionalProperties.get(USE_OPAQUE_TOKEN).toString())) {
|
||||
this.setOpaqueToken();
|
||||
}
|
||||
additionalProperties.put(INJECTION_TOKEN, this.injectionToken);
|
||||
|
||||
if(additionalProperties.containsKey(WITH_INTERFACES)) {
|
||||
boolean withInterfaces = Boolean.parseBoolean(additionalProperties.get(WITH_INTERFACES).toString());
|
||||
if (withInterfaces) {
|
||||
@ -253,7 +244,4 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod
|
||||
this.npmRepository = npmRepository;
|
||||
}
|
||||
|
||||
public void setOpaqueToken() {
|
||||
this.injectionToken = "OpaqueToken";
|
||||
}
|
||||
}
|
||||
|
@ -106,10 +106,10 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.8"
|
||||
jackson_version = "2.7.5"
|
||||
jersey_version = "1.19.1"
|
||||
jodatime_version = "2.9.4"
|
||||
swagger_annotations_version = "1.5.15"
|
||||
jackson_version = "2.8.9"
|
||||
jersey_version = "1.19.4"
|
||||
jodatime_version = "2.9.9"
|
||||
junit_version = "4.12"
|
||||
}
|
||||
|
||||
|
@ -105,15 +105,15 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.8"
|
||||
jackson_version = "2.7.5"
|
||||
jersey_version = "2.22.2"
|
||||
swagger_annotations_version = "1.5.15"
|
||||
jackson_version = "2.8.9"
|
||||
jersey_version = "2.25.1"
|
||||
{{^java8}}
|
||||
jodatime_version = "2.9.4"
|
||||
jodatime_version = "2.9.9"
|
||||
{{/java8}}
|
||||
{{#supportJava6}}
|
||||
commons_io_version=2.5
|
||||
commons_lang3_version=3.5
|
||||
commons_lang3_version=3.6
|
||||
{{/supportJava6}}
|
||||
junit_version = "4.12"
|
||||
}
|
||||
|
@ -9,23 +9,23 @@ lazy val root = (project in file(".")).
|
||||
publishArtifact in (Compile, packageDoc) := false,
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
"io.swagger" % "swagger-annotations" % "1.5.8",
|
||||
"org.glassfish.jersey.core" % "jersey-client" % "2.22.2",
|
||||
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.22.2",
|
||||
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.2",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.7.5",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5",
|
||||
"io.swagger" % "swagger-annotations" % "1.5.15",
|
||||
"org.glassfish.jersey.core" % "jersey-client" % "2.25.1",
|
||||
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1",
|
||||
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.8.9",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9",
|
||||
{{#java8}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.7.5",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.8.9",
|
||||
{{/java8}}
|
||||
{{^java8}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.7.5",
|
||||
"joda-time" % "joda-time" % "2.9.4",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.8.9",
|
||||
"joda-time" % "joda-time" % "2.9.9",
|
||||
{{/java8}}
|
||||
"com.brsanthu" % "migbase64" % "2.2",
|
||||
{{#supportJava6}}
|
||||
"org.apache.commons" % "commons-lang3" % "3.5",
|
||||
"org.apache.commons" % "commons-lang3" % "3.6",
|
||||
"commons-io" % "commons-io" % "2.5",
|
||||
{{/supportJava6}}
|
||||
"junit" % "junit" % "4.12" % "test",
|
||||
|
@ -272,14 +272,14 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
<jersey-version>2.22.2</jersey-version>
|
||||
<jackson-version>2.7.5</jackson-version>
|
||||
<jersey-version>2.25.1</jersey-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
{{^java8}}
|
||||
<jodatime-version>2.9.4</jodatime-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
{{/java8}}
|
||||
{{#supportJava6}}
|
||||
<commons_io_version>2.5</commons_io_version>
|
||||
<commons_lang3_version>3.5</commons_lang3_version>
|
||||
<commons_lang3_version>3.6</commons_lang3_version>
|
||||
{{/supportJava6}}
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
|
@ -100,12 +100,12 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'io.swagger:swagger-annotations:1.5.8'
|
||||
compile 'io.swagger:swagger-annotations:1.5.15'
|
||||
compile 'com.squareup.okhttp:okhttp:2.7.5'
|
||||
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
|
||||
compile 'com.google.code.gson:gson:2.6.2'
|
||||
compile 'com.google.code.gson:gson:2.8.1'
|
||||
{{^java8}}
|
||||
compile 'joda-time:joda-time:2.9.3'
|
||||
compile 'joda-time:joda-time:2.9.9'
|
||||
{{/java8}}
|
||||
testCompile 'junit:junit:4.12'
|
||||
}
|
||||
|
@ -9,12 +9,12 @@ lazy val root = (project in file(".")).
|
||||
publishArtifact in (Compile, packageDoc) := false,
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
"io.swagger" % "swagger-annotations" % "1.5.8",
|
||||
"io.swagger" % "swagger-annotations" % "1.5.15",
|
||||
"com.squareup.okhttp" % "okhttp" % "2.7.5",
|
||||
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
|
||||
"com.google.code.gson" % "gson" % "2.6.2",
|
||||
"com.google.code.gson" % "gson" % "2.8.1",
|
||||
{{^java8}}
|
||||
"joda-time" % "joda-time" % "2.9.3" % "compile",
|
||||
"joda-time" % "joda-time" % "2.9.9" % "compile",
|
||||
{{/java8}}
|
||||
"junit" % "junit" % "4.12" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||
|
@ -210,7 +210,7 @@
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<version>5.2.2.Final</version>
|
||||
<version>5.4.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.el</groupId>
|
||||
@ -241,8 +241,8 @@
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
<okhttp-version>2.7.5</okhttp-version>
|
||||
<gson-version>2.6.2</gson-version>
|
||||
<jodatime-version>2.9.3</jodatime-version>
|
||||
<gson-version>2.8.1</gson-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
@ -192,7 +192,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jackson-provider</artifactId>
|
||||
<version>2.3.4.Final</version>
|
||||
<version>3.1.3.Final</version>
|
||||
</dependency>
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
@ -203,15 +203,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<resteasy-version>3.0.19.Final</resteasy-version>
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
<resteasy-version>3.1.3.Final</resteasy-version>
|
||||
<jackson-version>2.7.5</jackson-version>
|
||||
{{^java8}}
|
||||
<jodatime-version>2.9.4</jodatime-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
{{/java8}}
|
||||
{{#supportJava6}}
|
||||
<commons_io_version>2.5</commons_io_version>
|
||||
<commons_lang3_version>3.5</commons_lang3_version>
|
||||
<commons_lang3_version>3.6</commons_lang3_version>
|
||||
{{/supportJava6}}
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
|
@ -106,10 +106,10 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.8"
|
||||
jackson_version = "2.8.8"
|
||||
spring_web_version = "4.3.7.RELEASE"
|
||||
jodatime_version = "2.9.4"
|
||||
swagger_annotations_version = "1.5.15"
|
||||
jackson_version = "2.8.9"
|
||||
spring_web_version = "4.3.9.RELEASE"
|
||||
jodatime_version = "2.9.9"
|
||||
junit_version = "4.12"
|
||||
}
|
||||
|
||||
|
@ -248,11 +248,11 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||
<spring-web-version>4.3.7.RELEASE</spring-web-version>
|
||||
<jackson-version>2.8.8</jackson-version>
|
||||
<swagger-annotations-version>1.5.15</swagger-annotations-version>
|
||||
<spring-web-version>4.3.9.RELEASE</spring-web-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
{{^java8}}
|
||||
<jodatime-version>2.9.4</jodatime-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
{{/java8}}
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
|
@ -225,7 +225,7 @@
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
<retrofit-version>1.9.0</retrofit-version>
|
||||
<okhttp-version>2.7.5</okhttp-version>
|
||||
<jodatime-version>2.9.3</jodatime-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
<oltu-version>1.0.1</oltu-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
|
@ -102,23 +102,23 @@ if(hasProperty('target') && target == 'android') {
|
||||
ext {
|
||||
oltu_version = "1.0.1"
|
||||
{{^usePlay24WS}}
|
||||
retrofit_version = "2.2.0"
|
||||
retrofit_version = "2.3.0"
|
||||
{{/usePlay24WS}}
|
||||
{{#usePlay24WS}}
|
||||
retrofit_version = "2.1.0"
|
||||
jackson_version = "2.7.5"
|
||||
jackson_version = "2.8.9"
|
||||
play_version = "2.4.11"
|
||||
{{/usePlay24WS}}
|
||||
swagger_annotations_version = "1.5.15"
|
||||
junit_version = "4.12"
|
||||
{{#useRxJava}}
|
||||
rx_java_version = "1.2.9"
|
||||
rx_java_version = "1.3.0"
|
||||
{{/useRxJava}}
|
||||
{{#useRxJava2}}
|
||||
rx_java_version = "2.0.7"
|
||||
rx_java_version = "2.1.1"
|
||||
{{/useRxJava2}}
|
||||
{{^java8}}
|
||||
jodatime_version = "2.9.4"
|
||||
jodatime_version = "2.9.9"
|
||||
{{/java8}}
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,9 @@ lazy val root = (project in file(".")).
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
{{^usePlay24WS}}
|
||||
"com.squareup.retrofit2" % "retrofit" % "2.2.0" % "compile",
|
||||
"com.squareup.retrofit2" % "converter-scalars" % "2.2.0" % "compile",
|
||||
"com.squareup.retrofit2" % "converter-gson" % "2.2.0" % "compile",
|
||||
"com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile",
|
||||
"com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile",
|
||||
"com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile",
|
||||
{{/usePlay24WS}}
|
||||
{{#usePlay24WS}}
|
||||
"com.typesafe.play" % "play-java-ws_2.11" % "2.4.11" % "compile",
|
||||
@ -20,22 +20,22 @@ lazy val root = (project in file(".")).
|
||||
"com.squareup.retrofit2" % "converter-scalars" % "2.1.0" % "compile",
|
||||
"com.squareup.retrofit2" % "converter-gson" % "2.1.0" % "compile",
|
||||
"com.squareup.retrofit2" % "converter-jackson" % "2.1.0" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.7.5" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.8.9" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9" % "compile",
|
||||
{{/usePlay24WS}}
|
||||
{{#useRxJava}}
|
||||
"com.squareup.retrofit2" % "adapter-rxjava" % "{{^usePlay24WS}}2.2.0{{/usePlay24WS}}{{#usePlay24WS}}2.1.0{{/usePlay24WS}}" % "compile",
|
||||
"io.reactivex" % "rxjava" % "1.2.9" % "compile",
|
||||
"io.reactivex" % "rxjava" % "1.3.0" % "compile",
|
||||
{{/useRxJava}}
|
||||
{{#useRxJava2}}
|
||||
"com.jakewharton.retrofit" % "retrofit2-rxjava2-adapter" % "1.0.0" % "compile",
|
||||
"io.reactivex.rxjava2" % "rxjava" % "2.0.7" % "compile",
|
||||
"io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile",
|
||||
{{/useRxJava2}}
|
||||
"io.swagger" % "swagger-annotations" % "1.5.15" % "compile",
|
||||
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile",
|
||||
{{^java8}}
|
||||
"joda-time" % "joda-time" % "2.9.4" % "compile",
|
||||
"joda-time" % "joda-time" % "2.9.9" % "compile",
|
||||
{{/java8}}
|
||||
"junit" % "junit" % "4.12" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.11" % "test"
|
||||
|
@ -285,18 +285,18 @@
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
{{#usePlay24WS}}
|
||||
<jackson-version>2.7.5</jackson-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
<play-version>2.4.11</play-version>
|
||||
{{/usePlay24WS}}
|
||||
<retrofit-version>2.2.0</retrofit-version>
|
||||
<retrofit-version>2.3.0</retrofit-version>
|
||||
{{#useRxJava}}
|
||||
<rxjava-version>1.2.9</rxjava-version>
|
||||
<rxjava-version>1.3.0</rxjava-version>
|
||||
{{/useRxJava}}
|
||||
{{#useRxJava2}}
|
||||
<rxjava-version>2.0.7</rxjava-version>
|
||||
<rxjava-version>2.1.1</rxjava-version>
|
||||
{{/useRxJava2}}
|
||||
{{^java8}}
|
||||
<jodatime-version>2.9.4</jodatime-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
{{/java8}}
|
||||
<oltu-version>1.0.1</oltu-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
|
@ -293,15 +293,15 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||
<jersey-version>1.19.1</jersey-version>
|
||||
<jackson-version>2.7.5</jackson-version>
|
||||
<swagger-annotations-version>1.5.15</swagger-annotations-version>
|
||||
<jersey-version>1.19.4</jersey-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
{{^java8}}
|
||||
<jodatime-version>2.9.4</jodatime-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
{{/java8}}
|
||||
{{#supportJava6}}
|
||||
<commons_io_version>2.5</commons_io_version>
|
||||
<commons_lang3_version>3.5</commons_lang3_version>
|
||||
<commons_lang3_version>3.6</commons_lang3_version>
|
||||
{{/supportJava6}}
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
|
@ -187,7 +187,7 @@
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>1.1.0.Final</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
<cxf-version>3.1.6</cxf-version>
|
||||
<cxf-version>3.1.11</cxf-version>
|
||||
<jackson-jaxrs-version>2.8.4</jackson-jaxrs-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
@ -244,7 +244,7 @@
|
||||
{{#generateSpringBootApplication}}
|
||||
<spring.boot-version>1.3.3.RELEASE</spring.boot-version>
|
||||
{{/generateSpringBootApplication}}
|
||||
<cxf-version>3.1.8</cxf-version>
|
||||
<cxf-version>3.1.11</cxf-version>
|
||||
<jackson-jaxrs-version>2.8.4</jackson-jaxrs-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
@ -450,7 +450,7 @@
|
||||
if (_this.enableCookies && typeof window === 'undefined'){
|
||||
_this.agent.saveCookies(response);
|
||||
}
|
||||
resolve({data, response});
|
||||
resolve({data: data, response: response});
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
|
@ -53,6 +53,24 @@ browserify main.js > bundle.js
|
||||
|
||||
Then include *bundle.js* in the HTML pages.
|
||||
|
||||
### Webpack Configuration
|
||||
|
||||
Using Webpack you may encounter the following error: "Module not found: Error:
|
||||
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
|
||||
the following section to your webpack config:
|
||||
|
||||
```javascript
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
parser: {
|
||||
amd: false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation](#installation) instruction and execute the following JS code:
|
||||
|
@ -347,7 +347,7 @@ export default class ApiClient {
|
||||
data = response.text;
|
||||
}
|
||||
|
||||
return exports.convertToType(data, returnType);
|
||||
return ApiClient.convertToType(data, returnType);
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}{{^usePromises}}/**
|
||||
@ -449,7 +449,7 @@ export default class ApiClient {
|
||||
}
|
||||
|
||||
{{#usePromises}}return new Promise((resolve, reject) => {
|
||||
request.end(function(error, response) {
|
||||
request.end((error, response) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
@ -521,7 +521,7 @@ export default class ApiClient {
|
||||
case 'String':
|
||||
return String(data);
|
||||
case 'Date':
|
||||
return this.parseDate(String(data));
|
||||
return ApiClient.parseDate(String(data));
|
||||
case 'Blob':
|
||||
return data;
|
||||
default:
|
||||
@ -536,7 +536,7 @@ export default class ApiClient {
|
||||
var itemType = type[0];
|
||||
|
||||
return data.map((item) => {
|
||||
return exports.convertToType(item, itemType);
|
||||
return ApiClient.convertToType(item, itemType);
|
||||
});
|
||||
} else if (typeof type === 'object') {
|
||||
// for plain object type like: {'String': 'Integer'}
|
||||
@ -552,8 +552,8 @@ export default class ApiClient {
|
||||
var result = {};
|
||||
for (var k in data) {
|
||||
if (data.hasOwnProperty(k)) {
|
||||
var key = exports.convertToType(k, keyType);
|
||||
var value = exports.convertToType(data[k], valueType);
|
||||
var key = ApiClient.convertToType(k, keyType);
|
||||
var value = ApiClient.convertToType(data[k], valueType);
|
||||
result[key] = value;
|
||||
}
|
||||
}
|
||||
@ -575,12 +575,12 @@ export default class ApiClient {
|
||||
if (Array.isArray(data)) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data.hasOwnProperty(i))
|
||||
obj[i] = exports.convertToType(data[i], itemType);
|
||||
obj[i] = ApiClient.convertToType(data[i], itemType);
|
||||
}
|
||||
} else {
|
||||
for (var k in data) {
|
||||
if (data.hasOwnProperty(k))
|
||||
obj[k] = exports.convertToType(data[k], itemType);
|
||||
obj[k] = ApiClient.convertToType(data[k], itemType);
|
||||
}
|
||||
}
|
||||
};
|
@ -53,6 +53,24 @@ browserify main.js > bundle.js
|
||||
|
||||
Then include *bundle.js* in the HTML pages.
|
||||
|
||||
### Webpack Configuration
|
||||
|
||||
Using Webpack you may encounter the following error: "Module not found: Error:
|
||||
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
|
||||
the following section to your webpack config:
|
||||
|
||||
```javascript
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
parser: {
|
||||
amd: false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation](#installation) instruction and execute the following JS code:
|
@ -20,7 +20,7 @@ export default class {{classname}} {
|
||||
constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) {
|
||||
{{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}
|
||||
this = new Array();
|
||||
Object.setPrototypeOf(this, exports);{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}
|
||||
Object.setPrototypeOf(this, {{classname}});{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}
|
||||
|
||||
{{#useInheritance}}
|
||||
{{#parentModel}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/parentModel}}
|
||||
@ -41,7 +41,7 @@ export default class {{classname}} {
|
||||
*/{{/emitJSDoc}}
|
||||
static constructFromObject(data, obj) {
|
||||
if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} {
|
||||
obj = obj || new exports();
|
||||
obj = obj || new {{classname}}();
|
||||
|
||||
{{#parent}}{{^parentModel}}ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}');{{/parentModel}}
|
||||
{{/parent}}
|
@ -42,6 +42,7 @@ io.swagger.codegen.languages.NodeJSServerCodegen
|
||||
io.swagger.codegen.languages.ObjcClientCodegen
|
||||
io.swagger.codegen.languages.PerlClientCodegen
|
||||
io.swagger.codegen.languages.PhpClientCodegen
|
||||
io.swagger.codegen.languages.PowerShellClientCodegen
|
||||
io.swagger.codegen.languages.PistacheServerCodegen
|
||||
io.swagger.codegen.languages.PythonClientCodegen
|
||||
io.swagger.codegen.languages.Qt5CPPGenerator
|
||||
|
@ -51,10 +51,10 @@ public:
|
||||
/// </summary>
|
||||
{{^isNotContainer}}{{{datatype}}}& {{getter}}();
|
||||
{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{getter}}() const;
|
||||
void {{setter}}({{{datatype}}} value);
|
||||
{{/isNotContainer}}{{^required}}bool {{baseName}}IsSet() const;
|
||||
void unset{{name}}();
|
||||
{{/required}}
|
||||
void {{setter}}({{{datatype}}} value);
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
|
||||
|
@ -9,11 +9,26 @@ namespace {{this}} {
|
||||
|
||||
{{classname}}::{{classname}}()
|
||||
{
|
||||
{{#vars}}{{^isInherited}}{{#isNotContainer}}{{#isPrimitiveType}}m_{{name}} = {{{defaultValue}}};
|
||||
{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isString}}m_{{name}} = {{{defaultValue}}};
|
||||
{{/isString}}{{#isDateTime}}m_{{name}} = {{{defaultValue}}};
|
||||
{{/isDateTime}}{{/isPrimitiveType}}{{/isNotContainer}}{{^required}}m_{{name}}IsSet = false;
|
||||
{{/required}}{{/isInherited}}{{/vars}}
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{#isNotContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
m_{{name}} = {{{defaultValue}}};
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{#isString}}
|
||||
m_{{name}} = {{{defaultValue}}};
|
||||
{{/isString}}
|
||||
{{#isDateTime}}
|
||||
m_{{name}} = {{{defaultValue}}};
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isNotContainer}}
|
||||
{{^required}}
|
||||
m_{{name}}IsSet = false;
|
||||
{{/required}}
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
}
|
||||
|
||||
{{classname}}::~{{classname}}()
|
||||
@ -27,59 +42,135 @@ void {{classname}}::validate()
|
||||
|
||||
web::json::value {{classname}}::toJson() const
|
||||
{
|
||||
{{#parent}}web::json::value val = this->{{{parent}}}::toJson(); {{/parent}}
|
||||
{{^parent}}web::json::value val = web::json::value::object();{{/parent}}
|
||||
{{#parent}}
|
||||
web::json::value val = this->{{{parent}}}::toJson();
|
||||
{{/parent}}
|
||||
{{^parent}}
|
||||
web::json::value val = web::json::value::object();
|
||||
{{/parent}}
|
||||
|
||||
{{#vars}}{{^isInherited}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(m_{{name}}IsSet)
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^isListContainer}}
|
||||
{{^isMapContainer}}
|
||||
{{^required}}
|
||||
if(m_{{name}}IsSet)
|
||||
{
|
||||
val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}});
|
||||
}
|
||||
{{/required}}{{#required}}val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}});
|
||||
{{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}});
|
||||
{{/required}}
|
||||
{{/isMapContainer}}
|
||||
{{/isListContainer}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isListContainer}}
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_{{name}} )
|
||||
{
|
||||
jsonArray.push_back(ModelBase::toJson(item));
|
||||
}
|
||||
{{#required}}val[U("{{baseName}}")] = web::json::value::array(jsonArray);
|
||||
{{/required}}{{^required}}
|
||||
{{#required}}
|
||||
val[U("{{baseName}}")] = web::json::value::array(jsonArray);
|
||||
{{/required}}
|
||||
{{^required}}
|
||||
if(jsonArray.size() > 0)
|
||||
{
|
||||
val[U("{{baseName}}")] = web::json::value::array(jsonArray);
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(m_{{name}}IsSet)
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_{{name}} )
|
||||
{
|
||||
web::json::value tmp = web::json::value::object();
|
||||
tmp[U("key")] = ModelBase::toJson(item.first);
|
||||
tmp[U("value")] = ModelBase::toJson(item.second);
|
||||
jsonArray.push_back(tmp);
|
||||
}
|
||||
{{#required}}
|
||||
val[U("{{baseName}}")] = web::json::value::array(jsonArray);
|
||||
{{/required}}
|
||||
{{^required}}
|
||||
if(jsonArray.size() > 0)
|
||||
{
|
||||
val[U("{{baseName}}")] = web::json::value::array(jsonArray);
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isMapContainer}}
|
||||
{{^isListContainer}}
|
||||
{{^isMapContainer}}
|
||||
{{^isPrimitiveType}}
|
||||
{{^required}}
|
||||
if(m_{{name}}IsSet)
|
||||
{
|
||||
val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}});
|
||||
}
|
||||
{{/required}}{{#required}}val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}});
|
||||
{{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/isInherited}}{{/vars}}
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}});
|
||||
{{/required}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isMapContainer}}
|
||||
{{/isListContainer}}
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void {{classname}}::fromJson(web::json::value& val)
|
||||
{
|
||||
{{#parent}}this->{{{parent}}}::fromJson(val); {{/parent}}
|
||||
{{#parent}}
|
||||
this->{{{parent}}}::fromJson(val);
|
||||
|
||||
{{#vars}}{{^isInherited}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(val.has_field(U("{{baseName}}")))
|
||||
{{/parent}}
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^isListContainer}}
|
||||
{{^isMapContainer}}
|
||||
{{^required}}
|
||||
if(val.has_field(U("{{baseName}}")))
|
||||
{
|
||||
{{setter}}(ModelBase::{{baseType}}FromJson(val[U("{{baseName}}")]));
|
||||
}
|
||||
{{/required}}{{#required}}{{setter}}(ModelBase::{{baseType}}FromJson(val[U("{{baseName}}")]));
|
||||
{{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
{{setter}}(ModelBase::{{baseType}}FromJson(val[U("{{baseName}}")]));
|
||||
{{/required}}
|
||||
{{/isMapContainer}}
|
||||
{{/isListContainer}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isListContainer}}
|
||||
{
|
||||
m_{{name}}.clear();
|
||||
std::vector<web::json::value> jsonArray;
|
||||
{{^required}}if(val.has_field(U("{{baseName}}")))
|
||||
{{^required}}
|
||||
if(val.has_field(U("{{baseName}}")))
|
||||
{
|
||||
{{/required}}
|
||||
for( auto& item : val[U("{{baseName}}")].as_array() )
|
||||
{
|
||||
{{#isPrimitiveType}}m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item));
|
||||
{{/isPrimitiveType}}{{^isPrimitiveType}}{{#items.isString}}m_{{name}}.push_back(ModelBase::stringFromJson(item));
|
||||
{{/items.isString}}{{^items.isString}}{{#items.isDateTime}}m_{{name}}.push_back(ModelBase::dateFromJson(item));
|
||||
{{/items.isDateTime}}{{^items.isDateTime}}
|
||||
{{#items.isPrimitiveType}}
|
||||
m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item));
|
||||
{{/items.isPrimitiveType}}
|
||||
{{^items.isPrimitiveType}}
|
||||
{{#items.isString}}
|
||||
m_{{name}}.push_back(ModelBase::stringFromJson(item));
|
||||
{{/items.isString}}
|
||||
{{^items.isString}}
|
||||
{{#items.isDateTime}}
|
||||
m_{{name}}.push_back(ModelBase::dateFromJson(item));
|
||||
{{/items.isDateTime}}
|
||||
{{^items.isDateTime}}
|
||||
if(item.is_null())
|
||||
{
|
||||
m_{{name}}.push_back( {{{items.datatype}}}(nullptr) );
|
||||
@ -90,31 +181,111 @@ void {{classname}}::fromJson(web::json::value& val)
|
||||
newItem->fromJson(item);
|
||||
m_{{name}}.push_back( newItem );
|
||||
}
|
||||
{{/items.isDateTime}}{{/items.isString}}{{/isPrimitiveType}}
|
||||
{{/items.isDateTime}}
|
||||
{{/items.isString}}
|
||||
{{/items.isPrimitiveType}}
|
||||
}
|
||||
{{^required}}
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(val.has_field(U("{{baseName}}")))
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{
|
||||
{{#isString}}{{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")]));
|
||||
{{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromJson(val[U("{{baseName}}")]));
|
||||
{{/isDateTime}}{{^isDateTime}}if(!val[U("{{baseName}}")].is_null())
|
||||
m_{{name}}.clear();
|
||||
std::vector<web::json::value> jsonArray;
|
||||
{{^required}}
|
||||
if(val.has_field(U("{{baseName}}")))
|
||||
{
|
||||
{{/required}}
|
||||
for( auto& item : val[U("{{baseName}}")].as_array() )
|
||||
{
|
||||
utility::string_t key;
|
||||
if(item.has_field(U("key")))
|
||||
{
|
||||
key = ModelBase::stringFromJson(item[U("key")]);
|
||||
}
|
||||
{{#items.isPrimitiveType}}
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::{{items.baseType}}FromJson(item[U("value")])));
|
||||
{{/items.isPrimitiveType}}
|
||||
{{^items.isPrimitiveType}}
|
||||
{{#items.isString}}
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::stringFromJson(item[U("value")])));
|
||||
{{/items.isString}}
|
||||
{{^items.isString}}
|
||||
{{#items.isDateTime}}
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::dateFromJson(item[U("value")])));
|
||||
{{/items.isDateTime}}
|
||||
{{^items.isDateTime}}
|
||||
if(item.is_null())
|
||||
{
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, {{{items.datatype}}}(nullptr) ));
|
||||
}
|
||||
else
|
||||
{
|
||||
{{{items.datatype}}} newItem({{{items.defaultValue}}});
|
||||
newItem->fromJson(item[U("value")]);
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, newItem ));
|
||||
}
|
||||
{{/items.isDateTime}}
|
||||
{{/items.isString}}
|
||||
{{/items.isPrimitiveType}}
|
||||
}
|
||||
{{^required}}
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isMapContainer}}
|
||||
{{^isListContainer}}
|
||||
{{^isMapContainer}}
|
||||
{{^isPrimitiveType}}
|
||||
{{^required}}
|
||||
if(val.has_field(U("{{baseName}}")))
|
||||
{
|
||||
{{#isString}}
|
||||
{{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")]));
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
{{#isDateTime}}
|
||||
{{setter}}(ModelBase::dateFromJson(val[U("{{baseName}}")]));
|
||||
{{/isDateTime}}
|
||||
{{^isDateTime}}
|
||||
if(!val[U("{{baseName}}")].is_null())
|
||||
{
|
||||
{{{datatype}}} newItem({{{defaultValue}}});
|
||||
newItem->fromJson(val[U("{{baseName}}")]);
|
||||
{{setter}}( newItem );
|
||||
}
|
||||
{{/isDateTime}}{{/isString}}
|
||||
{{/isDateTime}}
|
||||
{{/isString}}
|
||||
}
|
||||
{{/required}}{{#required}}{{#isString}}{{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")]));
|
||||
{{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromJson(val[U("{{baseName}}")]));
|
||||
{{/isDateTime}}{{^isDateTime}}{{#vendorExtensions.x-codegen-file}}{{setter}}(ModelBase::fileFromJson(val[U("{{baseName}}")]));
|
||||
{{/vendorExtensions.x-codegen-file}}{{^vendorExtensions.x-codegen-file}}{{{datatype}}} new{{name}}({{{defaultValue}}});
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
{{#isString}}
|
||||
{{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")]));
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
{{#isDateTime}}
|
||||
{{setter}}
|
||||
(ModelBase::dateFromJson(val[U("{{baseName}}")]));
|
||||
{{/isDateTime}}
|
||||
{{^isDateTime}}
|
||||
{{#vendorExtensions.x-codegen-file}}
|
||||
{{setter}}(ModelBase::fileFromJson(val[U("{{baseName}}")]));
|
||||
{{/vendorExtensions.x-codegen-file}}
|
||||
{{^vendorExtensions.x-codegen-file}}
|
||||
{{{datatype}}} new{{name}}({{{defaultValue}}});
|
||||
new{{name}}->fromJson(val[U("{{baseName}}")]);
|
||||
{{setter}}( new{{name}} );
|
||||
{{/vendorExtensions.x-codegen-file}}{{/isDateTime}}{{/isString}}{{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/isInherited}}{{/vars}}
|
||||
{{/vendorExtensions.x-codegen-file}}
|
||||
{{/isDateTime}}
|
||||
{{/isString}}
|
||||
{{/required}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isMapContainer}}
|
||||
{{/isListContainer}}
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
}
|
||||
|
||||
void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
@ -125,12 +296,24 @@ void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
|
||||
namePrefix += U(".");
|
||||
}
|
||||
|
||||
{{#vars}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(m_{{name}}IsSet)
|
||||
{{#vars}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^isMapContainer}}
|
||||
{{^isListContainer}}
|
||||
{{^required}}
|
||||
if(m_{{name}}IsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
}
|
||||
{{/required}}{{#required}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/required}}
|
||||
{{/isListContainer}}
|
||||
{{/isMapContainer}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isListContainer}}
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_{{name}} )
|
||||
{
|
||||
@ -144,7 +327,31 @@ void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(m_{{name}}IsSet)
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_{{name}} )
|
||||
{
|
||||
web::json::value tmp = web::json::value::object();
|
||||
tmp[U("key")] = ModelBase::toJson(item.first);
|
||||
tmp[U("value")] = ModelBase::toJson(item.second);
|
||||
jsonArray.push_back(tmp);
|
||||
}
|
||||
{{#required}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), web::json::value::array(jsonArray), U("application/json")));
|
||||
{{/required}}{{^required}}
|
||||
if(jsonArray.size() > 0)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), web::json::value::array(jsonArray), U("application/json")));
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isMapContainer}}
|
||||
{{^isListContainer}}
|
||||
{{^isMapContainer}}
|
||||
{{^isPrimitiveType}}
|
||||
{{^required}}
|
||||
if(m_{{name}}IsSet)
|
||||
{
|
||||
{{#isString}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/isString}}{{^isString}}{{#isDateTime}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
@ -154,11 +361,29 @@ void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
|
||||
}
|
||||
{{/isDateTime}}{{/isString}}
|
||||
}
|
||||
{{/required}}{{#required}}{{#isString}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/isString}}{{^isString}}{{#isDateTime}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/isDateTime}}{{^isDateTime}}{{#vendorExtensions.x-codegen-file}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/vendorExtensions.x-codegen-file}}{{^vendorExtensions.x-codegen-file}}m_{{name}}->toMultipart(multipart, U("{{baseName}}."));
|
||||
{{/vendorExtensions.x-codegen-file}}{{/isDateTime}}{{/isString}}{{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/vars}}
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
{{#isString}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
{{#isDateTime}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/isDateTime}}
|
||||
{{^isDateTime}}
|
||||
{{#vendorExtensions.x-codegen-file}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}}));
|
||||
{{/vendorExtensions.x-codegen-file}}
|
||||
{{^vendorExtensions.x-codegen-file}}
|
||||
m_{{name}}->toMultipart(multipart, U("{{baseName}}."));
|
||||
{{/vendorExtensions.x-codegen-file}}
|
||||
{{/isDateTime}}
|
||||
{{/isString}}
|
||||
{{/required}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isMapContainer}}
|
||||
{{/isListContainer}}
|
||||
{{/vars}}
|
||||
}
|
||||
|
||||
void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
@ -169,24 +394,45 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||
namePrefix += U(".");
|
||||
}
|
||||
|
||||
{{#vars}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(multipart->hasContent(U("{{baseName}}")))
|
||||
{{#vars}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^isListContainer}}
|
||||
{{^isMapContainer}}
|
||||
{{^required}}
|
||||
if(multipart->hasContent(U("{{baseName}}")))
|
||||
{
|
||||
{{setter}}(ModelBase::{{baseType}}FromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
}
|
||||
{{/required}}{{#required}}{{setter}}(ModelBase::{{baseType}}FromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
{{setter}}(ModelBase::{{baseType}}FromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/required}}
|
||||
{{/isMapContainer}}
|
||||
{{/isListContainer}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isListContainer}}
|
||||
{
|
||||
m_{{name}}.clear();
|
||||
{{^required}}if(multipart->hasContent(U("{{baseName}}")))
|
||||
{{^required}}
|
||||
if(multipart->hasContent(U("{{baseName}}")))
|
||||
{
|
||||
{{/required}}
|
||||
|
||||
web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
for( auto& item : jsonArray.as_array() )
|
||||
{
|
||||
{{#isPrimitiveType}}m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item));
|
||||
{{/isPrimitiveType}}{{^isPrimitiveType}}{{#items.isString}}m_{{name}}.push_back(ModelBase::stringFromJson(item));
|
||||
{{/items.isString}}{{^items.isString}}{{#items.isDateTime}}m_{{name}}.push_back(ModelBase::dateFromJson(item));
|
||||
{{/items.isDateTime}}{{^items.isDateTime}}
|
||||
{{#isPrimitiveType}}
|
||||
m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item));
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{#items.isString}}
|
||||
m_{{name}}.push_back(ModelBase::stringFromJson(item));
|
||||
{{/items.isString}}
|
||||
{{^items.isString}}
|
||||
{{#items.isDateTime}}
|
||||
m_{{name}}.push_back(ModelBase::dateFromJson(item));
|
||||
{{/items.isDateTime}}
|
||||
{{^items.isDateTime}}
|
||||
if(item.is_null())
|
||||
{
|
||||
m_{{name}}.push_back( {{{items.datatype}}}(nullptr) );
|
||||
@ -197,60 +443,153 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||
newItem->fromJson(item);
|
||||
m_{{name}}.push_back( newItem );
|
||||
}
|
||||
{{/items.isDateTime}}{{/items.isString}}{{/isPrimitiveType}}
|
||||
{{/items.isDateTime}}
|
||||
{{/items.isString}}
|
||||
{{/isPrimitiveType}}
|
||||
}
|
||||
{{^required}}
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(multipart->hasContent(U("{{baseName}}")))
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{
|
||||
{{#isString}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isDateTime}}{{^isDateTime}}if(multipart->hasContent(U("{{baseName}}")))
|
||||
m_{{name}}.clear();
|
||||
{{^required}}
|
||||
if(multipart->hasContent(U("{{baseName}}")))
|
||||
{
|
||||
{{/required}}
|
||||
|
||||
web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
for( auto& item : jsonArray.as_array() )
|
||||
{
|
||||
utility::string_t key;
|
||||
if(item.has_field(U("key")))
|
||||
{
|
||||
key = ModelBase::stringFromJson(item[U("key")]);
|
||||
}
|
||||
{{#items.isPrimitiveType}}
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::{{items.baseType}}FromJson(item[U("value")])));
|
||||
{{/items.isPrimitiveType}}
|
||||
{{^items.isPrimitiveType}}
|
||||
{{#items.isString}}
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::stringFromJson(item[U("value")])));
|
||||
{{/items.isString}}
|
||||
{{^items.isString}}
|
||||
{{#items.isDateTime}}
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::dateFromJson(item[U("value")])));
|
||||
{{/items.isDateTime}}
|
||||
{{^items.isDateTime}}
|
||||
if(item.is_null())
|
||||
{
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, {{{items.datatype}}}(nullptr) ));
|
||||
}
|
||||
else
|
||||
{
|
||||
{{{items.datatype}}} newItem({{{items.defaultValue}}});
|
||||
newItem->fromJson(item[U("value")]);
|
||||
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, newItem ));
|
||||
}
|
||||
{{/items.isDateTime}}
|
||||
{{/items.isString}}
|
||||
{{/items.isPrimitiveType}}
|
||||
}
|
||||
{{^required}}
|
||||
}
|
||||
{{/required}}
|
||||
}
|
||||
{{/isMapContainer}}
|
||||
{{^isListContainer}}
|
||||
{{^isMapContainer}}
|
||||
{{^isPrimitiveType}}
|
||||
{{^required}}
|
||||
if(multipart->hasContent(U("{{baseName}}")))
|
||||
{
|
||||
{{#isString}}
|
||||
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
{{#isDateTime}}
|
||||
{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isDateTime}}
|
||||
{{^isDateTime}}
|
||||
if(multipart->hasContent(U("{{baseName}}")))
|
||||
{
|
||||
{{{datatype}}} newItem({{{defaultValue}}});
|
||||
newItem->fromMultiPart(multipart, U("{{baseName}}."));
|
||||
{{setter}}( newItem );
|
||||
}
|
||||
{{/isDateTime}}{{/isString}}
|
||||
{{/isDateTime}}
|
||||
{{/isString}}
|
||||
}
|
||||
{{/required}}{{#required}}{{#isString}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isDateTime}}{{^isDateTime}}{{#vendorExtensions.x-codegen-file}}{{setter}}(multipart->getContent(U("{{baseName}}")));
|
||||
{{/vendorExtensions.x-codegen-file}}{{^vendorExtensions.x-codegen-file}}{{{datatype}}} new{{name}}({{{defaultValue}}});
|
||||
{{/required}}
|
||||
{{#required}}
|
||||
{{#isString}}
|
||||
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
{{#isDateTime}}
|
||||
{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}"))));
|
||||
{{/isDateTime}}
|
||||
{{^isDateTime}}
|
||||
{{#vendorExtensions.x-codegen-file}}
|
||||
{{setter}}(multipart->getContent(U("{{baseName}}")));
|
||||
{{/vendorExtensions.x-codegen-file}}
|
||||
{{^vendorExtensions.x-codegen-file}}
|
||||
{{{datatype}}} new{{name}}({{{defaultValue}}});
|
||||
new{{name}}->fromMultiPart(multipart, U("{{baseName}}."));
|
||||
{{setter}}( new{{name}} );
|
||||
{{/vendorExtensions.x-codegen-file}}{{/isDateTime}}{{/isString}}{{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/vars}}
|
||||
{{/vendorExtensions.x-codegen-file}}
|
||||
{{/isDateTime}}
|
||||
{{/isString}}
|
||||
{{/required}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isMapContainer}}
|
||||
{{/isListContainer}}
|
||||
{{/vars}}
|
||||
}
|
||||
|
||||
|
||||
{{#vars}}{{^isInherited}}{{^isNotContainer}}{{{datatype}}}& {{classname}}::{{getter}}()
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{classname}}::{{getter}}() const
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{^isNotContainer}}
|
||||
{{{datatype}}}& {{classname}}::{{getter}}()
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
|
||||
void {{classname}}::{{setter}}({{{datatype}}} value)
|
||||
{
|
||||
m_{{name}} = value;
|
||||
{{^required}}m_{{name}}IsSet = true;{{/required}}
|
||||
}
|
||||
{{/isNotContainer}}
|
||||
{{^required}}bool {{classname}}::{{baseName}}IsSet() const
|
||||
{{#isNotContainer}}
|
||||
{{{datatype}}} {{classname}}::{{getter}}() const
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
|
||||
|
||||
void {{classname}}::{{setter}}({{{datatype}}} value)
|
||||
{
|
||||
m_{{name}} = value;
|
||||
{{^required}}m_{{name}}IsSet = true;{{/required}}
|
||||
}
|
||||
{{/isNotContainer}}
|
||||
{{^required}}
|
||||
bool {{classname}}::{{baseName}}IsSet() const
|
||||
{
|
||||
return m_{{name}}IsSet;
|
||||
}
|
||||
|
||||
void {{classname}}::unset{{name}}()
|
||||
{
|
||||
m_{{name}}IsSet = false;
|
||||
}
|
||||
|
||||
{{/required}}
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
|
||||
{{#modelNamespaceDeclarations}}
|
||||
}
|
||||
{{/modelNamespaceDeclarations}}
|
||||
|
@ -0,0 +1,86 @@
|
||||
function Get-FunctionsToExport {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias('FullName')]
|
||||
$Path
|
||||
)
|
||||
|
||||
Process {
|
||||
$Token = $null
|
||||
$ParserErr = $null
|
||||
|
||||
$Ast = [System.Management.Automation.Language.Parser]::ParseFile(
|
||||
$Path,
|
||||
[ref]$Token,
|
||||
[ref]$ParserErr
|
||||
)
|
||||
|
||||
if ($ParserErr) {
|
||||
throw $ParserErr
|
||||
} else {
|
||||
foreach ($name in 'Begin', 'Process', 'End') {
|
||||
foreach ($Statement in $Ast."${name}Block".Statements) {
|
||||
if (
|
||||
[String]::IsNullOrWhiteSpace($Statement.Name) -or
|
||||
$Statement.Extent.ToString() -notmatch
|
||||
('function\W+{0}' -f $Statement.Name)
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
$Statement.Name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
|
||||
$ClientPath = ("{{{csharpClientPath}}}" | Resolve-Path).ProviderPath
|
||||
$FunctionPath = 'API', 'Model' | ForEach-Object {Join-Path "$ScriptDir\src\{{{packageName}}}\" $_}
|
||||
$BinPath = "$ScriptDir\src\{{{packageName}}}\Bin"
|
||||
|
||||
Start-Process -FilePath "$ClientPath\build.bat" -WorkingDirectory $ClientPath -Wait -NoNewWindow
|
||||
|
||||
if (!(Test-Path "$ScriptDir\src\{{{packageName}}}\Bin" -PathType Container)) {
|
||||
New-Item "$ScriptDir\src\{{{packageName}}}\Bin" -ItemType Directory > $null
|
||||
}
|
||||
|
||||
Copy-Item "$ClientPath\bin\*.dll" $BinPath
|
||||
|
||||
$Manifest = @{
|
||||
Path = "$ScriptDir\src\{{{packageName}}}\{{{packageName}}}.psd1"
|
||||
|
||||
Author = 'Swagger Codegen Team'
|
||||
CompanyName = 'swagger.io'
|
||||
Description = '{{{packageName}}} - the PowerShell module for {{{appName}}}'
|
||||
|
||||
RootModule = '{{{packageName}}}.psm1'
|
||||
Guid = '{{packageGuid}}' # Has to be static, otherwise each new build will be considered different module
|
||||
|
||||
PowerShellVersion = '3.0'
|
||||
|
||||
RequiredAssemblies = Get-ChildItem "$BinPath\*.dll" | ForEach-Object {
|
||||
Join-Path $_.Directory.Name $_.Name
|
||||
}
|
||||
|
||||
FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport
|
||||
|
||||
VariablesToExport = @()
|
||||
AliasesToExport = @()
|
||||
CmdletsToExport = @()
|
||||
|
||||
# Should we use prefix to prevent command name collisions?
|
||||
# https://www.sapien.com/blog/2016/02/15/use-prefixes-to-prevent-command-name-collision/
|
||||
#
|
||||
# Kirk Munro recommends against it:
|
||||
# https://www.sapien.com/blog/2016/02/15/use-prefixes-to-prevent-command-name-collision/#comment-20820
|
||||
#
|
||||
# If not, we'd need to generate functions name with prefix.
|
||||
#
|
||||
# DefaultCommandPrefix = 'PetStore'
|
||||
}
|
||||
|
||||
New-ModuleManifest @Manifest
|
@ -0,0 +1,14 @@
|
||||
<#
|
||||
.Synopsis
|
||||
Helper function to get common parameters (Verbose, Debug, etc.)
|
||||
.Example
|
||||
Get-CommonParameters
|
||||
#>
|
||||
function Get-CommonParameters {
|
||||
function tmp {
|
||||
[CmdletBinding()]
|
||||
Param ()
|
||||
}
|
||||
|
||||
(Get-Command -Name tmp -CommandType Function).Parameters.Keys
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
#region Import functions
|
||||
|
||||
'API', 'Model', 'Private' | Get-ChildItem -Path {
|
||||
Join-Path $PSScriptRoot $_
|
||||
} -Filter '*.ps1' | ForEach-Object {
|
||||
Write-Verbose "Importing file: $($_.BaseName)"
|
||||
try {
|
||||
. $_.FullName
|
||||
} catch {
|
||||
Write-Verbose "Can't import function!"
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Initialize APIs
|
||||
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
{{#-first}}
|
||||
'Creating object: {{{packageName}}}.Api.{{{classname}}}' | Write-Verbose
|
||||
$Script:{{{classname}}}= New-Object -TypeName {{{packageName}}}.Api.{{{classname}}} -ArgumentList @($null)
|
||||
|
||||
{{/-first}}
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
|
||||
#endregion
|
@ -0,0 +1,37 @@
|
||||
<#
|
||||
.Synopsis
|
||||
Helper function to format debug parameter output.
|
||||
.Example
|
||||
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
||||
#>
|
||||
function Out-DebugParameter {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
[Parameter(ValueFromPipeline = $true, Mandatory = $true)]
|
||||
[AllowEmptyCollection()]
|
||||
$InputObject
|
||||
)
|
||||
|
||||
Begin {
|
||||
$CommonParameters = Get-CommonParameters
|
||||
}
|
||||
|
||||
Process {
|
||||
$InputObject.GetEnumerator() | Where-Object {
|
||||
$CommonParameters -notcontains $_.Key
|
||||
} | Format-Table -AutoSize -Property (
|
||||
@{
|
||||
Name = 'Parameter'
|
||||
Expression = {$_.Key}
|
||||
},
|
||||
@{
|
||||
Name = 'Value'
|
||||
Expression = {$_.Value}
|
||||
}
|
||||
) | Out-String -Stream | ForEach-Object {
|
||||
if ($_.Trim()) {
|
||||
$_
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
# {{packageName}} - the PowerShell module for the {{appName}}
|
||||
|
||||
{{#appDescription}}
|
||||
{{{appDescription}}}
|
||||
{{/appDescription}}
|
||||
|
||||
This PowerShell module is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: {{appVersion}}
|
||||
- SDK version: {{packageVersion}}
|
||||
{{^hideGenerationTimestamp}}
|
||||
- Build date: {{generatedDate}}
|
||||
{{/hideGenerationTimestamp}}
|
||||
- Build package: {{generatorClass}}
|
||||
{{#infoUrl}}
|
||||
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||
{{/infoUrl}}
|
||||
|
||||
<a name="frameworks-supported"></a>
|
||||
## Frameworks supported
|
||||
- PowerShell 3.0 or later
|
||||
|
||||
<a name="dependencies"></a>
|
||||
## Dependencies
|
||||
- C# API client generated by Swagger Codegen AND should be located in {{{csharpClientPath}}} as stated in Build.ps1
|
||||
|
||||
<a name="installation"></a>
|
||||
## Installation
|
||||
Run the following command to generate the DLL
|
||||
- [Windows] `Build.ps1`
|
||||
|
||||
Then import module from the .\src\{{{packageName}}} folder:
|
||||
```powershell
|
||||
using {{packageName}}.{{apiPackage}};
|
||||
using {{packageName}}.Client;
|
||||
using {{packageName}}.{{modelPackage}};
|
||||
```
|
||||
|
@ -0,0 +1,27 @@
|
||||
PSTOPIC
|
||||
about_{{{packageName}}}
|
||||
|
||||
SHORT DESCRIPTION
|
||||
{{{packageName}}} - the PowerShell module for the {{{appName}}}
|
||||
|
||||
LONG DESCRIPTION
|
||||
{{#appDescription}}
|
||||
{{{appDescription}}}
|
||||
|
||||
{{/appDescription}}
|
||||
This PowerShell module is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: {{appVersion}}
|
||||
- SDK version: {{packageVersion}}
|
||||
{{^hideGenerationTimestamp}}
|
||||
- Build date: {{generatedDate}}
|
||||
{{/hideGenerationTimestamp}}
|
||||
- Build package: {{{generatorClass}}}
|
||||
{{#infoUrl}}
|
||||
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||
{{/infoUrl}}
|
||||
|
||||
Frameworks supported:
|
||||
|
||||
* PowerShell 3.0+
|
||||
* .NET 4.0 or later
|
@ -0,0 +1,30 @@
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
function Invoke-{{{classname}}}{{{operationId}}} {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
{{#allParams}}
|
||||
[Parameter(Position = {{vendorExtensions.x-index}}, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = {{#required}}$true{{/required}}{{^required}}$false{{/required}})]
|
||||
[{{^isContainer}}{{^isPrimitiveType}}{{^isFile}}{{{packageName}}}.Model.{{/isFile}}{{/isPrimitiveType}}{{/isContainer}}{{{dataType}}}]
|
||||
{{=<% %>=}}
|
||||
${<%paramName%>}<%^-last%>,<%/-last%>
|
||||
<%={{ }}=%>
|
||||
{{/allParams}}
|
||||
)
|
||||
|
||||
Process {
|
||||
'Calling method: {{{classname}}}-{{{operationId}}}' | Write-Verbose
|
||||
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
||||
|
||||
$Script:{{{classname}}}.{{{operationId}}}(
|
||||
{{#allParams}}
|
||||
{{=<% %>=}}
|
||||
${<%paramName%>}<%^-last%>,<%/-last%>
|
||||
<%={{ }}=%>
|
||||
{{/allParams}}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
{{/operation}}
|
||||
{{/operations}}
|
@ -0,0 +1,105 @@
|
||||
# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}}
|
||||
{{description}}{{/description}}
|
||||
|
||||
All URIs are relative to *{{{basePath}}}*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||
{{/operation}}{{/operations}}
|
||||
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
<a name="{{{operationIdLowerCase}}}"></a>
|
||||
# **{{{operationId}}}**
|
||||
> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
|
||||
{{{summary}}}{{#notes}}
|
||||
|
||||
{{{notes}}}{{/notes}}
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using {{packageName}}.{{apiPackage}};
|
||||
using {{packageName}}.Client;
|
||||
using {{packageName}}.{{modelPackage}};
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class {{operationId}}Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
{{#hasAuthMethods}}
|
||||
{{#authMethods}}
|
||||
{{#isBasic}}
|
||||
// Configure HTTP basic authorization: {{{name}}}
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
{{/isBasic}}
|
||||
{{#isApiKey}}
|
||||
// Configure API key authorization: {{{name}}}
|
||||
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
|
||||
{{/hasAuthMethods}}
|
||||
var apiInstance = new {{classname}}();
|
||||
{{#allParams}}
|
||||
{{#isPrimitiveType}}
|
||||
var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/allParams}}
|
||||
|
||||
try
|
||||
{
|
||||
{{#summary}}
|
||||
// {{{.}}}
|
||||
{{/summary}}
|
||||
{{#returnType}}{{returnType}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||
Debug.WriteLine(result);{{/returnType}}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
||||
{{/allParams}}
|
||||
|
||||
### Return type
|
||||
|
||||
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
|
||||
|
||||
### Authorization
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
{{/operation}}
|
||||
{{/operations}}
|
@ -0,0 +1,17 @@
|
||||
# This file is auto-generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen)
|
||||
# Please replace "TEST_VALUE" with a proper value and uncomment the code for testing the function
|
||||
|
||||
Describe '{{{packageName}}} {{{classname}}}' {
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
Context '{{{classname}}}' {
|
||||
It 'Invoke-{{{classname}}}{{{operationId}}}' {
|
||||
$ret = Invoke-PetApiGetPetById{{#allParams}} -{{{paramName}}} "TEST_VALUE"{{/allParams}}
|
||||
#$ret | Should BeOfType {{{packageName}}}.Model.ModelNameHere
|
||||
#$ret.property | Should Be 0
|
||||
}
|
||||
}
|
||||
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
function New-{{{classname}}} {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
{{#vars}}
|
||||
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true{{#required}}, Mandatory = $true{{/required}})]
|
||||
[{{#isString}}{{{datatype}}}{{/isString}}{{^isString}}{{^required}}System.Nullable[{{/required}}{{datatype}}{{^required}}]{{/required}}{{/isString}}]
|
||||
{{=<% %>=}}
|
||||
${<%name%>}<%^-last%>,<%/-last%>
|
||||
<%={{ }}=%>
|
||||
{{/vars}}
|
||||
)
|
||||
|
||||
Process {
|
||||
'Creating object: {{{packageName}}}.Model.{{{classname}}}' | Write-Verbose
|
||||
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
||||
|
||||
New-Object -TypeName {{{packageName}}}.Model.{{{classname}}} -ArgumentList @(
|
||||
{{#vars}}
|
||||
{{=<% %>=}}
|
||||
${<%name%>}<%^-last%>,<%/-last%>
|
||||
<%={{ }}=%>
|
||||
{{/vars}}
|
||||
)
|
||||
}
|
||||
}
|
||||
{{/model}}
|
||||
{{/models}}
|
@ -0,0 +1,14 @@
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
# {{{packageName}}}.{{modelPackage}}.{{{classname}}}
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
|
||||
{{/vars}}
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
{{/model}}
|
||||
{{/models}}
|
@ -0,0 +1,6 @@
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
## TODO we need to update the template to test the model files
|
||||
|
||||
{{/model}}
|
||||
{{/models}}
|
@ -206,7 +206,7 @@ class RESTClientObject(object):
|
||||
# log response body
|
||||
logger.debug("response body: %s", r.data)
|
||||
|
||||
if r.status not in range(200, 206):
|
||||
if not 200 <= r.status <= 299:
|
||||
raise ApiException(http_resp=r)
|
||||
|
||||
return r
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <QUrl>
|
||||
#include <QFileInfo>
|
||||
#include <QBuffer>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
@ -283,8 +284,16 @@ void HttpRequestWorker::execute(HttpRequestInput *input) {
|
||||
manager->deleteResource(request);
|
||||
}
|
||||
else {
|
||||
QBuffer buff(&request_content);
|
||||
manager->sendCustomRequest(request, input->http_method.toLatin1(), &buff);
|
||||
#if (QT_VERSION >= 0x050800)
|
||||
manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content);
|
||||
#else
|
||||
QBuffer *buffer = new QBuffer;
|
||||
buffer->setData(request_content);
|
||||
buffer->open(QIODevice::ReadOnly);
|
||||
|
||||
QNetworkReply* reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer);
|
||||
buffer->setParent(reply);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,10 +37,8 @@ public:
|
||||
/// <summary>
|
||||
/// {{description}}
|
||||
/// </summary>
|
||||
{{^isNotContainer}}{{{datatype}}}& {{getter}}();
|
||||
{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{getter}}() const;
|
||||
{{{datatype}}} {{getter}}() const;
|
||||
void {{setter}}({{{datatype}}} value);
|
||||
{{/isNotContainer}}
|
||||
{{/vars}}
|
||||
|
||||
protected:
|
||||
|
@ -73,11 +73,8 @@ void {{classname}}::fromJsonString(std::string const& jsonString)
|
||||
{{/vars}}
|
||||
}
|
||||
|
||||
{{#vars}}{{^isNotContainer}}{{{datatype}}}& {{classname}}::{{getter}}()
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{classname}}::{{getter}}() const
|
||||
{{#vars}}
|
||||
{{{datatype}}} {{classname}}::{{getter}}() const
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
@ -85,7 +82,6 @@ void {{classname}}::{{setter}}({{{datatype}}} value)
|
||||
{
|
||||
m_{{name}} = value;
|
||||
}
|
||||
{{/isNotContainer}}
|
||||
{{/vars}}
|
||||
|
||||
{{#modelNamespaceDeclarations}}
|
||||
|
@ -133,14 +133,14 @@ export class {{classname}} {
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
{{#consumes}}
|
||||
'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}
|
||||
'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}
|
||||
{{/consumes}}
|
||||
];
|
||||
|
||||
// to determine the Accept header
|
||||
let produces: string[] = [
|
||||
{{#produces}}
|
||||
'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}
|
||||
'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}
|
||||
{{/produces}}
|
||||
];
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { {{{injectionToken}}} } from '@angular/core';
|
||||
import { OpaqueToken } from '@angular/core';
|
||||
|
||||
export const BASE_PATH = new {{{injectionToken}}}('basePath');
|
||||
export const BASE_PATH = new OpaqueToken('basePath');
|
||||
export const COLLECTION_FORMATS = {
|
||||
'csv': ',',
|
||||
'tsv': ' ',
|
||||
'ssv': ' ',
|
||||
'pipes': '|'
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class TypeScriptAngular2ClientOptionsProvider implements OptionsProvider
|
||||
.put(TypeScriptAngular2ClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString())
|
||||
.put(TypeScriptAngular2ClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.put(TypeScriptAngular2ClientCodegen.USE_OPAQUE_TOKEN, Boolean.FALSE.toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
3
pom.xml
3
pom.xml
@ -814,8 +814,9 @@
|
||||
<module>samples/client/petstore/swift/default/SwaggerClientTests</module>
|
||||
<module>samples/client/petstore/swift/promisekit/SwaggerClientTests</module>
|
||||
<module>samples/client/petstore/swift/rxswift/SwaggerClientTests</module>
|
||||
<!-- comment out objc tests as it's timing out
|
||||
<module>samples/client/petstore/objc/default/SwaggerClientTests</module>
|
||||
<module>samples/client/petstore/objc/core-data/SwaggerClientTests</module>
|
||||
<module>samples/client/petstore/objc/core-data/SwaggerClientTests</module>-->
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
@ -11,7 +11,7 @@ docker run --rm -it \
|
||||
-w /gen \
|
||||
-e GEN_DIR=/gen \
|
||||
-e MAVEN_CONFIG=/var/maven/.m2 \
|
||||
-u "$(id -u):$(id -u)" \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
-v "${PWD}:/gen" \
|
||||
-v "${maven_cache_repo}:/var/maven/.m2/repository" \
|
||||
--entrypoint /gen/docker-entrypoint.sh \
|
||||
|
@ -173,12 +173,15 @@
|
||||
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
||||
*/
|
||||
exports.prototype.isFileParam = function(param) {
|
||||
// fs.ReadStream in Node.js (but not in runtime like browserify)
|
||||
if (typeof window === 'undefined' &&
|
||||
typeof require === 'function' &&
|
||||
require('fs') &&
|
||||
param instanceof require('fs').ReadStream) {
|
||||
return true;
|
||||
// fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
|
||||
if (typeof require === 'function') {
|
||||
var fs;
|
||||
try {
|
||||
fs = require('fs');
|
||||
} catch (err) {}
|
||||
if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Buffer in Node.js
|
||||
if (typeof Buffer === 'function' && param instanceof Buffer) {
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <QUrl>
|
||||
#include <QFileInfo>
|
||||
#include <QBuffer>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
||||
namespace Swagger {
|
||||
@ -292,8 +293,16 @@ void HttpRequestWorker::execute(HttpRequestInput *input) {
|
||||
manager->deleteResource(request);
|
||||
}
|
||||
else {
|
||||
QBuffer buff(&request_content);
|
||||
manager->sendCustomRequest(request, input->http_method.toLatin1(), &buff);
|
||||
#if (QT_VERSION >= 0x050800)
|
||||
manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content);
|
||||
#else
|
||||
QBuffer *buffer = new QBuffer;
|
||||
buffer->setData(request_content);
|
||||
buffer->open(QIODevice::ReadOnly);
|
||||
|
||||
QNetworkReply* reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer);
|
||||
buffer->setParent(reply);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ ApiResponse::ApiResponse()
|
||||
m_TypeIsSet = false;
|
||||
m_Message = U("");
|
||||
m_MessageIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
ApiResponse::~ApiResponse()
|
||||
@ -41,7 +40,6 @@ void ApiResponse::validate()
|
||||
|
||||
web::json::value ApiResponse::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_CodeIsSet)
|
||||
@ -56,15 +54,12 @@ web::json::value ApiResponse::toJson() const
|
||||
{
|
||||
val[U("message")] = ModelBase::toJson(m_Message);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void ApiResponse::fromJson(web::json::value& val)
|
||||
{
|
||||
|
||||
|
||||
if(val.has_field(U("code")))
|
||||
{
|
||||
setCode(ModelBase::int32_tFromJson(val[U("code")]));
|
||||
@ -72,14 +67,11 @@ void ApiResponse::fromJson(web::json::value& val)
|
||||
if(val.has_field(U("type")))
|
||||
{
|
||||
setType(ModelBase::stringFromJson(val[U("type")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("message")))
|
||||
{
|
||||
setMessage(ModelBase::stringFromJson(val[U("message")]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ApiResponse::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
@ -104,7 +96,6 @@ void ApiResponse::toMultipart(std::shared_ptr<MultipartFormData> multipart, cons
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("message"), m_Message));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ApiResponse::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
@ -122,21 +113,19 @@ void ApiResponse::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, co
|
||||
if(multipart->hasContent(U("type")))
|
||||
{
|
||||
setType(ModelBase::stringFromHttpContent(multipart->getContent(U("type"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("message")))
|
||||
{
|
||||
setMessage(ModelBase::stringFromHttpContent(multipart->getContent(U("message"))));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int32_t ApiResponse::getCode() const
|
||||
{
|
||||
return m_Code;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setCode(int32_t value)
|
||||
{
|
||||
m_Code = value;
|
||||
@ -146,14 +135,18 @@ bool ApiResponse::codeIsSet() const
|
||||
{
|
||||
return m_CodeIsSet;
|
||||
}
|
||||
|
||||
void ApiResponse::unsetCode()
|
||||
{
|
||||
m_CodeIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t ApiResponse::getType() const
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setType(utility::string_t value)
|
||||
{
|
||||
m_Type = value;
|
||||
@ -163,14 +156,18 @@ bool ApiResponse::typeIsSet() const
|
||||
{
|
||||
return m_TypeIsSet;
|
||||
}
|
||||
|
||||
void ApiResponse::unsetType()
|
||||
{
|
||||
m_TypeIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t ApiResponse::getMessage() const
|
||||
{
|
||||
return m_Message;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setMessage(utility::string_t value)
|
||||
{
|
||||
m_Message = value;
|
||||
@ -180,6 +177,7 @@ bool ApiResponse::messageIsSet() const
|
||||
{
|
||||
return m_MessageIsSet;
|
||||
}
|
||||
|
||||
void ApiResponse::unsetMessage()
|
||||
{
|
||||
m_MessageIsSet = false;
|
||||
|
@ -57,23 +57,23 @@ public:
|
||||
///
|
||||
/// </summary>
|
||||
int32_t getCode() const;
|
||||
void setCode(int32_t value);
|
||||
bool codeIsSet() const;
|
||||
void unsetCode();
|
||||
void setCode(int32_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getType() const;
|
||||
void setType(utility::string_t value);
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getMessage() const;
|
||||
void setMessage(utility::string_t value);
|
||||
bool messageIsSet() const;
|
||||
void unsetMessage();
|
||||
void setMessage(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int32_t m_Code;
|
||||
|
@ -25,7 +25,6 @@ Category::Category()
|
||||
m_IdIsSet = false;
|
||||
m_Name = U("");
|
||||
m_NameIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
Category::~Category()
|
||||
@ -39,7 +38,6 @@ void Category::validate()
|
||||
|
||||
web::json::value Category::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
@ -50,15 +48,12 @@ web::json::value Category::toJson() const
|
||||
{
|
||||
val[U("name")] = ModelBase::toJson(m_Name);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Category::fromJson(web::json::value& val)
|
||||
{
|
||||
|
||||
|
||||
if(val.has_field(U("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[U("id")]));
|
||||
@ -66,9 +61,7 @@ void Category::fromJson(web::json::value& val)
|
||||
if(val.has_field(U("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromJson(val[U("name")]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Category::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
@ -88,7 +81,6 @@ void Category::toMultipart(std::shared_ptr<MultipartFormData> multipart, const u
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("name"), m_Name));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Category::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
@ -106,16 +98,15 @@ void Category::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const
|
||||
if(multipart->hasContent(U("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromHttpContent(multipart->getContent(U("name"))));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int64_t Category::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Category::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
@ -125,14 +116,18 @@ bool Category::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Category::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Category::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Category::setName(utility::string_t value)
|
||||
{
|
||||
m_Name = value;
|
||||
@ -142,6 +137,7 @@ bool Category::nameIsSet() const
|
||||
{
|
||||
return m_NameIsSet;
|
||||
}
|
||||
|
||||
void Category::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
|
@ -57,16 +57,16 @@ public:
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getName() const;
|
||||
void setName(utility::string_t value);
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
|
@ -33,7 +33,6 @@ Order::Order()
|
||||
m_StatusIsSet = false;
|
||||
m_Complete = false;
|
||||
m_CompleteIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
Order::~Order()
|
||||
@ -47,7 +46,6 @@ void Order::validate()
|
||||
|
||||
web::json::value Order::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
@ -74,15 +72,12 @@ web::json::value Order::toJson() const
|
||||
{
|
||||
val[U("complete")] = ModelBase::toJson(m_Complete);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Order::fromJson(web::json::value& val)
|
||||
{
|
||||
|
||||
|
||||
if(val.has_field(U("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[U("id")]));
|
||||
@ -98,18 +93,15 @@ void Order::fromJson(web::json::value& val)
|
||||
if(val.has_field(U("shipDate")))
|
||||
{
|
||||
setShipDate(ModelBase::dateFromJson(val[U("shipDate")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromJson(val[U("status")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("complete")))
|
||||
{
|
||||
setComplete(ModelBase::boolFromJson(val[U("complete")]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Order::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
@ -146,7 +138,6 @@ void Order::toMultipart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("complete"), m_Complete));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Order::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
@ -172,25 +163,23 @@ void Order::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const ut
|
||||
if(multipart->hasContent(U("shipDate")))
|
||||
{
|
||||
setShipDate(ModelBase::dateFromHttpContent(multipart->getContent(U("shipDate"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromHttpContent(multipart->getContent(U("status"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("complete")))
|
||||
{
|
||||
setComplete(ModelBase::boolFromHttpContent(multipart->getContent(U("complete"))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int64_t Order::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Order::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
@ -200,14 +189,18 @@ bool Order::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
int64_t Order::getPetId() const
|
||||
{
|
||||
return m_PetId;
|
||||
}
|
||||
|
||||
|
||||
void Order::setPetId(int64_t value)
|
||||
{
|
||||
m_PetId = value;
|
||||
@ -217,14 +210,18 @@ bool Order::petIdIsSet() const
|
||||
{
|
||||
return m_PetIdIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetPetId()
|
||||
{
|
||||
m_PetIdIsSet = false;
|
||||
}
|
||||
|
||||
int32_t Order::getQuantity() const
|
||||
{
|
||||
return m_Quantity;
|
||||
}
|
||||
|
||||
|
||||
void Order::setQuantity(int32_t value)
|
||||
{
|
||||
m_Quantity = value;
|
||||
@ -234,14 +231,18 @@ bool Order::quantityIsSet() const
|
||||
{
|
||||
return m_QuantityIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetQuantity()
|
||||
{
|
||||
m_QuantityIsSet = false;
|
||||
}
|
||||
|
||||
utility::datetime Order::getShipDate() const
|
||||
{
|
||||
return m_ShipDate;
|
||||
}
|
||||
|
||||
|
||||
void Order::setShipDate(utility::datetime value)
|
||||
{
|
||||
m_ShipDate = value;
|
||||
@ -251,14 +252,18 @@ bool Order::shipDateIsSet() const
|
||||
{
|
||||
return m_ShipDateIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetShipDate()
|
||||
{
|
||||
m_ShipDateIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Order::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
|
||||
|
||||
void Order::setStatus(utility::string_t value)
|
||||
{
|
||||
m_Status = value;
|
||||
@ -268,14 +273,18 @@ bool Order::statusIsSet() const
|
||||
{
|
||||
return m_StatusIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetStatus()
|
||||
{
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
bool Order::getComplete() const
|
||||
{
|
||||
return m_Complete;
|
||||
}
|
||||
|
||||
|
||||
void Order::setComplete(bool value)
|
||||
{
|
||||
m_Complete = value;
|
||||
@ -285,6 +294,7 @@ bool Order::completeIsSet() const
|
||||
{
|
||||
return m_CompleteIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetComplete()
|
||||
{
|
||||
m_CompleteIsSet = false;
|
||||
|
@ -57,44 +57,44 @@ public:
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPetId() const;
|
||||
void setPetId(int64_t value);
|
||||
bool petIdIsSet() const;
|
||||
void unsetPetId();
|
||||
void setPetId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int32_t getQuantity() const;
|
||||
void setQuantity(int32_t value);
|
||||
bool quantityIsSet() const;
|
||||
void unsetQuantity();
|
||||
void setQuantity(int32_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::datetime getShipDate() const;
|
||||
void setShipDate(utility::datetime value);
|
||||
bool shipDateIsSet() const;
|
||||
void unsetShipDate();
|
||||
void setShipDate(utility::datetime value);
|
||||
/// <summary>
|
||||
/// Order Status
|
||||
/// </summary>
|
||||
utility::string_t getStatus() const;
|
||||
void setStatus(utility::string_t value);
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
void setStatus(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool getComplete() const;
|
||||
void setComplete(bool value);
|
||||
bool completeIsSet() const;
|
||||
void unsetComplete();
|
||||
void setComplete(bool value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
|
@ -28,7 +28,6 @@ Pet::Pet()
|
||||
m_TagsIsSet = false;
|
||||
m_Status = U("");
|
||||
m_StatusIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
Pet::~Pet()
|
||||
@ -42,7 +41,6 @@ void Pet::validate()
|
||||
|
||||
web::json::value Pet::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
@ -61,14 +59,13 @@ web::json::value Pet::toJson() const
|
||||
jsonArray.push_back(ModelBase::toJson(item));
|
||||
}
|
||||
val[U("photoUrls")] = web::json::value::array(jsonArray);
|
||||
}
|
||||
}
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_Tags )
|
||||
{
|
||||
jsonArray.push_back(ModelBase::toJson(item));
|
||||
}
|
||||
|
||||
if(jsonArray.size() > 0)
|
||||
{
|
||||
val[U("tags")] = web::json::value::array(jsonArray);
|
||||
@ -78,15 +75,12 @@ web::json::value Pet::toJson() const
|
||||
{
|
||||
val[U("status")] = ModelBase::toJson(m_Status);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Pet::fromJson(web::json::value& val)
|
||||
{
|
||||
|
||||
|
||||
if(val.has_field(U("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[U("id")]));
|
||||
@ -99,16 +93,14 @@ void Pet::fromJson(web::json::value& val)
|
||||
newItem->fromJson(val[U("category")]);
|
||||
setCategory( newItem );
|
||||
}
|
||||
|
||||
}
|
||||
setName(ModelBase::stringFromJson(val[U("name")]));
|
||||
{
|
||||
m_PhotoUrls.clear();
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : val[U("photoUrls")].as_array() )
|
||||
for( auto& item : val[U("photoUrls")].as_array() )
|
||||
{
|
||||
m_PhotoUrls.push_back(ModelBase::stringFromJson(item));
|
||||
|
||||
}
|
||||
}
|
||||
{
|
||||
@ -118,7 +110,6 @@ void Pet::fromJson(web::json::value& val)
|
||||
{
|
||||
for( auto& item : val[U("tags")].as_array() )
|
||||
{
|
||||
|
||||
if(item.is_null())
|
||||
{
|
||||
m_Tags.push_back( std::shared_ptr<Tag>(nullptr) );
|
||||
@ -129,16 +120,13 @@ void Pet::fromJson(web::json::value& val)
|
||||
newItem->fromJson(item);
|
||||
m_Tags.push_back( newItem );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(val.has_field(U("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromJson(val[U("status")]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Pet::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
@ -187,7 +175,6 @@ void Pet::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utilit
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("status"), m_Status));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
@ -210,17 +197,15 @@ void Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
newItem->fromMultiPart(multipart, U("category."));
|
||||
setCategory( newItem );
|
||||
}
|
||||
|
||||
}
|
||||
setName(ModelBase::stringFromHttpContent(multipart->getContent(U("name"))));
|
||||
{
|
||||
m_PhotoUrls.clear();
|
||||
|
||||
|
||||
web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(U("photoUrls"))));
|
||||
for( auto& item : jsonArray.as_array() )
|
||||
{
|
||||
m_PhotoUrls.push_back(ModelBase::stringFromJson(item));
|
||||
|
||||
}
|
||||
}
|
||||
{
|
||||
@ -231,7 +216,6 @@ void Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(U("tags"))));
|
||||
for( auto& item : jsonArray.as_array() )
|
||||
{
|
||||
|
||||
if(item.is_null())
|
||||
{
|
||||
m_Tags.push_back( std::shared_ptr<Tag>(nullptr) );
|
||||
@ -242,23 +226,21 @@ void Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
newItem->fromJson(item);
|
||||
m_Tags.push_back( newItem );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(multipart->hasContent(U("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromHttpContent(multipart->getContent(U("status"))));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int64_t Pet::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
@ -268,14 +250,18 @@ bool Pet::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
std::shared_ptr<Category> Pet::getCategory() const
|
||||
{
|
||||
return m_Category;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setCategory(std::shared_ptr<Category> value)
|
||||
{
|
||||
m_Category = value;
|
||||
@ -285,14 +271,18 @@ bool Pet::categoryIsSet() const
|
||||
{
|
||||
return m_CategoryIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetCategory()
|
||||
{
|
||||
m_CategoryIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Pet::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setName(utility::string_t value)
|
||||
{
|
||||
m_Name = value;
|
||||
@ -302,22 +292,38 @@ std::vector<utility::string_t>& Pet::getPhotoUrls()
|
||||
{
|
||||
return m_PhotoUrls;
|
||||
}
|
||||
|
||||
void Pet::setPhotoUrls(std::vector<utility::string_t> value)
|
||||
{
|
||||
m_PhotoUrls = value;
|
||||
|
||||
}
|
||||
std::vector<std::shared_ptr<Tag>>& Pet::getTags()
|
||||
{
|
||||
return m_Tags;
|
||||
}
|
||||
|
||||
void Pet::setTags(std::vector<std::shared_ptr<Tag>> value)
|
||||
{
|
||||
m_Tags = value;
|
||||
m_TagsIsSet = true;
|
||||
}
|
||||
bool Pet::tagsIsSet() const
|
||||
{
|
||||
return m_TagsIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetTags()
|
||||
{
|
||||
m_TagsIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Pet::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setStatus(utility::string_t value)
|
||||
{
|
||||
m_Status = value;
|
||||
@ -327,6 +333,7 @@ bool Pet::statusIsSet() const
|
||||
{
|
||||
return m_StatusIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetStatus()
|
||||
{
|
||||
m_StatusIsSet = false;
|
||||
|
@ -60,38 +60,40 @@ public:
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::shared_ptr<Category> getCategory() const;
|
||||
void setCategory(std::shared_ptr<Category> value);
|
||||
bool categoryIsSet() const;
|
||||
void unsetCategory();
|
||||
void setCategory(std::shared_ptr<Category> value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getName() const;
|
||||
void setName(utility::string_t value);
|
||||
/// <summary>
|
||||
void setName(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<utility::string_t>& getPhotoUrls();
|
||||
/// <summary>
|
||||
void setPhotoUrls(std::vector<utility::string_t> value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<std::shared_ptr<Tag>>& getTags();
|
||||
bool tagsIsSet() const;
|
||||
void unsetTags();
|
||||
void setTags(std::vector<std::shared_ptr<Tag>> value);
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
utility::string_t getStatus() const;
|
||||
void setStatus(utility::string_t value);
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
void setStatus(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
|
@ -25,7 +25,6 @@ Tag::Tag()
|
||||
m_IdIsSet = false;
|
||||
m_Name = U("");
|
||||
m_NameIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
Tag::~Tag()
|
||||
@ -39,7 +38,6 @@ void Tag::validate()
|
||||
|
||||
web::json::value Tag::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
@ -50,15 +48,12 @@ web::json::value Tag::toJson() const
|
||||
{
|
||||
val[U("name")] = ModelBase::toJson(m_Name);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Tag::fromJson(web::json::value& val)
|
||||
{
|
||||
|
||||
|
||||
if(val.has_field(U("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[U("id")]));
|
||||
@ -66,9 +61,7 @@ void Tag::fromJson(web::json::value& val)
|
||||
if(val.has_field(U("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromJson(val[U("name")]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Tag::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
@ -88,7 +81,6 @@ void Tag::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utilit
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("name"), m_Name));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Tag::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
@ -106,16 +98,15 @@ void Tag::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
if(multipart->hasContent(U("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromHttpContent(multipart->getContent(U("name"))));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int64_t Tag::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Tag::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
@ -125,14 +116,18 @@ bool Tag::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Tag::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Tag::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Tag::setName(utility::string_t value)
|
||||
{
|
||||
m_Name = value;
|
||||
@ -142,6 +137,7 @@ bool Tag::nameIsSet() const
|
||||
{
|
||||
return m_NameIsSet;
|
||||
}
|
||||
|
||||
void Tag::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
|
@ -57,16 +57,16 @@ public:
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getName() const;
|
||||
void setName(utility::string_t value);
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
|
@ -37,7 +37,6 @@ User::User()
|
||||
m_PhoneIsSet = false;
|
||||
m_UserStatus = 0;
|
||||
m_UserStatusIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
User::~User()
|
||||
@ -51,7 +50,6 @@ void User::validate()
|
||||
|
||||
web::json::value User::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
@ -86,15 +84,12 @@ web::json::value User::toJson() const
|
||||
{
|
||||
val[U("userStatus")] = ModelBase::toJson(m_UserStatus);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void User::fromJson(web::json::value& val)
|
||||
{
|
||||
|
||||
|
||||
if(val.has_field(U("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[U("id")]));
|
||||
@ -102,38 +97,31 @@ void User::fromJson(web::json::value& val)
|
||||
if(val.has_field(U("username")))
|
||||
{
|
||||
setUsername(ModelBase::stringFromJson(val[U("username")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("firstName")))
|
||||
{
|
||||
setFirstName(ModelBase::stringFromJson(val[U("firstName")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("lastName")))
|
||||
{
|
||||
setLastName(ModelBase::stringFromJson(val[U("lastName")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("email")))
|
||||
{
|
||||
setEmail(ModelBase::stringFromJson(val[U("email")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("password")))
|
||||
{
|
||||
setPassword(ModelBase::stringFromJson(val[U("password")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("phone")))
|
||||
{
|
||||
setPhone(ModelBase::stringFromJson(val[U("phone")]));
|
||||
|
||||
}
|
||||
if(val.has_field(U("userStatus")))
|
||||
{
|
||||
setUserStatus(ModelBase::int32_tFromJson(val[U("userStatus")]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void User::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
@ -182,7 +170,6 @@ void User::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utili
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + U("userStatus"), m_UserStatus));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void User::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
@ -200,45 +187,39 @@ void User::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const uti
|
||||
if(multipart->hasContent(U("username")))
|
||||
{
|
||||
setUsername(ModelBase::stringFromHttpContent(multipart->getContent(U("username"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("firstName")))
|
||||
{
|
||||
setFirstName(ModelBase::stringFromHttpContent(multipart->getContent(U("firstName"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("lastName")))
|
||||
{
|
||||
setLastName(ModelBase::stringFromHttpContent(multipart->getContent(U("lastName"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("email")))
|
||||
{
|
||||
setEmail(ModelBase::stringFromHttpContent(multipart->getContent(U("email"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("password")))
|
||||
{
|
||||
setPassword(ModelBase::stringFromHttpContent(multipart->getContent(U("password"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("phone")))
|
||||
{
|
||||
setPhone(ModelBase::stringFromHttpContent(multipart->getContent(U("phone"))));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(U("userStatus")))
|
||||
{
|
||||
setUserStatus(ModelBase::int32_tFromHttpContent(multipart->getContent(U("userStatus"))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int64_t User::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void User::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
@ -248,14 +229,18 @@ bool User::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void User::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getUsername() const
|
||||
{
|
||||
return m_Username;
|
||||
}
|
||||
|
||||
|
||||
void User::setUsername(utility::string_t value)
|
||||
{
|
||||
m_Username = value;
|
||||
@ -265,14 +250,18 @@ bool User::usernameIsSet() const
|
||||
{
|
||||
return m_UsernameIsSet;
|
||||
}
|
||||
|
||||
void User::unsetUsername()
|
||||
{
|
||||
m_UsernameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getFirstName() const
|
||||
{
|
||||
return m_FirstName;
|
||||
}
|
||||
|
||||
|
||||
void User::setFirstName(utility::string_t value)
|
||||
{
|
||||
m_FirstName = value;
|
||||
@ -282,14 +271,18 @@ bool User::firstNameIsSet() const
|
||||
{
|
||||
return m_FirstNameIsSet;
|
||||
}
|
||||
|
||||
void User::unsetFirstName()
|
||||
{
|
||||
m_FirstNameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getLastName() const
|
||||
{
|
||||
return m_LastName;
|
||||
}
|
||||
|
||||
|
||||
void User::setLastName(utility::string_t value)
|
||||
{
|
||||
m_LastName = value;
|
||||
@ -299,14 +292,18 @@ bool User::lastNameIsSet() const
|
||||
{
|
||||
return m_LastNameIsSet;
|
||||
}
|
||||
|
||||
void User::unsetLastName()
|
||||
{
|
||||
m_LastNameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getEmail() const
|
||||
{
|
||||
return m_Email;
|
||||
}
|
||||
|
||||
|
||||
void User::setEmail(utility::string_t value)
|
||||
{
|
||||
m_Email = value;
|
||||
@ -316,14 +313,18 @@ bool User::emailIsSet() const
|
||||
{
|
||||
return m_EmailIsSet;
|
||||
}
|
||||
|
||||
void User::unsetEmail()
|
||||
{
|
||||
m_EmailIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getPassword() const
|
||||
{
|
||||
return m_Password;
|
||||
}
|
||||
|
||||
|
||||
void User::setPassword(utility::string_t value)
|
||||
{
|
||||
m_Password = value;
|
||||
@ -333,14 +334,18 @@ bool User::passwordIsSet() const
|
||||
{
|
||||
return m_PasswordIsSet;
|
||||
}
|
||||
|
||||
void User::unsetPassword()
|
||||
{
|
||||
m_PasswordIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getPhone() const
|
||||
{
|
||||
return m_Phone;
|
||||
}
|
||||
|
||||
|
||||
void User::setPhone(utility::string_t value)
|
||||
{
|
||||
m_Phone = value;
|
||||
@ -350,14 +355,18 @@ bool User::phoneIsSet() const
|
||||
{
|
||||
return m_PhoneIsSet;
|
||||
}
|
||||
|
||||
void User::unsetPhone()
|
||||
{
|
||||
m_PhoneIsSet = false;
|
||||
}
|
||||
|
||||
int32_t User::getUserStatus() const
|
||||
{
|
||||
return m_UserStatus;
|
||||
}
|
||||
|
||||
|
||||
void User::setUserStatus(int32_t value)
|
||||
{
|
||||
m_UserStatus = value;
|
||||
@ -367,6 +376,7 @@ bool User::userStatusIsSet() const
|
||||
{
|
||||
return m_UserStatusIsSet;
|
||||
}
|
||||
|
||||
void User::unsetUserStatus()
|
||||
{
|
||||
m_UserStatusIsSet = false;
|
||||
|
@ -57,58 +57,58 @@ public:
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getUsername() const;
|
||||
void setUsername(utility::string_t value);
|
||||
bool usernameIsSet() const;
|
||||
void unsetUsername();
|
||||
void setUsername(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getFirstName() const;
|
||||
void setFirstName(utility::string_t value);
|
||||
bool firstNameIsSet() const;
|
||||
void unsetFirstName();
|
||||
void setFirstName(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getLastName() const;
|
||||
void setLastName(utility::string_t value);
|
||||
bool lastNameIsSet() const;
|
||||
void unsetLastName();
|
||||
void setLastName(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getEmail() const;
|
||||
void setEmail(utility::string_t value);
|
||||
bool emailIsSet() const;
|
||||
void unsetEmail();
|
||||
void setEmail(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getPassword() const;
|
||||
void setPassword(utility::string_t value);
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getPhone() const;
|
||||
void setPhone(utility::string_t value);
|
||||
bool phoneIsSet() const;
|
||||
void unsetPhone();
|
||||
void setPhone(utility::string_t value);
|
||||
/// <summary>
|
||||
/// User Status
|
||||
/// </summary>
|
||||
int32_t getUserStatus() const;
|
||||
void setUserStatus(int32_t value);
|
||||
bool userStatusIsSet() const;
|
||||
void unsetUserStatus();
|
||||
void setUserStatus(int32_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
|
@ -94,10 +94,10 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.8"
|
||||
jackson_version = "2.7.5"
|
||||
jersey_version = "1.19.1"
|
||||
jodatime_version = "2.9.4"
|
||||
swagger_annotations_version = "1.5.15"
|
||||
jackson_version = "2.8.9"
|
||||
jersey_version = "1.19.4"
|
||||
jodatime_version = "2.9.9"
|
||||
junit_version = "4.12"
|
||||
}
|
||||
|
||||
|
@ -247,10 +247,10 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||
<jersey-version>1.19.1</jersey-version>
|
||||
<jackson-version>2.7.5</jackson-version>
|
||||
<jodatime-version>2.9.4</jodatime-version>
|
||||
<swagger-annotations-version>1.5.15</swagger-annotations-version>
|
||||
<jersey-version>1.19.4</jersey-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
</properties>
|
||||
|
@ -93,12 +93,12 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.8"
|
||||
jackson_version = "2.7.5"
|
||||
jersey_version = "2.22.2"
|
||||
jodatime_version = "2.9.4"
|
||||
swagger_annotations_version = "1.5.15"
|
||||
jackson_version = "2.8.9"
|
||||
jersey_version = "2.25.1"
|
||||
jodatime_version = "2.9.9"
|
||||
commons_io_version=2.5
|
||||
commons_lang3_version=3.5
|
||||
commons_lang3_version=3.6
|
||||
junit_version = "4.12"
|
||||
}
|
||||
|
||||
|
@ -9,17 +9,17 @@ lazy val root = (project in file(".")).
|
||||
publishArtifact in (Compile, packageDoc) := false,
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
"io.swagger" % "swagger-annotations" % "1.5.8",
|
||||
"org.glassfish.jersey.core" % "jersey-client" % "2.22.2",
|
||||
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.22.2",
|
||||
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.2",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.7.5",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.7.5",
|
||||
"joda-time" % "joda-time" % "2.9.4",
|
||||
"io.swagger" % "swagger-annotations" % "1.5.15",
|
||||
"org.glassfish.jersey.core" % "jersey-client" % "2.25.1",
|
||||
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1",
|
||||
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.8.9",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.8.9",
|
||||
"joda-time" % "joda-time" % "2.9.9",
|
||||
"com.brsanthu" % "migbase64" % "2.2",
|
||||
"org.apache.commons" % "commons-lang3" % "3.5",
|
||||
"org.apache.commons" % "commons-lang3" % "3.6",
|
||||
"commons-io" % "commons-io" % "2.5",
|
||||
"junit" % "junit" % "4.12" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||
|
@ -255,11 +255,11 @@
|
||||
</dependencies>
|
||||
<properties>
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
<jersey-version>2.22.2</jersey-version>
|
||||
<jackson-version>2.7.5</jackson-version>
|
||||
<jodatime-version>2.9.4</jodatime-version>
|
||||
<jersey-version>2.25.1</jersey-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
<commons_io_version>2.5</commons_io_version>
|
||||
<commons_lang3_version>3.5</commons_lang3_version>
|
||||
<commons_lang3_version>3.6</commons_lang3_version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
</properties>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user