diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index f79673f46b..889322e2a6 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -2,7 +2,7 @@
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
- [ ] Ran the shell script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh` and `./bin/security/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in `.\bin\windows\`.
-- [ ] Filed the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (3.3.x), `4.0.x`. Default: `master`.
+- [ ] Filed the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `3.4.x`, `4.0.x`. Default: `master`.
- [ ] Copied the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.
### Description of the PR
diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh
index ea762983ed..51d81a2afa 100755
--- a/CI/circle_parallel.sh
+++ b/CI/circle_parallel.sh
@@ -1,24 +1,27 @@
#!/bin/bash
+#
+# A bash script to run CircleCI node/test in parallel
+#
NODE_INDEX=${CIRCLE_NODE_INDEX:-0}
-
if [ "$NODE_INDEX" = "1" ]; then
- echo "Running node $NODE_INDEX to test CI/pom.xml.circleci ..."
- cp CI/pom.xml.circleci pom.xml
+ echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
+ #cp CI/pom.xml.circleci pom.xml
java -version
- mvn --quiet verify -Psamples
+ mvn --quiet verify -Psamples.circleci
elif [ "$NODE_INDEX" = "2" ]; then
echo "Running node $NODE_INDEX to test ensure-up-to-date"
+ java -version
#export GO_POST_PROCESS_FILE="/usr/local/bin/gofmt -w"
# not formatting the code as different go versions may format the code a bit different
- ./bin/utils/ensure-up-to-date
+ #./bin/utils/ensure-up-to-date
else
- echo "Running node $NODE_INDEX to test CI/pom.xml.circleci.java7 ..."
+ echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..."
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
java -version
- cp CI/pom.xml.circleci.java7 pom.xml
- mvn --quiet verify -Psamples
+ #cp CI/pom.xml.circleci.java7 pom.xml
+ mvn --quiet verify -Psamples.circleci.jdk7
fi
diff --git a/README.md b/README.md
index 0086e05740..bdb4d625e2 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,16 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.3.0`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
+[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.3.1`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
+[`3.4.x`](https://github.com/OpenAPITools/openapi-generator/tree/3.4.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
+[](https://circleci.com/gh/OpenAPITools/openapi-generator)
+[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
+[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
+
[`4.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.0.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
@@ -31,7 +36,7 @@
:notebook_with_decorative_cover: The eBook [A Beginner's Guide to Code Generation for REST APIs](https://gumroad.com/l/swagger_codegen_beginner) is a good starting point for beginners :notebook_with_decorative_cover:
-:warning: If the OpenAPI spec is obtained from an untrusted source, please make sure you've reviewed the spec before using OpenAPI Generator to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning:
+:warning: If the OpenAPI spec, templates or any input (e.g. options, envirionment variables) is obtained from an untrusted source or environment, please make sure you've reviewed these inputs before using OpenAPI Generator to generate the API client, server stub or documentation to avoid potential security issues (e.g. [code injection](https://en.wikipedia.org/wiki/Code_injection)) :warning:
:bangbang: Both "OpenAPI Tools" (https://OpenAPITools.org - the parent organization of OpenAPI Generator) and "OpenAPI Generator" are not affiliated with OpenAPI Initiative (OAI) :bangbang:
@@ -84,8 +89,8 @@ OpenAPI Generator Version | Release Date | Notes
---------------------------- | ------------ | -----
4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | Major release with breaking changes (no fallback)
3.4.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.4.0-SNAPSHOT/)| 01.11.2018 | Minor release (breaking changes with fallbacks)
-3.3.1 (current master, upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.3.1-SNAPSHOT/) | 15.10.2018 | Bugfix release
-[3.3.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.3.0) (latest stable release) | 01.10.2018 | Minor release (breaking changes with fallbacks)
+3.3.2 (current master, upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.3.2-SNAPSHOT/) | 29.10.2018 | Bugfix release
+[3.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.3.1) (latest stable release) | 15.10.2018 | Bugfix release
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
@@ -141,16 +146,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
-JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.0/openapi-generator-cli-3.3.0.jar`
+JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.1/openapi-generator-cli-3.3.1.jar`
For **Mac/Linux** users:
```sh
-wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.0/openapi-generator-cli-3.3.0.jar -O openapi-generator-cli.jar
+wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.1/openapi-generator-cli-3.3.1.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
-Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.0/openapi-generator-cli-3.3.0.jar
+Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.1/openapi-generator-cli-3.3.1.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
diff --git a/Vagrantfile b/Vagrantfile
index 03735a6b6a..3baf531f23 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -6,7 +6,7 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
- config.vm.box = "ubuntu/trusty64"
+ config.vm.box = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |v|
v.name = "openapi-generator"
@@ -23,13 +23,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#Provision
config.vm.provision "shell", inline: <<-SHELL
- sudo touch /var/lib/cloud/instance/locale-check.skip
- sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list'
- sudo apt-cache policy docker-engine
+ sudo apt-get update
+ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
+ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
+ $(lsb_release -cs) stable"
+ sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-cosmic main" > /etc/apt/sources.list.d/docker.list'
sudo apt-get update
sudo apt-get upgrade -y
- sudo apt-get install -y docker-engine
+ sudo apt-get install -y docker-ce
sudo usermod -aG docker vagrant
SHELL
diff --git a/bin/utils/export_docs_generators.sh b/bin/utils/export_docs_generators.sh
index 0068318249..0e1b50998c 100755
--- a/bin/utils/export_docs_generators.sh
+++ b/bin/utils/export_docs_generators.sh
@@ -1,11 +1,11 @@
-#!/bin/sh
+#!/bin/bash
SCRIPT="$0"
-echo "# START SCRIPT: $SCRIPT"
+echo "# START SCRIPT: ${SCRIPT}"
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
-for GENERATOR in $(java -jar $executable list --short | sed -e 's/,/\'$'\n''/g')
+for GENERATOR in $(java -jar ${executable} list --short | sed -e 's/,/\'$'\n''/g')
do
- ./bin/utils/export_generator.sh $GENERATOR
-done
\ No newline at end of file
+ ./bin/utils/export_generator.sh ${GENERATOR}
+done
diff --git a/bin/utils/export_generator.sh b/bin/utils/export_generator.sh
index d23912ae66..918ae306eb 100755
--- a/bin/utils/export_generator.sh
+++ b/bin/utils/export_generator.sh
@@ -1,17 +1,19 @@
-#!/bin/sh
+#!/bin/bash
SCRIPT="$0"
-echo "# START SCRIPT: $SCRIPT"
if [[ "$1" != "" ]]; then
NAME="$1"
+ echo "# START SCRIPT: ${SCRIPT} ${NAME}"
else
- echo "Missing argument. Usage e.g.: ./bin/utils/export-generator.sh jaxrs-jersey"
+ echo "Missing argument to ${SCRIPT}."
+ echo " Usage: ${SCRIPT} generator-name"
+ echo " Example: ${SCRIPT} groovy"
exit 1;
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
-java -jar $executable config-help -g $NAME | sed -e 's/CONFIG OPTIONS/CONFIG OPTIONS for \'$NAME'\'$'\n''/g' > docs/generators/$NAME.md
+java -jar ${executable} config-help -g ${NAME} --named-header -o docs/generators/${NAME}.md
-echo "Back to the [generators list](README.md)" >> docs/generators/$NAME.md
\ No newline at end of file
+echo "Back to the [generators list](README.md)" >> docs/generators/${NAME}.md
diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md
index f0e10ee89a..9a6ff34c6c 100644
--- a/docs/generators/groovy.md
+++ b/docs/generators/groovy.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for groovy
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
configPackage
configuration package for generated code
diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md
index ee6caf04eb..f142ee247b 100644
--- a/docs/generators/java-inflector.md
+++ b/docs/generators/java-inflector.md
@@ -104,4 +104,13 @@ CONFIG OPTIONS for java-inflector
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
Back to the [generators list](README.md)
diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md
index ae07769bc0..b2817e0b7c 100644
--- a/docs/generators/java-msf4j.md
+++ b/docs/generators/java-msf4j.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for java-msf4j
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
implFolder
folder for generated implementation code
diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md
index 0dd350488c..1cab3be93b 100644
--- a/docs/generators/java-pkmst.md
+++ b/docs/generators/java-pkmst.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for java-pkmst
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
groupId
groupId in generated pom.xml
diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md
index b03f80be64..801c965df7 100644
--- a/docs/generators/java-play-framework.md
+++ b/docs/generators/java-play-framework.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for java-play-framework
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
title
server title name or client service name
diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md
index c0af154ee8..facaf3aa83 100644
--- a/docs/generators/java-undertow-server.md
+++ b/docs/generators/java-undertow-server.md
@@ -104,4 +104,13 @@ CONFIG OPTIONS for java-undertow-server
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
Back to the [generators list](README.md)
diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md
index b1a5ca6382..7a2099f101 100644
--- a/docs/generators/java-vertx.md
+++ b/docs/generators/java-vertx.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for java-vertx
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
rxInterface
When specified, API interfaces are generated with RX and methods return Single<> and Comparable. (Default: false)
diff --git a/docs/generators/java.md b/docs/generators/java.md
index 6892d264c7..01942712ab 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for java
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
useRxJava
Whether to use the RxJava adapter with the retrofit2 library. (Default: false)
diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md
index 20e9a3b3e1..6f29fc1086 100644
--- a/docs/generators/jaxrs-cxf-cdi.md
+++ b/docs/generators/jaxrs-cxf-cdi.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for jaxrs-cxf-cdi
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
implFolder
folder for generated implementation code
diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md
index 79677413ac..df9f1d2b8a 100644
--- a/docs/generators/jaxrs-cxf-client.md
+++ b/docs/generators/jaxrs-cxf-client.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for jaxrs-cxf-client
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
useBeanValidation
Use BeanValidation API annotations (Default: false)
diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md
index 580e9f7b01..4fce66ff8d 100644
--- a/docs/generators/jaxrs-cxf.md
+++ b/docs/generators/jaxrs-cxf.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for jaxrs-cxf
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
implFolder
folder for generated implementation code
diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md
index d945cbf911..b4b0d29c76 100644
--- a/docs/generators/jaxrs-jersey.md
+++ b/docs/generators/jaxrs-jersey.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for jaxrs-jersey
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
implFolder
folder for generated implementation code
diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md
index 58069dee7f..d031162a1f 100644
--- a/docs/generators/jaxrs-resteasy-eap.md
+++ b/docs/generators/jaxrs-resteasy-eap.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for jaxrs-resteasy-eap
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
implFolder
folder for generated implementation code
diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md
index d0ce94efa1..56db591b47 100644
--- a/docs/generators/jaxrs-resteasy.md
+++ b/docs/generators/jaxrs-resteasy.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for jaxrs-resteasy
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
implFolder
folder for generated implementation code
diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md
index ac8041b97e..1c9a9cf12d 100644
--- a/docs/generators/jaxrs-spec.md
+++ b/docs/generators/jaxrs-spec.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for jaxrs-spec
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
implFolder
folder for generated implementation code
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 17886ab943..ab0e1ad15a 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -104,6 +104,15 @@ CONFIG OPTIONS for spring
booleanGetterPrefix
Set booleanGetterPrefix (default value 'get')
+ parentGroupId
+ parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentArtifactId
+ parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
+ parentVersion
+ parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
+
title
server title name or client service name
diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml
index c7ee2f5275..40621f3614 100644
--- a/modules/openapi-generator-cli/pom.xml
+++ b/modules/openapi-generator-cli/pom.xml
@@ -38,7 +38,7 @@
org.apache.maven.pluginsmaven-shade-plugin
- 2.3
+ 3.2.0process-resources
diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java
index b6c4f9b89b..4a5cb6bb62 100644
--- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java
+++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java
@@ -26,6 +26,9 @@ import org.openapitools.codegen.GeneratorNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
+
import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
@@ -42,6 +45,16 @@ public class ConfigHelp implements Runnable {
description = "generator to get config help for")
private String generatorName;
+ @Option(name = {"--named-header"}, title = "named header",
+ description = "Header includes the generator name, for clarity in output")
+ private Boolean namedHeader;
+
+ @Option(name = {"-o", "--output"}, title = "output location",
+ description = "Optionally write help to this location, otherwise default is standard output")
+ private String outputFile;
+
+ private String newline = System.lineSeparator();
+
@Override
public void run() {
@@ -57,19 +70,47 @@ public class ConfigHelp implements Runnable {
}
try {
+ StringBuilder sb = new StringBuilder();
CodegenConfig config = CodegenConfigLoader.forName(generatorName);
- System.out.println();
- System.out.println("CONFIG OPTIONS");
- for (CliOption langCliOption : config.cliOptions()) {
- System.out.println("\t" + langCliOption.getOpt());
- System.out.println("\t "
- + langCliOption.getOptionHelp().replaceAll("\n", System.lineSeparator() + "\t "));
- System.out.println();
+
+ generatePlainTextHelp(sb, config);
+
+ if (!isEmpty(outputFile)) {
+ File out = new File(outputFile);
+ //noinspection ResultOfMethodCallIgnored
+ out.mkdirs();
+
+ Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), StandardCharsets.UTF_8));
+
+ writer.write(sb.toString());
+ writer.close();
+ } else {
+ System.out.print(sb.toString());
}
} catch (GeneratorNotFoundException e) {
System.err.println(e.getMessage());
System.err.println("[error] Check the spelling of the generator's name and try again.");
System.exit(1);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void generatePlainTextHelp(StringBuilder sb, CodegenConfig config) {
+ sb.append(newline);
+ sb.append("CONFIG OPTIONS");
+ if (Boolean.TRUE.equals(namedHeader)) {
+ sb.append(" for ").append(generatorName).append(newline);
+ }
+
+ sb.append(newline);
+
+ for (CliOption langCliOption : config.cliOptions()) {
+ sb.append("\t").append(langCliOption.getOpt());
+ sb.append(newline);
+ sb.append("\t ").append(langCliOption.getOptionHelp().replaceAll("\n", System.lineSeparator() + "\t "));
+ sb.append(newline);
+ sb.append(newline);
}
}
}
diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java
index ae3613c41a..a19dcf06c9 100644
--- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java
+++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java
@@ -208,6 +208,9 @@ public class Generate implements Runnable {
+ " Useful for piping the JSON output of debug options (e.g. `-DdebugOperations`) to an external parser directly while testing a generator.")
private Boolean logToStderr;
+ @Option(name = {"--enable-post-process-file"}, title = "enable post-process file", description = CodegenConstants.ENABLE_POST_PROCESS_FILE)
+ private Boolean enablePostProcessFile;
+
@Override
public void run() {
if (logToStderr != null) {
@@ -329,6 +332,10 @@ public class Generate implements Runnable {
configurator.setRemoveOperationIdPrefix(removeOperationIdPrefix);
}
+ if (enablePostProcessFile != null) {
+ configurator.setEnablePostProcessFile(enablePostProcessFile);
+ }
+
applySystemPropertiesKvpList(systemProperties, configurator);
applyInstantiationTypesKvpList(instantiationTypes, configurator);
applyImportMappingsKvpList(importMappings, configurator);
diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc
index 683a6d010b..ebe411abb5 100644
--- a/modules/openapi-generator-gradle-plugin/README.adoc
+++ b/modules/openapi-generator-gradle-plugin/README.adoc
@@ -48,7 +48,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.0"
+ classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.1"
}
}
diff --git a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
index 1a26d00685..7e3739c46a 100644
--- a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
+++ b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-rc-1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml
index aea40eb95b..5311fba46a 100644
--- a/modules/openapi-generator-gradle-plugin/pom.xml
+++ b/modules/openapi-generator-gradle-plugin/pom.xml
@@ -15,6 +15,7 @@
true
+ 4.10.2
@@ -54,7 +55,7 @@
gradle-maven-plugin1.0.8
- 4.10-rc-1
+ ${gradleVersion}-P openApiGeneratorVersion=${project.version}
@@ -76,6 +77,13 @@
+
+
+ org.gradle
+ gradle-tooling-api
+ ${gradleVersion}
+
+
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
index 92605e6d18..f05264d9b5 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
@@ -17,5 +17,5 @@ gradle generateGoWithInvalidSpec
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
```bash
-gradle -PopenApiGeneratorVersion=3.3.0 openApiValidate
+gradle -PopenApiGeneratorVersion=3.3.1 openApiValidate
```
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
index e5cea0361c..b4627afc3c 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
@@ -1 +1 @@
-openApiGeneratorVersion=3.3.0
+openApiGeneratorVersion=3.3.1
diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md
index bb65879a7e..18055978fc 100644
--- a/modules/openapi-generator-maven-plugin/README.md
+++ b/modules/openapi-generator-maven-plugin/README.md
@@ -11,7 +11,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
org.openapitoolsopenapi-generator-maven-plugin
- 3.3.0
+ 3.3.1
diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml
index b0ed6a03ff..878382a5ad 100644
--- a/modules/openapi-generator-maven-plugin/examples/java-client.xml
+++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml
@@ -12,7 +12,7 @@
org.openapitoolsopenapi-generator-maven-plugin
- 3.3.0
+ 3.3.1
diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml
index 797a793fa7..fdc8a4bf90 100644
--- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml
+++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml
@@ -12,7 +12,7 @@
org.openapitoolsopenapi-generator-maven-plugin
- 3.3.0
+ 3.3.1
diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml
index 7963f52906..880f2be04d 100644
--- a/modules/openapi-generator-maven-plugin/examples/non-java.xml
+++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml
@@ -12,7 +12,7 @@
org.openapitoolsopenapi-generator-maven-plugin
- 3.3.0
+ 3.3.1
diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml
index a290396759..8e41ee9c83 100644
--- a/modules/openapi-generator-maven-plugin/pom.xml
+++ b/modules/openapi-generator-maven-plugin/pom.xml
@@ -11,9 +11,6 @@
openapi-generator (maven-plugin)maven-pluginmaven plugin to build modules from OpenAPI Generator
-
- 3.2.5
- UTF-8
@@ -62,7 +59,7 @@
org.apache.maven.pluginsmaven-plugin-plugin
- 3.5.1
+ 3.5.2true
diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml
index 2d08fb289e..b4cd8ee722 100644
--- a/modules/openapi-generator/pom.xml
+++ b/modules/openapi-generator/pom.xml
@@ -44,7 +44,7 @@
org.codehaus.mojoexec-maven-plugin
- 1.5.0
+ 1.6.0
@@ -81,7 +81,7 @@
org.apache.maven.pluginsmaven-jar-plugin
- 3.0.2
+ 3.1.0
@@ -103,7 +103,7 @@
org.apache.maven.pluginsmaven-site-plugin
- 3.5.1
+ 3.7.1org.apache.maven.plugins
@@ -174,7 +174,7 @@
org.apache.maven.pluginsmaven-jxr-plugin
- 2.5
+ 3.0.0true
@@ -182,7 +182,7 @@
org.apache.maven.pluginsmaven-project-info-reports-plugin
- 2.9
+ 3.0.0
@@ -195,7 +195,7 @@
1.3.0
- 20.0
+ 26.0-jre
@@ -270,12 +270,12 @@
com.atlassian.commonmarkcommonmark
- 0.9.0
+ 0.11.0org.mockitomockito-core
- 2.8.47
+ 2.23.0test
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
index a89e849944..275d12205b 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
@@ -257,4 +257,8 @@ public interface CodegenConfig {
void postProcessFile(File file, String fileType);
+ boolean isEnablePostProcessFile();
+
+ public void setEnablePostProcessFile(boolean isEnablePostProcessFile);
+
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
index 30695d3a3f..7bcfb84353 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
@@ -182,6 +182,7 @@ public class CodegenConstants {
public static final String DOTNET_FRAMEWORK_DESC = "The target .NET framework version.";
public static enum MODEL_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original}
+
public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original, UPPERCASE}
public static final String ENUM_PROPERTY_NAMING = "enumPropertyNaming";
@@ -265,4 +266,16 @@ public class CodegenConstants {
public static final String DATABASE_ADAPTER = "databaseAdapter";
public static final String DATABASE_ADAPTER_DESC = "The adapter for database (e.g. mysql, sqlite). Default: sqlite";
-}
+ public static final String PARENT_GROUP_ID = "parentGroupId";
+ public static final String PARENT_GROUP_ID_DESC = "parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect";
+
+ public static final String PARENT_ARTIFACT_ID = "parentArtifactId";
+ public static final String PARENT_ARTIFACT_ID_DESC = "parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect";
+
+ public static final String PARENT_VERSION = "parentVersion";
+ public static final String PARENT_VERSION_DESC = "parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect";
+
+ public static final String ENABLE_POST_PROCESS_FILE = "enablePostProcessFile";
+ public static final String ENABLE_POST_PROCESS_FILE_DESC = "Enable post-processing file using environment variables.";
+
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
index 8ddbb41197..3e5cef4385 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
@@ -133,8 +133,10 @@ public class DefaultCodegen implements CodegenConfig {
protected Boolean prependFormOrBodyParameters = false;
// The extension of the generated documentation files (defaults to markdown .md)
protected String docExtension;
-
protected String ignoreFilePathOverride;
+ // flag to indicate whether to use environment variable to post process file
+ protected boolean enablePostProcessFile = false;
+
public List cliOptions() {
return cliOptions;
@@ -196,6 +198,11 @@ public class DefaultCodegen implements CodegenConfig {
this.setDocExtension(String.valueOf(additionalProperties
.get(CodegenConstants.DOCEXTENSION).toString()));
}
+
+ if (additionalProperties.containsKey(CodegenConstants.ENABLE_POST_PROCESS_FILE)) {
+ this.setEnablePostProcessFile(Boolean.valueOf(additionalProperties
+ .get(CodegenConstants.ENABLE_POST_PROCESS_FILE).toString()));
+ }
}
// override with any special post-processing for all models
@@ -239,6 +246,7 @@ public class DefaultCodegen implements CodegenConfig {
parent.setChildren(new ArrayList());
}
parent.getChildren().add(cm);
+ parent.hasChildren = true;
if (parent.getDiscriminator() == null) {
parent = allModels.get(parent.getParent());
} else {
@@ -1771,10 +1779,7 @@ public class DefaultCodegen implements CodegenConfig {
property.title = p.getTitle();
property.getter = toGetter(name);
property.setter = toSetter(name);
- String example = toExampleValue(p);
- if (!"null".equals(example)) {
- property.example = example;
- }
+ property.example = toExampleValue(p);
property.defaultValue = toDefaultValue(p);
property.defaultValueWithParam = toDefaultValueWithParam(name, p);
property.jsonSchema = Json.pretty(p);
@@ -2743,9 +2748,8 @@ public class DefaultCodegen implements CodegenConfig {
}
// set default value
- if (parameterSchema.getDefault() != null) {
- codegenParameter.defaultValue = toDefaultValue(parameterSchema);
- }
+ codegenParameter.defaultValue = toDefaultValue(parameterSchema);
+
// TDOO revise collectionFormat
String collectionFormat = null;
if (ModelUtils.isArraySchema(parameterSchema)) { // for array parameter
@@ -4215,12 +4219,12 @@ public class DefaultCodegen implements CodegenConfig {
protected String getParentName(ComposedSchema composedSchema, Map allSchemas) {
if (composedSchema.getAllOf() != null && !composedSchema.getAllOf().isEmpty()) {
- Schema schema = composedSchema.getAllOf().get(0);
- String ref = schema.get$ref();
- if (StringUtils.isBlank(ref)) {
- return null;
+ for (Schema schema : composedSchema.getAllOf()) {
+ String ref = schema.get$ref();
+ if (!StringUtils.isBlank(ref)) {
+ return ModelUtils.getSimpleRef(ref);
+ }
}
- return ModelUtils.getSimpleRef(ref);
}
return null;
}
@@ -4703,4 +4707,23 @@ public class DefaultCodegen implements CodegenConfig {
public void postProcessFile(File file, String fileType) {
LOGGER.debug("Post processing file {} ({})", file, fileType);
}
+
+ /**
+ * Boolean value indicating the state of the option for post-processing file using envirionment variables.
+ *
+ * @return true if the option is enabled
+ */
+ public boolean isEnablePostProcessFile() {
+ return enablePostProcessFile;
+ }
+
+ /**
+ * Set the boolean value indicating the state of the option for post-processing file using envirionment variables.
+ *
+ * @param enablePostProcessFile true to enable post-processing file
+ */
+ public void setEnablePostProcessFile(boolean enablePostProcessFile) {
+ this.enablePostProcessFile = enablePostProcessFile;
+ }
+
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
index 6efd0deecb..a18fffa358 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
@@ -273,7 +273,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
File written = processTemplateToFile(models, templateName, filename);
if (written != null) {
files.add(written);
- config.postProcessFile(written, "model-test");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(written, "model-test");
+ }
}
}
}
@@ -290,7 +292,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
File written = processTemplateToFile(models, templateName, filename);
if (written != null) {
files.add(written);
- config.postProcessFile(written, "model-doc");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(written, "model-doc");
+ }
}
}
}
@@ -306,7 +310,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
File written = processTemplateToFile(models, templateName, filename);
if (written != null) {
files.add(written);
- config.postProcessFile(written, "model");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(written, "model");
+ }
}
}
}
@@ -552,7 +558,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
File written = processTemplateToFile(operation, templateName, filename);
if (written != null) {
files.add(written);
- config.postProcessFile(written, "api");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(written, "api");
+ }
}
}
@@ -569,7 +577,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
File written = processTemplateToFile(operation, templateName, filename);
if (written != null) {
files.add(written);
- config.postProcessFile(written, "api-test");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(written, "api-test");
+ }
}
}
}
@@ -587,7 +597,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
File written = processTemplateToFile(operation, templateName, filename);
if (written != null) {
files.add(written);
- config.postProcessFile(written, "api-doc");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(written, "api-doc");
+ }
}
}
}
@@ -660,7 +672,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
writeToFile(outputFilename, tmpl.execute(bundle));
File written = new File(outputFilename);
files.add(written);
- config.postProcessFile(written, "supporting-mustache");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(written, "supporting-mustache");
+ }
} else {
InputStream in = null;
@@ -674,7 +688,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
}
File outputFile = writeInputStreamToFile(outputFilename, in, templateFile);
files.add(outputFile);
- config.postProcessFile(outputFile, "supporting-common");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(outputFile, "supporting-common");
+ }
}
} else {
LOGGER.info("Skipped generation of " + outputFilename + " due to rule in .openapi-generator-ignore");
@@ -698,7 +714,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
throw new RuntimeException("Could not generate supporting file '" + openapiGeneratorIgnore + "'", e);
}
files.add(ignoreFile);
- config.postProcessFile(ignoreFile, "openapi-generator-ignore");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(ignoreFile, "openapi-generator-ignore");
+ }
}
if (generateMetadata) {
@@ -707,7 +725,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
try {
writeToFile(versionMetadata, ImplementationVersion.read());
files.add(versionMetadataFile);
- config.postProcessFile(ignoreFile, "openapi-generator-version");
+ if (config.isEnablePostProcessFile()) {
+ config.postProcessFile(ignoreFile, "openapi-generator-version");
+ }
} catch (IOException e) {
throw new RuntimeException("Could not generate supporting file '" + versionMetadata + "'", e);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java
index a1993a6d96..36399cd8b8 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java
@@ -96,6 +96,7 @@ public class CodegenConfigurator implements Serializable {
private boolean skipOverwrite;
private boolean removeOperationIdPrefix;
private boolean validateSpec;
+ private boolean enablePostProcessFile;
private String templateDir;
private String auth;
private String apiPackage;
@@ -210,6 +211,15 @@ public class CodegenConfigurator implements Serializable {
return this;
}
+ public boolean getEnablePostProcessFile() {
+ return enablePostProcessFile;
+ }
+
+ public CodegenConfigurator setEnablePostProcessFile(boolean enablePostProcessFile) {
+ this.enablePostProcessFile = enablePostProcessFile;
+ return this;
+ }
+
public String getModelNameSuffix() {
return modelNameSuffix;
}
@@ -503,6 +513,7 @@ public class CodegenConfigurator implements Serializable {
config.setSkipOverwrite(skipOverwrite);
config.setIgnoreFilePathOverride(ignoreFileOverride);
config.setRemoveOperationIdPrefix(removeOperationIdPrefix);
+ config.setEnablePostProcessFile(enablePostProcessFile);
config.instantiationTypes().putAll(instantiationTypes);
config.typeMapping().putAll(typeMappings);
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java
index 2e99417e93..305453319c 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java
@@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
import com.google.common.collect.ImmutableMap;
import com.samskivert.mustache.Mustache;
import io.swagger.v3.core.util.Json;
+import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.utils.*;
@@ -213,6 +214,10 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
public void processOpts() {
super.processOpts();
+ if (StringUtils.isEmpty(System.getenv("CSHARP_POST_PROCESS_FILE"))) {
+ LOGGER.info("Environment variable CSHARP_POST_PROCESS_FILE not defined so the C# code may not be properly formatted by uncrustify (0.66 or later) or other code formatter. To define it, try `export CSHARP_POST_PROCESS_FILE=\"/usr/local/bin/uncrustify --no-backup\" && export UNCRUSTIFY_CONFIG=/path/to/uncrustify-rules.cfg` (Linux/Mac). Note: replace /path/to with the location of uncrustify-rules.cfg");
+ }
+
// {{packageVersion}}
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) {
setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION));
@@ -422,8 +427,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
var.allowableValues = refModel.allowableValues;
var.isEnum = true;
- updateCodegenPropertyEnum(var);
-
// We do these after updateCodegenPropertyEnum to avoid generalities that don't mesh with C#.
var.isPrimitiveType = true;
}
@@ -1015,6 +1018,33 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
} else if (Boolean.TRUE.equals(codegenParameter.isString)) {
codegenParameter.example = codegenParameter.paramName + "_example";
}
+ }
+ @Override
+ public void postProcessFile(File file, String fileType) {
+ if (file == null) {
+ return;
+ }
+
+ String csharpPostProcessFile = System.getenv("CSHARP_POST_PROCESS_FILE");
+ if (StringUtils.isEmpty(csharpPostProcessFile)) {
+ return; // skip if CSHARP_POST_PROCESS_FILE env variable is not defined
+ }
+
+ // only process files with .cs extension
+ if ("cs".equals(FilenameUtils.getExtension(file.toString()))) {
+ String command = csharpPostProcessFile + " " + file.toString();
+ try {
+ Process p = Runtime.getRuntime().exec(command);
+ int exitValue = p.waitFor();
+ if (exitValue != 0) {
+ LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
+ } else {
+ LOGGER.info("Successfully executed: " + command);
+ }
+ } catch (Exception e) {
+ LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
+ }
+ }
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
index ed83be48a3..595df4ebd7 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
@@ -105,6 +105,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected boolean disableHtmlEscaping = false;
protected String booleanGetterPrefix = BOOLEAN_GETTER_PREFIX_DEFAULT;
protected boolean useNullForUnknownEnumValue = false;
+ protected String parentGroupId = "";
+ protected String parentArtifactId = "";
+ protected String parentVersion = "";
+ protected boolean parentOverridden = false;
public AbstractJavaCodegen() {
super();
@@ -198,6 +202,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)"));
cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix (default value '" + BOOLEAN_GETTER_PREFIX_DEFAULT + "')"));
+
+ cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC));
+ cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC));
+ cliOptions.add(CliOption.newString(CodegenConstants.PARENT_VERSION, CodegenConstants.PARENT_VERSION_DESC));
}
@Override
@@ -375,6 +383,22 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
this.setWithXml(Boolean.valueOf(additionalProperties.get(WITH_XML).toString()));
}
additionalProperties.put(WITH_XML, withXml);
+
+ if (additionalProperties.containsKey(CodegenConstants.PARENT_GROUP_ID)) {
+ this.setParentGroupId((String) additionalProperties.get(CodegenConstants.PARENT_GROUP_ID));
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.PARENT_ARTIFACT_ID)) {
+ this.setParentArtifactId((String) additionalProperties.get(CodegenConstants.PARENT_ARTIFACT_ID));
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.PARENT_VERSION)) {
+ this.setParentVersion((String) additionalProperties.get(CodegenConstants.PARENT_VERSION));
+ }
+
+ if (!StringUtils.isEmpty(parentGroupId) && !StringUtils.isEmpty(parentArtifactId) && !StringUtils.isEmpty(parentVersion)) {
+ additionalProperties.put("parentOverridden", true);
+ }
// make api and model doc path available in mustache template
additionalProperties.put("apiDocPath", apiDocPath);
@@ -754,7 +778,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return p.getDefault().toString();
}
}
- return "null";
+ return null;
} else if (ModelUtils.isNumberSchema(p)) {
if (p.getDefault() != null) {
if (SchemaTypeUtil.FLOAT_FORMAT.equals(p.getFormat())) {
@@ -763,12 +787,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return p.getDefault().toString() + "d";
}
}
- return "null";
+ return null;
} else if (ModelUtils.isBooleanSchema(p)) {
if (p.getDefault() != null) {
return p.getDefault().toString();
}
- return "null";
+ return null;
} else if (ModelUtils.isStringSchema(p)) {
if (p.getDefault() != null) {
String _default = (String) p.getDefault();
@@ -779,7 +803,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return _default;
}
}
- return "null";
+ return null;
}
return super.toDefaultValue(p);
}
@@ -840,7 +864,18 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
if (example == null) {
example = "null";
} else if (Boolean.TRUE.equals(p.isListContainer)) {
- example = "Arrays.asList(" + example + ")";
+
+ if (p.items.defaultValue != null) {
+ String innerExample;
+ if ("String".equals(p.items.dataType)) {
+ innerExample = "\"" + p.items.defaultValue + "\"";
+ } else {
+ innerExample = p.items.defaultValue;
+ }
+ example = "Arrays.asList(" + innerExample + ")";
+ } else {
+ example = "Arrays.asList()";
+ }
} else if (Boolean.TRUE.equals(p.isMapContainer)) {
example = "new HashMap()";
}
@@ -853,7 +888,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
if (p.getExample() != null) {
return escapeText(p.getExample().toString());
} else {
- return super.toExampleValue(p);
+ return null;
}
}
@@ -1347,4 +1382,19 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return tag;
}
+ public void setParentGroupId(final String parentGroupId) {
+ this.parentGroupId = parentGroupId;
+ }
+
+ public void setParentArtifactId(final String parentArtifactId) {
+ this.parentArtifactId = parentArtifactId;
+ }
+
+ public void setParentVersion(final String parentVersion) {
+ this.parentVersion = parentVersion;
+ }
+
+ public void setParentOverridden(final boolean parentOverridden) {
+ this.parentOverridden = parentOverridden;
+ }
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java
index 2a57b92745..42f5d8a54b 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java
@@ -85,7 +85,7 @@ abstract class AbstractRubyCodegen extends DefaultCodegen implements CodegenConf
super.processOpts();
if (StringUtils.isEmpty(System.getenv("RUBY_POST_PROCESS_FILE"))) {
- LOGGER.info("Hint: Environment variable 'RUBY_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export RUBY_POST_PROCESS_FILE=/usr/local/bin/rubocop -a' (Linux/Mac)");
+ LOGGER.info("Hint: Environment variable 'RUBY_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export RUBY_POST_PROCESS_FILE=\"/usr/local/bin/rubocop -a\"' (Linux/Mac)");
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java
index 028eee1467..d56f614512 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java
@@ -25,15 +25,19 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.utils.ModelUtils;
+import org.slf4j.LoggerFactory;
import io.swagger.v3.oas.models.media.*;
public class CppRestbedServerCodegen extends AbstractCppCodegen {
+ private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(CppRestbedServerCodegen.class);
+
public static final String DECLSPEC = "declspec";
public static final String DEFAULT_INCLUDE = "defaultInclude";
@@ -287,25 +291,63 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
@Override
public String toDefaultValue(Schema p) {
if (ModelUtils.isStringSchema(p)) {
- return "\"\"";
+ if (p.getDefault() != null) {
+ return "\"" + p.getDefault().toString() + "\"";
+ } else {
+ return "\"\"";
+ }
} else if (ModelUtils.isBooleanSchema(p)) {
- return "false";
+ if (p.getDefault() != null) {
+ return p.getDefault().toString();
+ } else {
+ return "false";
+ }
} else if (ModelUtils.isDateSchema(p)) {
- return "\"\"";
+ if (p.getDefault() != null) {
+ return "\"" + p.getDefault().toString() + "\"";
+ } else {
+ return "\"\"";
+ }
} else if (ModelUtils.isDateTimeSchema(p)) {
- return "\"\"";
+ if (p.getDefault() != null) {
+ return "\"" + p.getDefault().toString() + "\"";
+ } else {
+ return "\"\"";
+ }
} else if (ModelUtils.isNumberSchema(p)) {
- if (ModelUtils.isFloatSchema(p)) {
- return "0.0f";
+ if (ModelUtils.isFloatSchema(p)) { // float
+ if (p.getDefault() != null) {
+ return p.getDefault().toString() + "f";
+ } else {
+ return "0.0f";
+ }
+ } else { // double
+ if (p.getDefault() != null) {
+ return p.getDefault().toString();
+ } else {
+ return "0.0";
+ }
}
- return "0.0";
} else if (ModelUtils.isIntegerSchema(p)) {
- if (ModelUtils.isLongSchema(p)) {
- return "0L";
+ if (ModelUtils.isLongSchema(p)) { // long
+ if (p.getDefault() != null) {
+ return p.getDefault().toString() + "L";
+ } else {
+ return "0L";
+ }
+ } else { // integer
+ if (p.getDefault() != null) {
+ return p.getDefault().toString();
+ } else {
+ return "0";
+ }
}
- return "0";
} else if (ModelUtils.isByteArraySchema(p)) {
- return "\"\"";
+ if (p.getDefault() != null) {
+ return "\"" + p.getDefault().toString() + "\"";
+ } else {
+ return "\"\"";
+ }
} else if (ModelUtils.isMapSchema(p)) {
String inner = getSchemaType(ModelUtils.getAdditionalProperties(p));
return "std::map()";
@@ -319,6 +361,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
} else if (!StringUtils.isEmpty(p.get$ref())) {
return "new " + toModelName(ModelUtils.getSimpleRef(p.get$ref())) + "()";
}
+
return "nullptr";
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
index 8a2dab859b..ab94690dd8 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
@@ -232,8 +232,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
}
super.processOpts();
- if (StringUtils.isEmpty(System.getenv("JS_BEAUTIFY_PATH"))) {
- LOGGER.info("Environment variable JS_BEAUTIFY_PATH not defined so the JS code may not be properly formatted. To define it, try 'export JS_BEAUTIFY_PATH=/usr/local/bin/js-beautify' (Linux/Mac)");
+ if (StringUtils.isEmpty(System.getenv("JS_POST_PROCESS_FILE"))) {
+ LOGGER.info("Environment variable JS_POST_PROCESS_FILE not defined so the JS code may not be properly formatted. To define it, try 'export JS_POST_PROCESS_FILE=\"/usr/local/bin/js-beautify -r -f\"' (Linux/Mac)");
}
if (additionalProperties.containsKey(PROJECT_NAME)) {
@@ -1167,19 +1167,20 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
return;
}
- String jsBeautifyPath = System.getenv("JS_BEAUTIFY_PATH");
- if (StringUtils.isEmpty(jsBeautifyPath)) {
- return; // skip if JS_BEAUTIFY_PATH env variable is not defined
+ String jsPostProcessFile = System.getenv("JS_POST_PROCESS_FILE");
+ if (StringUtils.isEmpty(jsPostProcessFile)) {
+ return; // skip if JS_POST_PROCESS_FILE env variable is not defined
}
// only process files with js extension
if ("js".equals(FilenameUtils.getExtension(file.toString()))) {
- String command = jsBeautifyPath + " -r -f " + file.toString();
+ String command = jsPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
- if (p.exitValue() != 0) {
- LOGGER.error("Error running the command ({}). Exit code: {}", command, p.exitValue());
+ int exitValue = p.exitValue();
+ if (exitValue != 0) {
+ LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
}
LOGGER.info("Successfully executed: " + command);
} catch (Exception e) {
@@ -1187,5 +1188,4 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
}
}
}
-
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java
index 5a2397684f..f2c52611a2 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java
@@ -133,8 +133,8 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
public void processOpts() {
super.processOpts();
- if (StringUtils.isEmpty(System.getenv("PERLTIDY_PATH"))) {
- LOGGER.info("Environment variable PERLTIDY_PATH not defined so the Perl code may not be properly formatted. To define it, try 'export PERLTIDY_PATH=/usr/local/bin/perltidy' (Linux/Mac)");
+ if (StringUtils.isEmpty(System.getenv("PERL_POST_PROCESS_FILE"))) {
+ LOGGER.info("Environment variable PERL_POST_PROCESS_FILE not defined so the Perl code may not be properly formatted. To define it, try 'export PERL_POST_PROCESS_FILE=/usr/local/bin/perltidy -b -bext=\"/\"' (Linux/Mac)");
}
if (additionalProperties.containsKey(MODULE_VERSION)) {
@@ -571,9 +571,9 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
return;
}
- String perlTidyPath = System.getenv("PERLTIDY_PATH");
+ String perlTidyPath = System.getenv("PERL_POST_PROCESS_FILE");
if (StringUtils.isEmpty(perlTidyPath)) {
- return; // skip if PERLTIDY_PATH env variable is not defined
+ return; // skip if PERL_POST_PROCESS_FILE env variable is not defined
}
// only process files with .t, .pm extension
@@ -583,11 +583,12 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
String command = perlTidyPath + " -b -bext='/' " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
- p.waitFor();
- if (p.exitValue() != 0) {
- LOGGER.error("Error running the command ({}). Exit code: {}", command, p.exitValue());
+ int exitValue = p.waitFor();
+ if (exitValue != 0) {
+ LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
+ } else {
+ LOGGER.info("Successfully executed: " + command);
}
- LOGGER.info("Successfully executed: " + command);
} catch (Exception e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java
index 8271613666..f29b757f0c 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java
@@ -318,8 +318,7 @@ public class PythonFlaskConnexionServerCodegen extends DefaultCodegen implements
@Override
public void preprocessOpenAPI(OpenAPI openAPI) {
- // need vendor extensions for x-swagger-router-controller
- // can be changed to x-openapi-router-controller when https://github.com/zalando/connexion/issues/683 is done
+ // need vendor extensions for x-openapi-router-controller
Map paths = openAPI.getPaths();
if (paths != null) {
for (String pathname : paths.keySet()) {
@@ -337,9 +336,9 @@ public class PythonFlaskConnexionServerCodegen extends DefaultCodegen implements
operationId = getOrGenerateOperationId(operation, pathname, method.toString());
}
operation.setOperationId(toOperationId(operationId));
- if (operation.getExtensions() == null || operation.getExtensions().get("x-swagger-router-controller") == null) {
+ if (operation.getExtensions() == null || operation.getExtensions().get("x-openapi-router-controller") == null) {
operation.addExtension(
- "x-swagger-router-controller",
+ "x-openapi-router-controller",
controllerPackage + "." + toApiFilename(tag)
);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
index 4b41f4bf64..78b7075c66 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
@@ -221,6 +221,8 @@ public class SpringCodegen extends AbstractJavaCodegen
if (additionalProperties.containsKey(ASYNC)) {
this.setAsync(Boolean.valueOf(additionalProperties.get(ASYNC).toString()));
+ //fix for issue/1164
+ convertPropertyToBooleanAndWriteBack(ASYNC);
}
if (additionalProperties.containsKey(REACTIVE)) {
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java
index 17ad3c37e7..5704ce5fbd 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java
@@ -472,7 +472,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
@Override
public String toModelFilename(String name) {
- return this.convertUsingFileNamingConvention(name) + modelFileSuffix;
+ return this.sanitizeName(this.convertUsingFileNamingConvention(name) + modelFileSuffix);
}
@Override
diff --git a/modules/openapi-generator/src/main/resources/Java/api.mustache b/modules/openapi-generator/src/main/resources/Java/api.mustache
index 17f8d56ac6..2b1ecb4ab6 100644
--- a/modules/openapi-generator/src/main/resources/Java/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/api.mustache
@@ -46,7 +46,7 @@ public class {{classname}} {
* {{summary}}
* {{notes}}
{{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}}
{{/allParams}}
{{#returnType}}
* @return {{returnType}}
diff --git a/modules/openapi-generator/src/main/resources/Java/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/api_doc.mustache
index bbb5b66f84..7ddb195340 100644
--- a/modules/openapi-generator/src/main/resources/Java/api_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/api_doc.mustache
@@ -62,7 +62,7 @@ try {
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
-{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}
+{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}
{{/allParams}}
### Return type
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache
index dea8a6e8ae..b446223ba5 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache
@@ -25,7 +25,7 @@ public interface {{classname}} extends ApiClient.Api {
* {{summary}}
* {{notes}}
{{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}
{{/allParams}}
{{#returnType}}
* @return {{returnType}}
@@ -55,14 +55,14 @@ public interface {{classname}} extends ApiClient.Api {
* building up this map in a fluent style.
{{#allParams}}
{{^isQueryParam}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}
{{/isQueryParam}}
{{/allParams}}
* @param queryParams Map of query parameters as name-value pairs
*
The following elements may be specified in the query map:
*
{{#queryParams}}
- *
{{paramName}} - {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
+ *
{{paramName}} - {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}
{{/queryParams}}
*
{{#returnType}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache
index bf74b39c61..32f01e5bb1 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache
index 69aac87b27..7ff969e9c6 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache
index 93f2d9e2c9..57db33547c 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
index 4ba31c8cbc..9775e5b323 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
@@ -54,6 +54,7 @@ import {{invokerPackage}}.auth.HttpBasicAuth;
import {{invokerPackage}}.auth.ApiKeyAuth;
import {{invokerPackage}}.auth.OAuth;
import {{invokerPackage}}.auth.RetryingOAuth;
+import {{invokerPackage}}.auth.OAuthFlow;
public class ApiClient {
@@ -102,7 +103,7 @@ public class ApiClient {
) {
init();
- RetryingOAuth retryingOAuth = new RetryingOAuth("{{tokenUrl}}", clientId, GrantType.valueOf("{{flow}}"), clientSecret, parameters);
+ RetryingOAuth retryingOAuth = new RetryingOAuth("{{tokenUrl}}", clientId, OAuthFlow.{{flow}}, clientSecret, parameters);
authentications.put(
"{{name}}",
retryingOAuth
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
index 9af817bc27..affaec014b 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
@@ -65,7 +65,7 @@ public class {{classname}} {
{{#operation}}
/**
* Build call for {{operationId}}{{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
@@ -188,7 +188,7 @@ public class {{classname}} {
/**
* {{summary}}
* {{notes}}{{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}}
* @return {{returnType}}{{/returnType}}
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
{{#isDeprecated}}
@@ -210,7 +210,7 @@ public class {{classname}} {
/**
* {{summary}}
* {{notes}}{{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}
* @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
{{#isDeprecated}}
@@ -233,7 +233,7 @@ public class {{classname}} {
/**
* {{summary}} (asynchronously)
* {{notes}}{{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache
index b28169a6f2..4703c2488d 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache
@@ -35,15 +35,14 @@ public class RetryingOAuth extends OAuth implements Interceptor {
public RetryingOAuth(
String tokenUrl,
String clientId,
- GrantType grantType,
+ OAuthFlow flow,
String clientSecret,
Map parameters
) {
this(OAuthClientRequest.tokenLocation(tokenUrl)
.setClientId(clientId)
- .setGrantType(grantType)
.setClientSecret(clientSecret));
-
+ setFlow(flow);
if (parameters != null) {
for (String paramName : parameters.keySet()) {
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
@@ -51,6 +50,25 @@ public class RetryingOAuth extends OAuth implements Interceptor {
}
}
+ public void setFlow(OAuthFlow flow) {
+ switch(flow) {
+ case accessCode:
+ tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE);
+ break;
+ case implicit:
+ tokenRequestBuilder.setGrantType(GrantType.IMPLICIT);
+ break;
+ case password:
+ tokenRequestBuilder.setGrantType(GrantType.PASSWORD);
+ break;
+ case application:
+ tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS);
+ break;
+ default:
+ break;
+ }
+ }
+
@Override
public Response intercept(Chain chain) throws IOException {
return retryingIntercept(chain, true);
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
index e960f01abc..0cff2363ea 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache
index aa0c15d8b3..64285da811 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache
index 540c54c681..2950d3e748 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache
@@ -11,6 +11,13 @@
scm:git:git@github.com:openapitools/openapi-generator.githttps://openapi-generator.tech
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache
index 10d84edafc..95b3f7cb5d 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache
index 155a8128e3..c2a5eeced6 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache
index 3028604c36..29347aee8e 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache
index b8d7e513d6..46687cd0c7 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache
index 4771a9bb65..7fde231769 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache
index 21c21b1ddd..2d08f65d6a 100644
--- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache
@@ -62,7 +62,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache
index 275a5c869a..a2703f141d 100644
--- a/modules/openapi-generator/src/main/resources/Java/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache
@@ -13,6 +13,13 @@
{{scmDeveloperConnection}}{{scmUrl}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache
index a9aa18e6dc..badfdbc35a 100644
--- a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache
@@ -22,7 +22,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache
index 3bb3087a1a..9a79494fbf 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache
@@ -15,7 +15,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}{{/vars}}
{{#vars}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache
index 7daa0a4fbe..c6d73b3dbe 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache
@@ -40,7 +40,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
{{#vars}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache
index 2cff5ee5dc..519ea86e31 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache
@@ -25,7 +25,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache
index f495de6674..0a2d19435b 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache
@@ -12,7 +12,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}};{{/vars}}
{{#vars}}
/**
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache
index 084e8b502c..5fb981e140 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache
@@ -11,7 +11,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
{{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}}
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}};{{/vars}}
{{#vars}}
/**
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache
index ec8264cf8f..264ff89006 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache
@@ -17,7 +17,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
{{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}}
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
- private {{#useBeanValidation}}@Valid{{/useBeanValidation}} {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
+ private {{#useBeanValidation}}@Valid{{/useBeanValidation}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}}
{{#vars}}
/**
diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache
index 1ac8120d76..164bbcea5d 100644
--- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache
@@ -29,7 +29,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache
index c6255465d6..67816edd97 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache
@@ -16,8 +16,10 @@ public class ApiUtil {
{{^reactive}}
public static void setExampleResponse(NativeWebRequest req, String contentType, String example) {
try {
- req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType);
- req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example);
+ HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class);
+ res.setCharacterEncoding("UTF-8");
+ res.addHeader("Content-Type", contentType);
+ res.getWriter().print(example);
} catch (IOException e) {
throw new RuntimeException(e);
}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache
index f97f0ea925..555896e60e 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache
@@ -13,11 +13,20 @@
2.8.0
{{/useSpringfox}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
+{{^parentOverridden}}
org.springframework.bootspring-boot-starter-parent{{#java8}}2.0.1.RELEASE{{/java8}}{{^java8}}1.5.12.RELEASE{{/java8}}
+{{/parentOverridden}}
src/main/java
{{^interfaceOnly}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache
index 52fedbea77..2a3e72fb1c 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache
@@ -1,6 +1,6 @@
package {{package}};
-import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.cloud.openfeign.FeignClient;
import {{configPackage}}.ClientConfiguration;
{{=<% %>=}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache
index 9efcee55a5..7001f56757 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache
@@ -11,11 +11,20 @@
${java.version}1.5.18
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
+{{^parentOverridden}}
org.springframework.bootspring-boot-starter-parent
- 1.5.4.RELEASE
+ 2.0.5.RELEASE
+{{/parentOverridden}}
src/main/java
@@ -25,7 +34,7 @@
org.springframework.cloudspring-cloud-starter-parent
- Dalston.SR1
+ Finchley.SR1pomimport
@@ -40,56 +49,38 @@
org.springframework.cloud
- spring-cloud-starter-feign
+ spring-cloud-starter-openfeignorg.springframework.cloud
- spring-cloud-security
-
-
- org.springframework.security.oauth
- spring-security-oauth2
+ spring-cloud-starter-oauth2
{{#withXml}}
-
com.fasterxml.jackson.dataformatjackson-dataformat-xml
-
{{/withXml}}
{{#java8}}
-
com.fasterxml.jackson.datatypejackson-datatype-jsr310
{{/java8}}
{{#joda}}
-
com.fasterxml.jackson.datatypejackson-datatype-joda
{{/joda}}
{{#threetenbp}}
-
com.github.joschi.jacksonjackson-datatype-threetenbp2.6.4
{{/threetenbp}}
-{{#useBeanValidation}}
-
-
- javax.validation
- validation-api
- 1.1.0.Final
- provided
-
-{{/useBeanValidation}}
org.springframework.bootspring-boot-starter-test
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache
index 5ebe4d2b5c..533ccb9a56 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache
@@ -5,6 +5,13 @@
jar{{artifactId}}{{artifactVersion}}
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
src/main/java
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
index a7545a77f1..a82f2e40f4 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
@@ -31,7 +31,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
diff --git a/modules/openapi-generator/src/main/resources/MSF4J/pojo.mustache b/modules/openapi-generator/src/main/resources/MSF4J/pojo.mustache
index 4a9dfb6a7c..38559db8fb 100644
--- a/modules/openapi-generator/src/main/resources/MSF4J/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/MSF4J/pojo.mustache
@@ -25,7 +25,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache
index 35196da731..ccd81ee02e 100644
--- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache
@@ -75,7 +75,7 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the path params
{{#pathParams}}
{{#isPrimitiveType}}
- const {{{dataType}}} {{{paramName}}} = request->get_path_parameter("{{paramName}}", {{#isString}}""{{/isString}}{{#isInteger}}0{{/isInteger}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0f{{/isFloat}}{{#isDouble}}0.0{{/isDouble}});
+ const {{{dataType}}} {{{paramName}}} = request->get_path_parameter("{{paramName}}", {{{defaultValue}}});
{{/isPrimitiveType}}
{{/pathParams}}
{{/hasPathParams}}
@@ -84,7 +84,7 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the query params
{{#queryParams}}
{{#isPrimitiveType}}
- const {{{dataType}}} {{{paramName}}} = request->get_query_parameter("{{paramName}}", {{#isString}}""{{/isString}}{{#isInteger}}0{{/isInteger}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0f{{/isFloat}}{{#isDouble}}0.0{{/isDouble}});
+ const {{{dataType}}} {{{paramName}}} = request->get_query_parameter("{{paramName}}", {{{defaultValue}}});
{{/isPrimitiveType}}
{{/queryParams}}
{{/hasQueryParams}}
@@ -93,7 +93,7 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the headers
{{#headerParams}}
{{#isPrimitiveType}}
- const {{{dataType}}} {{{paramName}}} = request->get_header("{{paramName}}", {{#isString}}""{{/isString}}{{#isInteger}}0{{/isInteger}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0f{{/isFloat}}{{#isDouble}}0.0{{/isDouble}});
+ const {{{dataType}}} {{{paramName}}} = request->get_header("{{paramName}}", {{{defaultValue}}});
{{/isPrimitiveType}}
{{/headerParams}}
{{/hasHeaderParams}}
@@ -140,7 +140,7 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the path params
{{#pathParams}}
{{#isPrimitiveType}}
- const {{dataType}} {{paramName}} = request->get_path_parameter("{{paramName}}", {{#isString}}""{{/isString}}{{#isInteger}}0{{/isInteger}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0f{{/isFloat}}{{#isDouble}}0.0{{/isDouble}});
+ const {{{dataType}}} {{{paramName}}} = request->get_path_parameter("{{paramName}}", {{{defaultValue}}});
{{/isPrimitiveType}}
{{/pathParams}}
{{/hasPathParams}}
@@ -149,16 +149,16 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the query params
{{#queryParams}}
{{#isPrimitiveType}}
- const {{dataType}} {{paramName}} = request->get_query_parameter("{{paramName}}", {{#isString}}""{{/isString}}{{#isInteger}}0{{/isInteger}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0f{{/isFloat}}{{#isDouble}}0.0{{/isDouble}});
+ const {{{dataType}}} {{{paramName}}} = request->get_query_parameter("{{paramName}}", {{{defaultValue}}});
{{/isPrimitiveType}}
{{/queryParams}}
{{/hasQueryParams}}
-
+
{{#hasHeaderParams}}
// Getting the headers
{{#headerParams}}
{{#isPrimitiveType}}
- const {{dataType}} {{paramName}} = request->get_header("{{paramName}}", {{#isString}}""{{/isString}}{{#isInteger}}0{{/isInteger}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0f{{/isFloat}}{{#isDouble}}0.0{{/isDouble}});
+ const {{{dataType}}} {{{paramName}}} = request->get_header("{{paramName}}", {{{defaultValue}}});
{{/isPrimitiveType}}
{{/headerParams}}
{{/hasHeaderParams}}
diff --git a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache
index 89d35b73ec..c547d137e1 100644
--- a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache
@@ -217,7 +217,7 @@ this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};
{{/generatePropertyChanged}}
{{#validatable}}
-{{#discriminator}}
+{{#hasChildren}}
///
/// To validate all properties of the instance
///
@@ -235,8 +235,8 @@ this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};
/// Validation Result
protected IEnumerable BaseValidate(ValidationContext validationContext)
{
-{{/discriminator}}
-{{^discriminator}}
+{{/hasChildren}}
+{{^hasChildren}}
///
/// To validate all properties of the instance
///
@@ -244,11 +244,11 @@ this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};
/// Validation Result
IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
{
-{{/discriminator}}
+{{/hasChildren}}
{{#parent}}
{{^isArrayModel}}
{{^isMapModel}}
- foreach(var x in BaseValidate(validationContext)) yield return x;
+ foreach(var x in base.BaseValidate(validationContext)) yield return x;
{{/isMapModel}}
{{/isArrayModel}}
{{/parent}}
diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache
index db68c11421..0698e14941 100644
--- a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache
+++ b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache
@@ -12,7 +12,7 @@ class {{classname}} {
{{#description}}
/// {{description}}
{{/description}}
- static const {{classname}} {{name}} = const {{classname}}._internal({{value}});
+ static const {{classname}} {{{name}}}} = const {{classname}}._internal({{{value}}});
{{/enumVars}}
{{/allowableValues}}
}
@@ -29,7 +29,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> {
switch (data) {
{{#allowableValues}}
{{#enumVars}}
- case {{value}}: return {{classname}}.{{name}};
+ case {{{value}}}: return {{classname}}.{{{name}}}};
{{/enumVars}}
{{/allowableValues}}
default: throw('Unknown enum value to decode: $data');
diff --git a/modules/openapi-generator/src/main/resources/dart/enum.mustache b/modules/openapi-generator/src/main/resources/dart/enum.mustache
index debb73bbce..d4a4d2b8d1 100644
--- a/modules/openapi-generator/src/main/resources/dart/enum.mustache
+++ b/modules/openapi-generator/src/main/resources/dart/enum.mustache
@@ -10,7 +10,7 @@ class {{classname}} {
{{#description}}
/// {{description}}
{{/description}}
- static const {{classname}} {{name}} = const {{classname}}._internal({{value}});
+ static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}});
{{/enumVars}}
{{/allowableValues}}
}
@@ -27,7 +27,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> {
switch (data) {
{{#allowableValues}}
{{#enumVars}}
- case {{value}}: return {{classname}}.{{name}};
+ case {{{value}}}: return {{classname}}.{{{name}}};
{{/enumVars}}
{{/allowableValues}}
default: throw('Unknown enum value to decode: $data');
diff --git a/modules/openapi-generator/src/main/resources/dart2/enum.mustache b/modules/openapi-generator/src/main/resources/dart2/enum.mustache
index debb73bbce..d4a4d2b8d1 100644
--- a/modules/openapi-generator/src/main/resources/dart2/enum.mustache
+++ b/modules/openapi-generator/src/main/resources/dart2/enum.mustache
@@ -10,7 +10,7 @@ class {{classname}} {
{{#description}}
/// {{description}}
{{/description}}
- static const {{classname}} {{name}} = const {{classname}}._internal({{value}});
+ static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}});
{{/enumVars}}
{{/allowableValues}}
}
@@ -27,7 +27,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> {
switch (data) {
{{#allowableValues}}
{{#enumVars}}
- case {{value}}: return {{classname}}.{{name}};
+ case {{{value}}}: return {{classname}}.{{{name}}};
{{/enumVars}}
{{/allowableValues}}
default: throw('Unknown enum value to decode: $data');
diff --git a/modules/openapi-generator/src/main/resources/flaskConnexion/requirements.mustache b/modules/openapi-generator/src/main/resources/flaskConnexion/requirements.mustache
index f0b1190a56..3f4f2a782d 100644
--- a/modules/openapi-generator/src/main/resources/flaskConnexion/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/flaskConnexion/requirements.mustache
@@ -1,6 +1,5 @@
-# Install flask-connexion from git branch dev-2.0. Change when connexion 2.0 is released
-git+https://github.com/zalando/connexion.git@35e4e678ef69e703eaf84a48126049808c73b17c#egg=connexion
-swagger-ui-bundle
+connexion == 2.0.0rc3
+swagger-ui-bundle == 0.0.2
python_dateutil == 2.6.0
{{#supportPython2}}
typing == 3.5.2.2
diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache
index d006e1aa05..28ba90cffc 100644
--- a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache
+++ b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache
@@ -19,6 +19,6 @@ const (
type {{classname}} struct {
{{#vars}}{{#description}}
// {{{description}}}{{/description}}
- {{name}} {{^isEnum}}{{^isPrimitiveType}}{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{/isPrimitiveType}}{{/isEnum}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"`
+ {{name}} {{^isEnum}}{{^isPrimitiveType}}{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{/isPrimitiveType}}{{/isEnum}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/vars}}
}{{/isEnum}}{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/go-server/model.mustache b/modules/openapi-generator/src/main/resources/go-server/model.mustache
index d006e1aa05..28ba90cffc 100644
--- a/modules/openapi-generator/src/main/resources/go-server/model.mustache
+++ b/modules/openapi-generator/src/main/resources/go-server/model.mustache
@@ -19,6 +19,6 @@ const (
type {{classname}} struct {
{{#vars}}{{#description}}
// {{{description}}}{{/description}}
- {{name}} {{^isEnum}}{{^isPrimitiveType}}{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{/isPrimitiveType}}{{/isEnum}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"`
+ {{name}} {{^isEnum}}{{^isPrimitiveType}}{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{/isPrimitiveType}}{{/isEnum}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/vars}}
}{{/isEnum}}{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache
index 8b2943af55..19cde5b445 100644
--- a/modules/openapi-generator/src/main/resources/go/api.mustache
+++ b/modules/openapi-generator/src/main/resources/go/api.mustache
@@ -50,14 +50,14 @@ type {{{nickname}}}Opts struct {
{{^required}}
{{#isPrimitiveType}}
{{^isBinary}}
- {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}}
+ {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}}
{{/isBinary}}
{{#isBinary}}
- {{vendorExtensions.x-exportParamName}} optional.Interface
+ {{vendorExtensions.x-exportParamName}} optional.Interface
{{/isBinary}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
- {{vendorExtensions.x-exportParamName}} optional.Interface
+ {{vendorExtensions.x-exportParamName}} optional.Interface
{{/isPrimitiveType}}
{{/required}}
{{/allParams}}
@@ -66,13 +66,13 @@ type {{{nickname}}}Opts struct {
{{/hasOptionalParams}}
func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) {
var (
- localVarHttpMethod = strings.ToUpper("{{httpMethod}}")
+ localVarHttpMethod = strings.ToUpper("{{httpMethod}}")
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
{{#returnType}}
- localVarReturnValue {{{returnType}}}
+ localVarReturnValue {{{returnType}}}
{{/returnType}}
)
@@ -275,7 +275,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
{{#returnType}}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
- err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
+ err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
}
@@ -284,20 +284,20 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
{{/returnType}}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
- body: localVarBody,
+ body: localVarBody,
error: localVarHttpResponse.Status,
}
{{#responses}}
{{#dataType}}
if localVarHttpResponse.StatusCode == {{{code}}} {
var v {{{dataType}}}
- err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
- if err != nil {
- newErr.error = err.Error()
- return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr
- }
- newErr.model = v
+ err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
+ if err != nil {
+ newErr.error = err.Error()
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr
+ }
+ newErr.model = v
+ return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr
}
{{/dataType}}
{{/responses}}
@@ -307,4 +307,4 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, nil
}
{{/operation}}
-{{/operations}}
\ No newline at end of file
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache
index a6aec18485..c4ef64ee2e 100644
--- a/modules/openapi-generator/src/main/resources/go/client.mustache
+++ b/modules/openapi-generator/src/main/resources/go/client.mustache
@@ -188,7 +188,7 @@ func (c *APIClient) prepareRequest(
}
// add form parameters and file if available.
- if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
+ if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
@@ -227,6 +227,16 @@ func (c *APIClient) prepareRequest(
w.Close()
}
+ if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
+ if body != nil {
+ return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
+ }
+ body = &bytes.Buffer{}
+ body.WriteString(formParams.Encode())
+ // Set Content-Length
+ headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
+ }
+
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
@@ -469,4 +479,4 @@ func (e GenericOpenAPIError) Body() []byte {
// Model returns the unpacked model of the error
func (e GenericOpenAPIError) Model() interface{} {
return e.model
-}
\ No newline at end of file
+}
diff --git a/modules/openapi-generator/src/main/resources/go/model.mustache b/modules/openapi-generator/src/main/resources/go/model.mustache
index 4243daa4e2..07e5c75851 100644
--- a/modules/openapi-generator/src/main/resources/go/model.mustache
+++ b/modules/openapi-generator/src/main/resources/go/model.mustache
@@ -35,7 +35,7 @@ type {{classname}} struct {
{{#description}}
// {{{description}}}
{{/description}}
- {{name}} {{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}`
+ {{name}} {{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/vars}}
}
{{/isEnum}}
diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache
index 3e4d988197..5b853d8094 100644
--- a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache
@@ -32,7 +32,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
diff --git a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache
index 528e550d74..9c1a0cc81d 100644
--- a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache
+++ b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache
@@ -39,28 +39,26 @@ class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=4):
# maxsize is number of requests to host that are allowed in parallel
- if configuration.verify_ssl:
-
- # ca_certs
- if configuration.ssl_ca_cert:
- ca_certs = configuration.ssl_ca_cert
- else:
- # if not set certificate file, use Mozilla's root certificates.
- ca_certs = certifi.where()
-
- ssl_context = ssl.create_default_context(cafile=ca_certs)
-
- if configuration.cert_file:
- ssl_context.load_cert_chain(
- configuration.cert_file, keyfile=configuration.key_file
- )
+ # ca_certs
+ if configuration.ssl_ca_cert:
+ ca_certs = configuration.ssl_ca_cert
else:
- ssl_context = None
+ # if not set certificate file, use Mozilla's root certificates.
+ ca_certs = certifi.where()
+
+ ssl_context = ssl.create_default_context(cafile=ca_certs)
+ if configuration.cert_file:
+ ssl_context.load_cert_chain(
+ configuration.cert_file, keyfile=configuration.key_file
+ )
+
+ if not configuration.verify_ssl:
+ ssl_context.check_hostname = False
+ ssl_context.verify_mode = ssl.CERT_NONE
connector = aiohttp.TCPConnector(
limit=maxsize,
- ssl_context=ssl_context,
- verify_ssl=configuration.verify_ssl
+ ssl_context=ssl_context
)
# https pool manager
diff --git a/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache
index f0aa718d9b..b73e259d5a 100644
--- a/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache
+++ b/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache
@@ -36,7 +36,7 @@ object {{classname}} {
{{/operation}}
{{#unknownStatusCodes}}
- ApiInvoker.addCustomStatusCode({{value}}, isSuccess = false)
+ ApiInvoker.addCustomStatusCode({{{value}}}, isSuccess = false)
{{/unknownStatusCodes}}
}
diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache
index d4fc85c13b..7d11e17ea0 100644
--- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache
+++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache
@@ -313,7 +313,7 @@ export interface {{classname}}Interface {
* @throws {RequiredError}
* @memberof {{classname}}Interface
*/
- {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>;
+ {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>;
{{/operation}}
}
diff --git a/modules/openapi-generator/src/main/resources/typescript-node/package.mustache b/modules/openapi-generator/src/main/resources/typescript-node/package.mustache
index 0bd3ae01df..9c2274c846 100644
--- a/modules/openapi-generator/src/main/resources/typescript-node/package.mustache
+++ b/modules/openapi-generator/src/main/resources/typescript-node/package.mustache
@@ -20,7 +20,8 @@
"rewire": "^3.0.2"
},
"devDependencies": {
- "typescript": "^2.4.2"
+ "typescript": "^2.4.2",
+ "@types/node": "8.10.34"
}{{#npmRepository}},
"publishConfig": {
"registry": "{{npmRepository}}"
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
index 9fc3d600f9..2dfe69565e 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
@@ -453,6 +453,16 @@ public class DefaultCodegenTest {
verifyPersonDiscriminator(personModel.discriminator);
}
+ @Test
+ public void testParentName() {
+ final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/allOf.yaml", null, new ParseOptions()).getOpenAPI();
+ DefaultCodegen codegen = new DefaultCodegen();
+
+ Schema child = openAPI.getComponents().getSchemas().get("Child");
+ CodegenModel childModel = codegen.fromModel("Child", child, openAPI.getComponents().getSchemas());
+ Assert.assertEquals(childModel.parentSchema, "Person");
+ }
+
@Test
public void testCallbacks() {
final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/callbacks.yaml", null, new ParseOptions()).getOpenAPI();
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java
index 8a39fece12..2244bfd208 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java
@@ -51,7 +51,7 @@ public class JavaModelEnumTest {
Assert.assertEquals(enumVar.dataType, "String");
Assert.assertEquals(enumVar.datatypeWithEnum, "NameEnum");
Assert.assertEquals(enumVar.name, "name");
- Assert.assertEquals(enumVar.defaultValue, "null");
+ Assert.assertEquals(enumVar.defaultValue, null);
Assert.assertEquals(enumVar.baseType, "String");
Assert.assertTrue(enumVar.isEnum);
}
@@ -80,7 +80,7 @@ public class JavaModelEnumTest {
Assert.assertEquals(enumVar.mostInnerItems.dataType, "String");
Assert.assertEquals(enumVar.mostInnerItems.datatypeWithEnum, "NameEnum");
Assert.assertEquals(enumVar.mostInnerItems.name, "name");
- Assert.assertEquals(enumVar.mostInnerItems.defaultValue, "null");
+ Assert.assertEquals(enumVar.mostInnerItems.defaultValue, null);
Assert.assertEquals(enumVar.mostInnerItems.baseType, "String");
Assert.assertEquals(enumVar.mostInnerItems.baseType, enumVar.items.baseType);
@@ -111,7 +111,7 @@ public class JavaModelEnumTest {
Assert.assertEquals(enumVar.mostInnerItems.dataType, "String");
Assert.assertEquals(enumVar.mostInnerItems.datatypeWithEnum, "NameEnum");
Assert.assertEquals(enumVar.mostInnerItems.name, "name");
- Assert.assertEquals(enumVar.mostInnerItems.defaultValue, "null");
+ Assert.assertEquals(enumVar.mostInnerItems.defaultValue, null);
Assert.assertEquals(enumVar.mostInnerItems.baseType, "String");
Assert.assertEquals(enumVar.mostInnerItems.baseType, enumVar.items.items.baseType);
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java
index 54dc3b0cd6..03325e04f7 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java
@@ -97,7 +97,7 @@ public class JavaModelTest {
Assert.assertEquals(property1.setter, "setId");
Assert.assertEquals(property1.dataType, "Long");
Assert.assertEquals(property1.name, "id");
- Assert.assertEquals(property1.defaultValue, "null");
+ Assert.assertEquals(property1.defaultValue, null);
Assert.assertEquals(property1.baseType, "Long");
Assert.assertTrue(property1.hasMore);
Assert.assertTrue(property1.required);
@@ -111,7 +111,7 @@ public class JavaModelTest {
Assert.assertEquals(property2.setter, "setName");
Assert.assertEquals(property2.dataType, "String");
Assert.assertEquals(property2.name, "name");
- Assert.assertEquals(property2.defaultValue, "null");
+ Assert.assertEquals(property2.defaultValue, null);
Assert.assertEquals(property2.baseType, "String");
Assert.assertEquals(property2.example, "Tony");
Assert.assertTrue(property2.hasMore);
@@ -126,7 +126,7 @@ public class JavaModelTest {
Assert.assertEquals(property3.setter, "setCreatedAt");
Assert.assertEquals(property3.dataType, "Date");
Assert.assertEquals(property3.name, "createdAt");
- Assert.assertEquals(property3.defaultValue, "null");
+ Assert.assertEquals(property3.defaultValue, null);
Assert.assertEquals(property3.baseType, "Date");
Assert.assertFalse(property3.hasMore);
Assert.assertFalse(property3.required);
@@ -261,7 +261,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setAtSomeColonRestrictedPercentCharactersHashToExclamationHandlePlus");
Assert.assertEquals(property.dataType, "Boolean");
Assert.assertEquals(property.name, "atSomeColonRestrictedPercentCharactersHashToExclamationHandlePlus");
- Assert.assertEquals(property.defaultValue, "null");
+ Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "Boolean");
Assert.assertFalse(property.required);
Assert.assertTrue(property.isNotContainer);
@@ -286,6 +286,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setChildren");
Assert.assertEquals(property.dataType, "Children");
Assert.assertEquals(property.name, "children");
+ // "null" as default value for model
Assert.assertEquals(property.defaultValue, "null");
Assert.assertEquals(property.baseType, "Children");
Assert.assertFalse(property.required);
@@ -445,7 +446,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setNAME");
Assert.assertEquals(property.dataType, "String");
Assert.assertEquals(property.name, "NAME");
- Assert.assertEquals(property.defaultValue, "null");
+ Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "String");
Assert.assertFalse(property.hasMore);
Assert.assertTrue(property.required);
@@ -471,7 +472,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setPId");
Assert.assertEquals(property.dataType, "String");
Assert.assertEquals(property.name, "pId");
- Assert.assertEquals(property.defaultValue, "null");
+ Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "String");
Assert.assertFalse(property.hasMore);
Assert.assertTrue(property.required);
@@ -497,7 +498,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setAtTName");
Assert.assertEquals(property.dataType, "String");
Assert.assertEquals(property.name, "atTName");
- Assert.assertEquals(property.defaultValue, "null");
+ Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "String");
Assert.assertFalse(property.hasMore);
Assert.assertTrue(property.required);
@@ -559,7 +560,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setInputBinaryData");
Assert.assertEquals(property.dataType, "byte[]");
Assert.assertEquals(property.name, "inputBinaryData");
- Assert.assertEquals(property.defaultValue, "null");
+ Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "byte[]");
Assert.assertFalse(property.hasMore);
Assert.assertFalse(property.required);
@@ -584,7 +585,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setU");
Assert.assertEquals(property.dataType, "String");
Assert.assertEquals(property.name, "u");
- Assert.assertEquals(property.defaultValue, "null");
+ Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "String");
Assert.assertFalse(property.hasMore);
Assert.assertTrue(property.isNotContainer);
@@ -713,7 +714,7 @@ public class JavaModelTest {
Assert.assertEquals(property2.setter, "setName");
Assert.assertEquals(property2.dataType, "String");
Assert.assertEquals(property2.name, "name");
- Assert.assertEquals(property2.defaultValue, "null");
+ Assert.assertEquals(property2.defaultValue, null);
Assert.assertEquals(property2.baseType, "String");
Assert.assertEquals(property2.example, "Tony");
Assert.assertTrue(property2.hasMore);
@@ -729,7 +730,7 @@ public class JavaModelTest {
Assert.assertEquals(property3.setter, "setCreatedAt");
Assert.assertEquals(property3.dataType, "Date");
Assert.assertEquals(property3.name, "createdAt");
- Assert.assertEquals(property3.defaultValue, "null");
+ Assert.assertEquals(property3.defaultValue, null);
Assert.assertEquals(property3.baseType, "Date");
Assert.assertFalse(property3.hasMore);
Assert.assertFalse(property3.required);
diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml
index e63cb90e0a..f1400ad8c6 100644
--- a/modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml
+++ b/modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml
@@ -36,7 +36,7 @@ paths:
parameters:
- name: test code inject */ ' " =end -- \r\n \n \r
type: string
- in: formData
+ in: formData
description: To test code injection */ ' " =end -- \r\n \n \r
responses:
'400':
diff --git a/modules/openapi-generator/src/test/resources/3_0/allOf.yaml b/modules/openapi-generator/src/test/resources/3_0/allOf.yaml
index 3c7baaae8b..6f01aeb80c 100644
--- a/modules/openapi-generator/src/test/resources/3_0/allOf.yaml
+++ b/modules/openapi-generator/src/test/resources/3_0/allOf.yaml
@@ -53,9 +53,9 @@ components:
Child:
description: A representation of a child
allOf:
- - $ref: '#/components/schemas/Person'
- type: object
properties:
age:
type: integer
- format: int32
\ No newline at end of file
+ format: int32
+ - $ref: '#/components/schemas/Person'
diff --git a/pom.xml b/pom.xml
index 0ea85004b6..6d2039f512 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,6 +158,7 @@
none:none-XX:+StartAttachListener
+ -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit-version}/jmockit-${jmockit-version}.jar
@@ -189,7 +190,7 @@
maven-compiler-plugin
- 3.6.1
+ 3.8.01.81.8
@@ -198,7 +199,7 @@
org.apache.maven.pluginsmaven-jar-plugin
- 3.0.2
+ 3.1.0
@@ -213,7 +214,7 @@
org.apache.maven.pluginsmaven-site-plugin
- 3.5.1
+ 3.7.1org.apache.maven.plugins
@@ -260,7 +261,7 @@
org.apache.maven.pluginsmaven-enforcer-plugin
- 1.4.1
+ 3.0.0-M2enforce-versions
@@ -280,7 +281,7 @@
de.thetaphiforbiddenapis
- 2.5
+ 2.6
+ samples/client/petstore/typescript-node/npm
+
+ samples.circleci
+
+
+ env
+ samples.circleci
+
+
+
+
+
+ samples/client/petstore/go
+ samples/client/petstore/typescript-angular-v6-provided-in-root
+
+ samples/client/petstore/scala-akka
+ samples/client/petstore/scala-httpclient
+ samples/client/petstore/scalaz
+ samples/client/petstore/clojure
+ samples/client/petstore/java/feign
+ samples/client/petstore/java/feign10x
+ samples/client/petstore/java/jersey1
+ samples/client/petstore/java/jersey2
+ samples/client/petstore/java/jersey2-java8
+ samples/client/petstore/java/okhttp-gson
+ samples/client/petstore/java/retrofit
+ samples/client/petstore/java/retrofit2
+ samples/client/petstore/java/retrofit2rx
+ samples/client/petstore/java/retrofit2-play25
+ samples/client/petstore/java/retrofit2-play26
+ samples/client/petstore/jaxrs-cxf-client
+ samples/client/petstore/java/resttemplate
+ samples/client/petstore/java/resttemplate-withXml
+ samples/client/petstore/java/webclient
+ samples/client/petstore/java/vertx
+ samples/client/petstore/java/resteasy
+ samples/client/petstore/java/google-api-client
+ samples/client/petstore/java/rest-assured
+ samples/client/petstore/kotlin/
+ samples/client/petstore/kotlin-threetenbp/
+ samples/client/petstore/kotlin-string/
+
+ samples/server/petstore/jaxrs-jersey
+ samples/server/petstore/jaxrs-spec
+ samples/server/petstore/jaxrs-spec-interface
+ samples/server/petstore/jaxrs-spec-interface-response
+ samples/server/petstore/java-vertx/rx
+ samples/server/petstore/java-vertx/async
+ samples/server/petstore/java-inflector
+ samples/server/petstore/java-pkmst
+ samples/server/petstore/java-play-framework
+ samples/server/petstore/java-play-framework-no-wrap-calls
+ samples/server/petstore/java-play-framework-no-swagger-ui
+ samples/server/petstore/java-play-framework-no-interface
+ samples/server/petstore/java-play-framework-no-exception-handling
+ samples/server/petstore/java-play-framework-no-bean-validation
+ samples/server/petstore/java-play-framework-fake-endpoints
+ samples/server/petstore/java-play-framework-controller-only
+ samples/server/petstore/java-play-framework-api-package-override
+ samples/server/petstore/undertow
+ samples/server/petstore/jaxrs/jersey1
+ samples/server/petstore/jaxrs/jersey1-useTags
+
+ samples/server/petstore/jaxrs-datelib-j8
+ samples/server/petstore/jaxrs-resteasy/default
+ samples/server/petstore/jaxrs-resteasy/eap
+ samples/server/petstore/jaxrs-resteasy/eap-joda
+ samples/server/petstore/jaxrs-resteasy/eap-java8
+ samples/server/petstore/jaxrs-resteasy/joda
+
+
+ samples/client/petstore/spring-cloud
+ samples/server/petstore/springboot
+ samples/server/petstore/springboot-beanvalidation
+ samples/server/petstore/springboot-useoptional
+ samples/server/petstore/jaxrs-cxf
+ samples/server/petstore/jaxrs-cxf-annotated-base-path
+ samples/server/petstore/jaxrs-cxf-cdi
+ samples/server/petstore/jaxrs-cxf-non-spring-app
+ samples/server/petstore/java-msf4j
+ samples/server/petstore/scala-lagom-server
+ samples/server/petstore/scalatra
+ samples/server/petstore/finch
+ samples/server/petstore/kotlin-springboot
+
+
+
+
+ samples.circleci.jdk7
+
+
+ env
+ samples.circleci.jdk7
+
+
+
+
+
+ samples/client/petstore/scala-akka
+ samples/client/petstore/scala-httpclient
+ samples/client/petstore/scalaz
+ samples/client/petstore/clojure
+ samples/client/petstore/java/feign
+ samples/client/petstore/java/jersey1
+ samples/client/petstore/java/jersey2
+ samples/client/petstore/java/okhttp-gson
+ samples/client/petstore/java/retrofit
+ samples/client/petstore/java/retrofit2
+ samples/client/petstore/java/retrofit2rx
+ samples/client/petstore/jaxrs-cxf-client
+ samples/client/petstore/java/resttemplate
+ samples/client/petstore/java/resttemplate-withXml
+ samples/client/petstore/java/vertx
+ samples/client/petstore/java/resteasy
+ samples/client/petstore/java/google-api-client
+ samples/client/petstore/kotlin/
+
+ samples/server/petstore/jaxrs-jersey
+ samples/server/petstore/jaxrs-spec
+ samples/server/petstore/jaxrs-spec-interface
+ samples/server/petstore/jaxrs-spec-interface-response
+ samples/server/petstore/java-vertx/rx
+ samples/server/petstore/java-vertx/async
+ samples/server/petstore/java-inflector
+ samples/server/petstore/undertow
+ samples/server/petstore/jaxrs/jersey1
+ samples/server/petstore/jaxrs/jersey2
+ samples/server/petstore/jaxrs/jersey1-useTags
+ samples/server/petstore/jaxrs/jersey2-useTags
+ samples/server/petstore/jaxrs-resteasy/default
+ samples/server/petstore/jaxrs-resteasy/eap
+ samples/server/petstore/jaxrs-resteasy/eap-joda
+ samples/server/petstore/jaxrs-resteasy/eap-java8
+ samples/server/petstore/jaxrs-resteasy/joda
+ samples/server/petstore/spring-mvc
+ samples/client/petstore/spring-cloud
+ samples/server/petstore/springboot
+ samples/server/petstore/springboot-beanvalidation
+ samples/server/petstore/springboot-useoptional
+ samples/server/petstore/jaxrs-cxf
+ samples/server/petstore/jaxrs-cxf-annotated-base-path
+ samples/server/petstore/jaxrs-cxf-cdi
+ samples/server/petstore/jaxrs-cxf-non-spring-app
+ samples/server/petstore/java-msf4j
+
+
+
samples.shippable
@@ -1079,6 +1231,41 @@
samples/server/petstore/php-slim
+
+ samples.ios
+
+
+ env
+ samples.ios
+
+
+
+ samples/client/petstore/swift4/default/SwaggerClientTests
+ samples/client/petstore/swift4/promisekit/SwaggerClientTests
+ samples/client/petstore/swift4/rxswift/SwaggerClientTests
+ samples/client/petstore/swift3/default/SwaggerClientTests
+ samples/client/petstore/swift3/promisekit/SwaggerClientTests
+ samples/client/petstore/swift3/rxswift/SwaggerClientTests
+ samples/client/petstore/swift/default/SwaggerClientTests
+ samples/client/petstore/swift/promisekit/SwaggerClientTests
+ samples/client/petstore/swift/rxswift/SwaggerClientTests
+
+
+
+
+ samples.bash
+
+
+ env
+ samples.bash
+
+
+
+ samples/client/petstore/bash
+
+ modules/openapi-generator
@@ -1098,7 +1285,7 @@
org.apache.maven.pluginsmaven-jxr-plugin
- 2.5
+ 3.0.0true
@@ -1106,7 +1293,7 @@
org.apache.maven.pluginsmaven-project-info-reports-plugin
- 2.9
+ 3.0.0
@@ -1154,7 +1341,7 @@
2.0.42.0.42.11.1
- 3.4.0-SNAPSHOT
+ 3.3.12.41.24.8.1
@@ -1165,8 +1352,8 @@
3.2.11.146.9.6
- 2.19.1
- 1.25
+ 2.22.0
+ 1.430.9.102.0.2.RELEASE
diff --git a/samples/client/petstore-security-test/go/.openapi-generator/VERSION b/samples/client/petstore-security-test/go/.openapi-generator/VERSION
index 096bf47efe..f4cb97d56c 100644
--- a/samples/client/petstore-security-test/go/.openapi-generator/VERSION
+++ b/samples/client/petstore-security-test/go/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.3.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore-security-test/go/README.md b/samples/client/petstore-security-test/go/README.md
index ea6e8af4f5..f94b342e31 100644
--- a/samples/client/petstore-security-test/go/README.md
+++ b/samples/client/petstore-security-test/go/README.md
@@ -26,7 +26,7 @@ import "./openapi"
## Documentation for API Endpoints
-All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
+All URIs are relative to *http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
diff --git a/samples/client/petstore-security-test/go/api/openapi.yaml b/samples/client/petstore-security-test/go/api/openapi.yaml
index 8ed2aa894f..ad8c8ff7cf 100644
--- a/samples/client/petstore-security-test/go/api/openapi.yaml
+++ b/samples/client/petstore-security-test/go/api/openapi.yaml
@@ -1,33 +1,31 @@
openapi: 3.0.1
info:
- title: OpenAPI Petstore */ ' " =end -- \r\n \n \r
+ contact:
+ email: something@something.abc */ ' " =end -- \r\n \n \r
description: "This spec is mainly for testing Petstore server and contains fake\
\ endpoints, models. Please do not use this for any other purpose. Special characters:\
\ \" \\ */ ' \" =end -- \r\n \n \r"
- termsOfService: http://url.to/terms/ */ ' " =end -- \r\n \n \r
- contact:
- email: something@something.abc */ ' " =end -- \r\n \n \r
license:
name: Apache-2.0 */ ' " =end -- \r\n \n \r
url: http://www.apache.org/licenses/LICENSE-2.0.html */ ' " =end -- \r\n \n \r
+ termsOfService: http://url.to/terms/ */ ' " =end -- \r\n \n \r
+ title: OpenAPI Petstore */ ' " =end -- \r\n \n \r
version: 1.0.0 */ ' " =end -- \r\n \n \r
externalDocs:
description: Find out more about OpenAPI */ ' " =end -- \r\n \n \r
url: https://openapis.org
servers:
-- url: petstore.swagger.io */ ' " =end -- \r\n \n \r/v2 */ ' " =end -- \r\n \n \r
+- url: //petstore.swagger.io */ ' " =end -- \r\n \n \r/v2 */ ' " =end -- \r\n \n \r
tags:
-- name: fake
- description: Everything about your Pets */ ' " =end -- \r\n \n \r
+- description: Everything about your Pets */ ' " =end -- \r\n \n \r
externalDocs:
description: Find out more */ ' " =end -- \r\n \n \r
url: https://openapis.org
+ name: fake
paths:
/fake:
put:
- tags:
- - fake
- summary: To test code injection */ ' " =end -- \r\n \n \r
+ description: To test code injection */ ' " =end -- \r\n \n \r
operationId: testCodeInject */ ' " =end -- \r\n \n \r
requestBody:
content:
@@ -35,40 +33,43 @@ paths:
schema:
properties:
test code inject */ ' " =end -- \r\n \n \r:
- type: string
description: To test code injection */ ' " =end -- \r\n \n \r
+ type: string
? "*/ ' \" =end -- \r\n \n \r"
: schema:
properties:
test code inject */ ' " =end -- \r\n \n \r:
- type: string
description: To test code injection */ ' " =end -- \r\n \n \r
+ type: string
responses:
400:
- description: To test code injection */ ' " =end -- \r\n \n \r
content: {}
+ description: To test code injection */ ' " =end -- \r\n \n \r
+ summary: To test code injection */ ' " =end -- \r\n \n \r
+ tags:
+ - fake
components:
schemas:
Return:
- type: object
+ description: Model for testing reserved words */ ' " =end -- \r\n \n \r
properties:
return:
- type: integer
description: property description */ ' " =end -- \r\n \n \r
format: int32
- description: Model for testing reserved words */ ' " =end -- \r\n \n \r
+ type: integer
+ type: object
xml:
name: Return
securitySchemes:
petstore_auth:
- type: oauth2
flows:
implicit:
authorizationUrl: http://petstore.swagger.io/api/oauth/dialog
scopes:
write:pets: modify pets in your account */ ' " =end -- \r\n \n \r
read:pets: read your pets */ ' " =end -- \r\n \n \r
+ type: oauth2
api_key:
- type: apiKey
- name: api_key */ ' " =end -- \r\n \n \r
in: header
+ name: api_key */ ' " =end -- \r\n \n \r
+ type: apiKey
diff --git a/samples/client/petstore-security-test/go/api_fake.go b/samples/client/petstore-security-test/go/api_fake.go
index c0668d851e..957fbf3995 100644
--- a/samples/client/petstore-security-test/go/api_fake.go
+++ b/samples/client/petstore-security-test/go/api_fake.go
@@ -16,6 +16,7 @@ import (
"net/http"
"net/url"
"strings"
+ "github.com/antihax/optional"
)
// Linger please
@@ -25,23 +26,25 @@ var (
type FakeApiService service
-/*
-FakeApiService To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
+/*
+FakeApiService To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
+To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *TestCodeInjectEndRnNROpts - Optional Parameters:
- * @param "UNKNOWNBASETYPE" (optional.Interface of interface{}) -
+ * @param "UNKNOWNBASETYPE" (optional.Interface of UNKNOWN_BASE_TYPE) -
*/
type TestCodeInjectEndRnNROpts struct {
- UNKNOWNBASETYPE optional.Interface
+ UNKNOWNBASETYPE optional.Interface
}
func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOptionals *TestCodeInjectEndRnNROpts) (*http.Response, error) {
var (
- localVarHttpMethod = strings.ToUpper("Put")
- localVarPostBody interface{}
- localVarFileName string
- localVarFileBytes []byte
+ localVarHttpMethod = strings.ToUpper("Put")
+ localVarPostBody interface{}
+ localVarFormFileName string
+ localVarFileName string
+ localVarFileBytes []byte
)
// create path and map variables
@@ -70,14 +73,14 @@ func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOpti
}
// body params
if localVarOptionals != nil && localVarOptionals.UNKNOWNBASETYPE.IsSet() {
- localVarOptionalUNKNOWNBASETYPE, localVarOptionalUNKNOWNBASETYPEok := localVarOptionals.UNKNOWNBASETYPE.Value().(interface{})
+ localVarOptionalUNKNOWNBASETYPE, localVarOptionalUNKNOWNBASETYPEok := localVarOptionals.UNKNOWNBASETYPE.Value().(UNKNOWN_BASE_TYPE)
if !localVarOptionalUNKNOWNBASETYPEok {
- return nil, reportError("uNKNOWNBASETYPE should be interface{}")
+ return nil, reportError("uNKNOWNBASETYPE should be UNKNOWN_BASE_TYPE")
}
localVarPostBody = &localVarOptionalUNKNOWNBASETYPE
}
- r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
+ r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
@@ -95,7 +98,7 @@ func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOpti
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
- body: localVarBody,
+ body: localVarBody,
error: localVarHttpResponse.Status,
}
return localVarHttpResponse, newErr
diff --git a/samples/client/petstore-security-test/go/client.go b/samples/client/petstore-security-test/go/client.go
index 9af81649e2..8d579d2ee7 100644
--- a/samples/client/petstore-security-test/go/client.go
+++ b/samples/client/petstore-security-test/go/client.go
@@ -139,6 +139,8 @@ func parameterToString(obj interface{}, collectionFormat string) string {
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
+ } else if t, ok := obj.(time.Time); ok {
+ return t.Format(time.RFC3339)
}
return fmt.Sprintf("%v", obj)
@@ -162,6 +164,7 @@ func (c *APIClient) prepareRequest(
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
+ formFileName string,
fileName string,
fileBytes []byte) (localVarRequest *http.Request, err error) {
@@ -182,7 +185,7 @@ func (c *APIClient) prepareRequest(
}
// add form parameters and file if available.
- if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
+ if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
@@ -204,7 +207,7 @@ func (c *APIClient) prepareRequest(
if len(fileBytes) > 0 && fileName != "" {
w.Boundary()
//_, fileNm := filepath.Split(fileName)
- part, err := w.CreateFormFile("file", filepath.Base(fileName))
+ part, err := w.CreateFormFile(formFileName, filepath.Base(fileName))
if err != nil {
return nil, err
}
@@ -221,6 +224,16 @@ func (c *APIClient) prepareRequest(
w.Close()
}
+ if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
+ if body != nil {
+ return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
+ }
+ body = &bytes.Buffer{}
+ body.WriteString(formParams.Encode())
+ // Set Content-Length
+ headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
+ }
+
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
@@ -424,8 +437,9 @@ func CacheExpires(r *http.Response) time.Time {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
+ } else {
+ expires = now.Add(lifetime)
}
- expires = now.Add(lifetime)
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
@@ -462,4 +476,4 @@ func (e GenericOpenAPIError) Body() []byte {
// Model returns the unpacked model of the error
func (e GenericOpenAPIError) Model() interface{} {
return e.model
-}
\ No newline at end of file
+}
diff --git a/samples/client/petstore-security-test/go/configuration.go b/samples/client/petstore-security-test/go/configuration.go
index 659bb16f14..961a31cd51 100644
--- a/samples/client/petstore-security-test/go/configuration.go
+++ b/samples/client/petstore-security-test/go/configuration.go
@@ -25,7 +25,7 @@ func (c contextKey) String() string {
}
var (
- // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
+ // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOAuth2 = contextKey("token")
// ContextBasicAuth takes BasicAuth as authentication for the request.
@@ -61,7 +61,7 @@ type Configuration struct {
func NewConfiguration() *Configuration {
cfg := &Configuration{
- BasePath: "petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r",
+ BasePath: "http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r",
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
}
diff --git a/samples/client/petstore-security-test/go/docs/FakeApi.md b/samples/client/petstore-security-test/go/docs/FakeApi.md
index c556953bdd..3896e6044b 100644
--- a/samples/client/petstore-security-test/go/docs/FakeApi.md
+++ b/samples/client/petstore-security-test/go/docs/FakeApi.md
@@ -1,6 +1,6 @@
# \FakeApi
-All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
+All URIs are relative to *http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
Method | HTTP request | Description
------------- | ------------- | -------------
@@ -11,6 +11,8 @@ Method | HTTP request | Description
> TestCodeInjectEndRnNR(ctx, optional)
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
+To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
+
### Required Parameters
Name | Type | Description | Notes
@@ -23,7 +25,7 @@ Optional parameters are passed through a pointer to a TestCodeInjectEndRnNROpts
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **uNKNOWNBASETYPE** | [**optional.Interface of interface{}**](UNKNOWN_BASE_TYPE.md)| |
+ **uNKNOWNBASETYPE** | [**optional.Interface of UNKNOWN_BASE_TYPE**](UNKNOWN_BASE_TYPE.md)| |
### Return type
diff --git a/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION
index 6d94c9c2e1..f4cb97d56c 100644
--- a/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION
+++ b/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION
@@ -1 +1 @@
-3.3.0-SNAPSHOT
\ No newline at end of file
+3.3.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
index e78d33d209..de2793cbee 100644
--- a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
@@ -53,6 +53,7 @@ import org.openapitools.client.auth.HttpBasicAuth;
import org.openapitools.client.auth.ApiKeyAuth;
import org.openapitools.client.auth.OAuth;
import org.openapitools.client.auth.RetryingOAuth;
+import org.openapitools.client.auth.OAuthFlow;
public class ApiClient {
@@ -100,7 +101,7 @@ public class ApiClient {
) {
init();
- RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, GrantType.valueOf("implicit"), clientSecret, parameters);
+ RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
authentications.put(
"petstore_auth",
retryingOAuth
diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java
index c6451da524..78fcb52d5a 100644
--- a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java
+++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java
@@ -35,15 +35,14 @@ public class RetryingOAuth extends OAuth implements Interceptor {
public RetryingOAuth(
String tokenUrl,
String clientId,
- GrantType grantType,
+ OAuthFlow flow,
String clientSecret,
Map parameters
) {
this(OAuthClientRequest.tokenLocation(tokenUrl)
.setClientId(clientId)
- .setGrantType(grantType)
.setClientSecret(clientSecret));
-
+ setFlow(flow);
if (parameters != null) {
for (String paramName : parameters.keySet()) {
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
@@ -51,6 +50,25 @@ public class RetryingOAuth extends OAuth implements Interceptor {
}
}
+ public void setFlow(OAuthFlow flow) {
+ switch(flow) {
+ case accessCode:
+ tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE);
+ break;
+ case implicit:
+ tokenRequestBuilder.setGrantType(GrantType.IMPLICIT);
+ break;
+ case password:
+ tokenRequestBuilder.setGrantType(GrantType.PASSWORD);
+ break;
+ case application:
+ tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS);
+ break;
+ default:
+ break;
+ }
+ }
+
@Override
public Response intercept(Chain chain) throws IOException {
return retryingIntercept(chain, true);
diff --git a/samples/client/petstore/cpp-restsdk/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/.openapi-generator/VERSION
index 6d94c9c2e1..f4cb97d56c 100644
--- a/samples/client/petstore/cpp-restsdk/.openapi-generator/VERSION
+++ b/samples/client/petstore/cpp-restsdk/.openapi-generator/VERSION
@@ -1 +1 @@
-3.3.0-SNAPSHOT
\ No newline at end of file
+3.3.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/cpp-restsdk/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/ApiClient.cpp
index 9b7ae17bd8..482cb6b51a 100644
--- a/samples/client/petstore/cpp-restsdk/ApiClient.cpp
+++ b/samples/client/petstore/cpp-restsdk/ApiClient.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/ApiClient.h b/samples/client/petstore/cpp-restsdk/ApiClient.h
index 0ce3eeb491..afea008c5a 100644
--- a/samples/client/petstore/cpp-restsdk/ApiClient.h
+++ b/samples/client/petstore/cpp-restsdk/ApiClient.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/ApiConfiguration.cpp
index 95a6c5fc1b..e5418033e9 100644
--- a/samples/client/petstore/cpp-restsdk/ApiConfiguration.cpp
+++ b/samples/client/petstore/cpp-restsdk/ApiConfiguration.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/ApiConfiguration.h
index 218c92b403..583a4d42ba 100644
--- a/samples/client/petstore/cpp-restsdk/ApiConfiguration.h
+++ b/samples/client/petstore/cpp-restsdk/ApiConfiguration.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/ApiException.cpp b/samples/client/petstore/cpp-restsdk/ApiException.cpp
index f1eb81c214..b517975318 100644
--- a/samples/client/petstore/cpp-restsdk/ApiException.cpp
+++ b/samples/client/petstore/cpp-restsdk/ApiException.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/ApiException.h b/samples/client/petstore/cpp-restsdk/ApiException.h
index 4958f09ad7..28d298c1d3 100644
--- a/samples/client/petstore/cpp-restsdk/ApiException.h
+++ b/samples/client/petstore/cpp-restsdk/ApiException.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/HttpContent.cpp
index 3f94dd84a9..64bb8809d5 100644
--- a/samples/client/petstore/cpp-restsdk/HttpContent.cpp
+++ b/samples/client/petstore/cpp-restsdk/HttpContent.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/HttpContent.h b/samples/client/petstore/cpp-restsdk/HttpContent.h
index 9cc76d8d11..3bab6732e5 100644
--- a/samples/client/petstore/cpp-restsdk/HttpContent.h
+++ b/samples/client/petstore/cpp-restsdk/HttpContent.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/IHttpBody.h b/samples/client/petstore/cpp-restsdk/IHttpBody.h
index c5e173490f..eea4bff9a2 100644
--- a/samples/client/petstore/cpp-restsdk/IHttpBody.h
+++ b/samples/client/petstore/cpp-restsdk/IHttpBody.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/JsonBody.cpp
index 276f83abbb..bfe372de78 100644
--- a/samples/client/petstore/cpp-restsdk/JsonBody.cpp
+++ b/samples/client/petstore/cpp-restsdk/JsonBody.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/JsonBody.h b/samples/client/petstore/cpp-restsdk/JsonBody.h
index ada2e9eb11..1230f4e2d4 100644
--- a/samples/client/petstore/cpp-restsdk/JsonBody.h
+++ b/samples/client/petstore/cpp-restsdk/JsonBody.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/ModelBase.cpp
index 10bffc4d1f..ef2171033b 100644
--- a/samples/client/petstore/cpp-restsdk/ModelBase.cpp
+++ b/samples/client/petstore/cpp-restsdk/ModelBase.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/ModelBase.h b/samples/client/petstore/cpp-restsdk/ModelBase.h
index 2eedce34bf..6d7475178a 100644
--- a/samples/client/petstore/cpp-restsdk/ModelBase.h
+++ b/samples/client/petstore/cpp-restsdk/ModelBase.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/MultipartFormData.cpp
index af97786252..4ff69df785 100644
--- a/samples/client/petstore/cpp-restsdk/MultipartFormData.cpp
+++ b/samples/client/petstore/cpp-restsdk/MultipartFormData.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/MultipartFormData.h
index 3cc52c4990..034cc24812 100644
--- a/samples/client/petstore/cpp-restsdk/MultipartFormData.h
+++ b/samples/client/petstore/cpp-restsdk/MultipartFormData.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/Object.cpp b/samples/client/petstore/cpp-restsdk/Object.cpp
index c732027e2a..f7e01f7342 100644
--- a/samples/client/petstore/cpp-restsdk/Object.cpp
+++ b/samples/client/petstore/cpp-restsdk/Object.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/Object.h b/samples/client/petstore/cpp-restsdk/Object.h
index 0914c1fd7c..848583cbb4 100644
--- a/samples/client/petstore/cpp-restsdk/Object.h
+++ b/samples/client/petstore/cpp-restsdk/Object.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/api/PetApi.cpp
index eb912354ea..cbc094a1e9 100644
--- a/samples/client/petstore/cpp-restsdk/api/PetApi.cpp
+++ b/samples/client/petstore/cpp-restsdk/api/PetApi.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/api/PetApi.h b/samples/client/petstore/cpp-restsdk/api/PetApi.h
index ae7546f115..0313da3039 100644
--- a/samples/client/petstore/cpp-restsdk/api/PetApi.h
+++ b/samples/client/petstore/cpp-restsdk/api/PetApi.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -62,7 +62,7 @@ public:
///
///
/// Pet id to delete
- /// (optional)
+ /// (optional, default to utility::conversions::to_string_t(""))
pplx::task deletePet(
int64_t petId,
boost::optional apiKey
diff --git a/samples/client/petstore/cpp-restsdk/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/api/StoreApi.cpp
index 55cfb7850e..6af51a562b 100644
--- a/samples/client/petstore/cpp-restsdk/api/StoreApi.cpp
+++ b/samples/client/petstore/cpp-restsdk/api/StoreApi.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/api/StoreApi.h
index 6380402473..507756dee1 100644
--- a/samples/client/petstore/cpp-restsdk/api/StoreApi.h
+++ b/samples/client/petstore/cpp-restsdk/api/StoreApi.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/api/UserApi.cpp
index 24376a8747..808f988a2e 100644
--- a/samples/client/petstore/cpp-restsdk/api/UserApi.cpp
+++ b/samples/client/petstore/cpp-restsdk/api/UserApi.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/api/UserApi.h b/samples/client/petstore/cpp-restsdk/api/UserApi.h
index 2afa0af928..ea184c0cf7 100644
--- a/samples/client/petstore/cpp-restsdk/api/UserApi.h
+++ b/samples/client/petstore/cpp-restsdk/api/UserApi.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/model/ApiResponse.cpp
index ce86c5523e..72e188a898 100644
--- a/samples/client/petstore/cpp-restsdk/model/ApiResponse.cpp
+++ b/samples/client/petstore/cpp-restsdk/model/ApiResponse.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/model/ApiResponse.h
index 2c257ab297..422091ab1f 100644
--- a/samples/client/petstore/cpp-restsdk/model/ApiResponse.h
+++ b/samples/client/petstore/cpp-restsdk/model/ApiResponse.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Category.cpp b/samples/client/petstore/cpp-restsdk/model/Category.cpp
index c39bf76fc8..e8b48e9426 100644
--- a/samples/client/petstore/cpp-restsdk/model/Category.cpp
+++ b/samples/client/petstore/cpp-restsdk/model/Category.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Category.h b/samples/client/petstore/cpp-restsdk/model/Category.h
index 87f4224b2a..e4f9b7bbf5 100644
--- a/samples/client/petstore/cpp-restsdk/model/Category.h
+++ b/samples/client/petstore/cpp-restsdk/model/Category.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Order.cpp b/samples/client/petstore/cpp-restsdk/model/Order.cpp
index fe2ecb8ebe..aa39a3ada0 100644
--- a/samples/client/petstore/cpp-restsdk/model/Order.cpp
+++ b/samples/client/petstore/cpp-restsdk/model/Order.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Order.h b/samples/client/petstore/cpp-restsdk/model/Order.h
index 1b3b7f1e12..716cd3edb6 100644
--- a/samples/client/petstore/cpp-restsdk/model/Order.h
+++ b/samples/client/petstore/cpp-restsdk/model/Order.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/model/Pet.cpp
index ac8c2232b2..8d37d3fd33 100644
--- a/samples/client/petstore/cpp-restsdk/model/Pet.cpp
+++ b/samples/client/petstore/cpp-restsdk/model/Pet.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Pet.h b/samples/client/petstore/cpp-restsdk/model/Pet.h
index a0d457caba..d5f9293a3f 100644
--- a/samples/client/petstore/cpp-restsdk/model/Pet.h
+++ b/samples/client/petstore/cpp-restsdk/model/Pet.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/model/Tag.cpp
index 416ec5e2de..a2edf65529 100644
--- a/samples/client/petstore/cpp-restsdk/model/Tag.cpp
+++ b/samples/client/petstore/cpp-restsdk/model/Tag.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/Tag.h b/samples/client/petstore/cpp-restsdk/model/Tag.h
index d78e2c3400..4213e32847 100644
--- a/samples/client/petstore/cpp-restsdk/model/Tag.h
+++ b/samples/client/petstore/cpp-restsdk/model/Tag.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/User.cpp b/samples/client/petstore/cpp-restsdk/model/User.cpp
index d8ec0c8c43..cf72b9e02e 100644
--- a/samples/client/petstore/cpp-restsdk/model/User.cpp
+++ b/samples/client/petstore/cpp-restsdk/model/User.cpp
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/cpp-restsdk/model/User.h b/samples/client/petstore/cpp-restsdk/model/User.h
index 01c3271f93..ed18d117ce 100644
--- a/samples/client/petstore/cpp-restsdk/model/User.h
+++ b/samples/client/petstore/cpp-restsdk/model/User.h
@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
- * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore
new file mode 100644
index 0000000000..7484ee590a
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION
new file mode 100644
index 0000000000..6d94c9c2e1
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION
@@ -0,0 +1 @@
+3.3.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md
new file mode 100644
index 0000000000..6b861dfd72
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md
@@ -0,0 +1,131 @@
+# Org.OpenAPITools - the C# library for the OpenAPI Petstore
+
+This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+
+This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- SDK version: 1.0.0
+- Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen
+
+
+## Frameworks supported
+- .NET 2.0
+
+
+## Dependencies
+- Mono compiler
+- Newtonsoft.Json.7.0.1
+- RestSharp.Net2.1.1.11
+
+Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator
+
+
+## Installation
+Run the following command to generate the DLL
+- [Mac/Linux] `/bin/sh compile-mono.sh`
+- [Windows] TODO
+
+Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
+```csharp
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+```
+
+## Getting Started
+
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class Example
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var pet = new Pet(); // Pet | Pet object that needs to be added to the store
+
+ try
+ {
+ // Add a new pet to the store
+ apiInstance.AddPet(pet);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
+*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
+*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
+*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
+*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
+
+
+
+## Documentation for Models
+
+ - [Org.OpenAPITools.Model.ApiResponse](docs/ApiResponse.md)
+ - [Org.OpenAPITools.Model.Category](docs/Category.md)
+ - [Org.OpenAPITools.Model.Order](docs/Order.md)
+ - [Org.OpenAPITools.Model.Pet](docs/Pet.md)
+ - [Org.OpenAPITools.Model.Tag](docs/Tag.md)
+ - [Org.OpenAPITools.Model.User](docs/User.md)
+
+
+
+## Documentation for Authorization
+
+
+### api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+
+### petstore_auth
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - write:pets: modify pets in your account
+ - read:pets: read your pets
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh
new file mode 100644
index 0000000000..8e6e23eba0
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh
@@ -0,0 +1,12 @@
+wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe;
+mozroots --import --sync
+mono nuget.exe install vendor/packages.config -o vendor;
+mkdir -p bin;
+mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\
+vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\
+System.Runtime.Serialization.dll \
+-target:library \
+-out:bin/Org.OpenAPITools.dll \
+-recurse:'src/*.cs' \
+-doc:bin/Org.OpenAPITools.xml \
+-platform:anycpu
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md
new file mode 100644
index 0000000000..01b35815bd
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md
@@ -0,0 +1,11 @@
+# Org.OpenAPITools.Model.ApiResponse
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Code** | **int?** | | [optional]
+**Type** | **string** | | [optional]
+**Message** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md
new file mode 100644
index 0000000000..860a468e35
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md
@@ -0,0 +1,10 @@
+# Org.OpenAPITools.Model.Category
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Id** | **long?** | | [optional]
+**Name** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md
new file mode 100644
index 0000000000..984bd5ca06
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md
@@ -0,0 +1,14 @@
+# Org.OpenAPITools.Model.Order
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Id** | **long?** | | [optional]
+**PetId** | **long?** | | [optional]
+**Quantity** | **int?** | | [optional]
+**ShipDate** | **DateTime?** | | [optional]
+**Status** | **string** | Order Status | [optional]
+**Complete** | **bool?** | | [optional] [default to false]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md
new file mode 100644
index 0000000000..ce9fe873cd
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md
@@ -0,0 +1,14 @@
+# Org.OpenAPITools.Model.Pet
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Id** | **long?** | | [optional]
+**Category** | [**Category**](Category.md) | | [optional]
+**Name** | **string** | |
+**PhotoUrls** | **List** | |
+**Tags** | [**List**](Tag.md) | | [optional]
+**Status** | **string** | pet status in the store | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md
new file mode 100644
index 0000000000..0051c617a1
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md
@@ -0,0 +1,534 @@
+# Org.OpenAPITools.Api.PetApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
+[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
+[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
+[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
+[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
+[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
+[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
+
+
+
+# **AddPet**
+> void AddPet (Pet pet)
+
+Add a new pet to the store
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class AddPetExample
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var pet = new Pet(); // Pet | Pet object that needs to be added to the store
+
+ try
+ {
+ // Add a new pet to the store
+ apiInstance.AddPet(pet);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **DeletePet**
+> void DeletePet (long? petId, string apiKey)
+
+Deletes a pet
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class DeletePetExample
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var petId = 789; // long? | Pet id to delete
+ var apiKey = apiKey_example; // string | (optional)
+
+ try
+ {
+ // Deletes a pet
+ apiInstance.DeletePet(petId, apiKey);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **long?**| Pet id to delete |
+ **apiKey** | **string**| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **FindPetsByStatus**
+> List FindPetsByStatus (List status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class FindPetsByStatusExample
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var status = status_example; // List | Status values that need to be considered for filter
+
+ try
+ {
+ // Finds Pets by status
+ List<Pet> result = apiInstance.FindPetsByStatus(status);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | **List**| Status values that need to be considered for filter |
+
+### Return type
+
+[**List**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+# **FindPetsByTags**
+> List FindPetsByTags (List tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class FindPetsByTagsExample
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var tags = new List(); // List | Tags to filter by
+
+ try
+ {
+ // Finds Pets by tags
+ List<Pet> result = apiInstance.FindPetsByTags(tags);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List**](string.md)| Tags to filter by |
+
+### Return type
+
+[**List**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+# **GetPetById**
+> Pet GetPetById (long? petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class GetPetByIdExample
+ {
+ public void main()
+ {
+
+ // Configure API key authorization: api_key
+ Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
+ // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+ // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
+
+ var apiInstance = new PetApi();
+ var petId = 789; // long? | ID of pet to return
+
+ try
+ {
+ // Find pet by ID
+ Pet result = apiInstance.GetPetById(petId);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **long?**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+# **UpdatePet**
+> void UpdatePet (Pet pet)
+
+Update an existing pet
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class UpdatePetExample
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var pet = new Pet(); // Pet | Pet object that needs to be added to the store
+
+ try
+ {
+ // Update an existing pet
+ apiInstance.UpdatePet(pet);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **UpdatePetWithForm**
+> void UpdatePetWithForm (long? petId, string name, string status)
+
+Updates a pet in the store with form data
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class UpdatePetWithFormExample
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var petId = 789; // long? | ID of pet that needs to be updated
+ var name = name_example; // string | Updated name of the pet (optional)
+ var status = status_example; // string | Updated status of the pet (optional)
+
+ try
+ {
+ // Updates a pet in the store with form data
+ apiInstance.UpdatePetWithForm(petId, name, status);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **long?**| ID of pet that needs to be updated |
+ **name** | **string**| Updated name of the pet | [optional]
+ **status** | **string**| Updated status of the pet | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **UploadFile**
+> ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file)
+
+uploads an image
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class UploadFileExample
+ {
+ public void main()
+ {
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var petId = 789; // long? | ID of pet to update
+ var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
+ var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional)
+
+ try
+ {
+ // uploads an image
+ ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **long?**| ID of pet to update |
+ **additionalMetadata** | **string**| Additional data to pass to server | [optional]
+ **file** | **System.IO.Stream**| file to upload | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md
new file mode 100644
index 0000000000..76334b0ca4
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md
@@ -0,0 +1,258 @@
+# Org.OpenAPITools.Api.StoreApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
+[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
+[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
+[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
+
+
+
+# **DeleteOrder**
+> void DeleteOrder (string orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class DeleteOrderExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new StoreApi();
+ var orderId = orderId_example; // string | ID of the order that needs to be deleted
+
+ try
+ {
+ // Delete purchase order by ID
+ apiInstance.DeleteOrder(orderId);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **string**| ID of the order that needs to be deleted |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **GetInventory**
+> Dictionary GetInventory ()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class GetInventoryExample
+ {
+ public void main()
+ {
+
+ // Configure API key authorization: api_key
+ Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
+ // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+ // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
+
+ var apiInstance = new StoreApi();
+
+ try
+ {
+ // Returns pet inventories by status
+ Dictionary<string, int?> result = apiInstance.GetInventory();
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+**Dictionary**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+# **GetOrderById**
+> Order GetOrderById (long? orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class GetOrderByIdExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new StoreApi();
+ var orderId = 789; // long? | ID of pet that needs to be fetched
+
+ try
+ {
+ // Find purchase order by ID
+ Order result = apiInstance.GetOrderById(orderId);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **long?**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+# **PlaceOrder**
+> Order PlaceOrder (Order order)
+
+Place an order for a pet
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class PlaceOrderExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new StoreApi();
+ var order = new Order(); // Order | order placed for purchasing the pet
+
+ try
+ {
+ // Place an order for a pet
+ Order result = apiInstance.PlaceOrder(order);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md
new file mode 100644
index 0000000000..6a76c28595
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md
@@ -0,0 +1,10 @@
+# Org.OpenAPITools.Model.Tag
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Id** | **long?** | | [optional]
+**Name** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md
new file mode 100644
index 0000000000..04dd24a342
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md
@@ -0,0 +1,16 @@
+# Org.OpenAPITools.Model.User
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Id** | **long?** | | [optional]
+**Username** | **string** | | [optional]
+**FirstName** | **string** | | [optional]
+**LastName** | **string** | | [optional]
+**Email** | **string** | | [optional]
+**Password** | **string** | | [optional]
+**Phone** | **string** | | [optional]
+**UserStatus** | **int?** | User Status | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md
new file mode 100644
index 0000000000..dad1e50500
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md
@@ -0,0 +1,496 @@
+# Org.OpenAPITools.Api.UserApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user
+[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
+[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
+[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
+[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
+[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
+[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
+[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
+
+
+
+# **CreateUser**
+> void CreateUser (User user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class CreateUserExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+ var user = new User(); // User | Created user object
+
+ try
+ {
+ // Create user
+ apiInstance.CreateUser(user);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**User**](User.md)| Created user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **CreateUsersWithArrayInput**
+> void CreateUsersWithArrayInput (List user)
+
+Creates list of users with given input array
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class CreateUsersWithArrayInputExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+ var user = new List(); // List | List of user object
+
+ try
+ {
+ // Creates list of users with given input array
+ apiInstance.CreateUsersWithArrayInput(user);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List**](List.md)| List of user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **CreateUsersWithListInput**
+> void CreateUsersWithListInput (List user)
+
+Creates list of users with given input array
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class CreateUsersWithListInputExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+ var user = new List(); // List | List of user object
+
+ try
+ {
+ // Creates list of users with given input array
+ apiInstance.CreateUsersWithListInput(user);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List**](List.md)| List of user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **DeleteUser**
+> void DeleteUser (string username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class DeleteUserExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+ var username = username_example; // string | The name that needs to be deleted
+
+ try
+ {
+ // Delete user
+ apiInstance.DeleteUser(username);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **string**| The name that needs to be deleted |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **GetUserByName**
+> User GetUserByName (string username)
+
+Get user by user name
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class GetUserByNameExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+ var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
+
+ try
+ {
+ // Get user by user name
+ User result = apiInstance.GetUserByName(username);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **string**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+# **LoginUser**
+> string LoginUser (string username, string password)
+
+Logs user into the system
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class LoginUserExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+ var username = username_example; // string | The user name for login
+ var password = password_example; // string | The password for login in clear text
+
+ try
+ {
+ // Logs user into the system
+ string result = apiInstance.LoginUser(username, password);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **string**| The user name for login |
+ **password** | **string**| The password for login in clear text |
+
+### Return type
+
+**string**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+# **LogoutUser**
+> void LogoutUser ()
+
+Logs out current logged in user session
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class LogoutUserExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+
+ try
+ {
+ // Logs out current logged in user session
+ apiInstance.LogoutUser();
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[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)
+
+
+# **UpdateUser**
+> void UpdateUser (string username, User user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class UpdateUserExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new UserApi();
+ var username = username_example; // string | name that need to be deleted
+ var user = new User(); // User | Updated user object
+
+ try
+ {
+ // Updated user
+ apiInstance.UpdateUser(username, user);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **string**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs
new file mode 100644
index 0000000000..66e0f6ab5c
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs
@@ -0,0 +1,429 @@
+using System;
+using System.Collections.Generic;
+using RestSharp;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Org.OpenAPITools.Api
+{
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IPetApi
+ {
+ ///
+ /// Add a new pet to the store
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ void AddPet (Pet pet);
+ ///
+ /// Deletes a pet
+ ///
+ /// Pet id to delete
+ ///
+ ///
+ void DeletePet (long? petId, string apiKey);
+ ///
+ /// Finds Pets by status Multiple status values can be provided with comma separated strings
+ ///
+ /// Status values that need to be considered for filter
+ /// List<Pet>
+ List FindPetsByStatus (List status);
+ ///
+ /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Tags to filter by
+ /// List<Pet>
+ List FindPetsByTags (List tags);
+ ///
+ /// Find pet by ID Returns a single pet
+ ///
+ /// ID of pet to return
+ /// Pet
+ Pet GetPetById (long? petId);
+ ///
+ /// Update an existing pet
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ void UpdatePet (Pet pet);
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// ID of pet that needs to be updated
+ /// Updated name of the pet
+ /// Updated status of the pet
+ ///
+ void UpdatePetWithForm (long? petId, string name, string status);
+ ///
+ /// uploads an image
+ ///
+ /// ID of pet to update
+ /// Additional data to pass to server
+ /// file to upload
+ /// ApiResponse
+ ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file);
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public class PetApi : IPetApi
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// an instance of ApiClient (optional)
+ ///
+ public PetApi(ApiClient apiClient = null)
+ {
+ if (apiClient == null) // use the default one in Configuration
+ this.ApiClient = Configuration.DefaultApiClient;
+ else
+ this.ApiClient = apiClient;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ public PetApi(String basePath)
+ {
+ this.ApiClient = new ApiClient(basePath);
+ }
+
+ ///
+ /// Sets the base path of the API client.
+ ///
+ /// The base path
+ /// The base path
+ public void SetBasePath(String basePath)
+ {
+ this.ApiClient.BasePath = basePath;
+ }
+
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
+ /// The base path
+ public String GetBasePath(String basePath)
+ {
+ return this.ApiClient.BasePath;
+ }
+
+ ///
+ /// Gets or sets the API client.
+ ///
+ /// An instance of the ApiClient
+ public ApiClient ApiClient {get; set;}
+
+ ///
+ /// Add a new pet to the store
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ public void AddPet (Pet pet)
+ {
+
+ // verify the required parameter 'pet' is set
+ if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling AddPet");
+
+
+ var path = "/pet";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ postBody = ApiClient.Serialize(pet); // http body (model) parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Deletes a pet
+ ///
+ /// Pet id to delete
+ ///
+ ///
+ public void DeletePet (long? petId, string apiKey)
+ {
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Finds Pets by status Multiple status values can be provided with comma separated strings
+ ///
+ /// Status values that need to be considered for filter
+ /// List<Pet>
+ public List FindPetsByStatus (List status)
+ {
+
+ // verify the required parameter 'status' is set
+ if (status == null) throw new ApiException(400, "Missing required parameter 'status' when calling FindPetsByStatus");
+
+
+ var path = "/pet/findByStatus";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers);
+ }
+
+ ///
+ /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Tags to filter by
+ /// List<Pet>
+ public List FindPetsByTags (List tags)
+ {
+
+ // verify the required parameter 'tags' is set
+ if (tags == null) throw new ApiException(400, "Missing required parameter 'tags' when calling FindPetsByTags");
+
+
+ var path = "/pet/findByTags";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers);
+ }
+
+ ///
+ /// Find pet by ID Returns a single pet
+ ///
+ /// ID of pet to return
+ /// Pet
+ public Pet GetPetById (long? petId)
+ {
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "api_key" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers);
+ }
+
+ ///
+ /// Update an existing pet
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ public void UpdatePet (Pet pet)
+ {
+
+ // verify the required parameter 'pet' is set
+ if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling UpdatePet");
+
+
+ var path = "/pet";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ postBody = ApiClient.Serialize(pet); // http body (model) parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// ID of pet that needs to be updated
+ /// Updated name of the pet
+ /// Updated status of the pet
+ ///
+ public void UpdatePetWithForm (long? petId, string name, string status)
+ {
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter
+if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// uploads an image
+ ///
+ /// ID of pet to update
+ /// Additional data to pass to server
+ /// file to upload
+ /// ApiResponse
+ public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file)
+ {
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile");
+
+
+ var path = "/pet/{petId}/uploadImage";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter
+if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file));
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (ApiResponse) ApiClient.Deserialize(response.Content, typeof(ApiResponse), response.Headers);
+ }
+
+ }
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs
new file mode 100644
index 0000000000..3390bbbcab
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs
@@ -0,0 +1,236 @@
+using System;
+using System.Collections.Generic;
+using RestSharp;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Org.OpenAPITools.Api
+{
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IStoreApi
+ {
+ ///
+ /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ ///
+ /// ID of the order that needs to be deleted
+ ///
+ void DeleteOrder (string orderId);
+ ///
+ /// Returns pet inventories by status Returns a map of status codes to quantities
+ ///
+ /// Dictionary<string, int?>
+ Dictionary GetInventory ();
+ ///
+ /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Order
+ Order GetOrderById (long? orderId);
+ ///
+ /// Place an order for a pet
+ ///
+ /// order placed for purchasing the pet
+ /// Order
+ Order PlaceOrder (Order order);
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public class StoreApi : IStoreApi
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// an instance of ApiClient (optional)
+ ///
+ public StoreApi(ApiClient apiClient = null)
+ {
+ if (apiClient == null) // use the default one in Configuration
+ this.ApiClient = Configuration.DefaultApiClient;
+ else
+ this.ApiClient = apiClient;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ public StoreApi(String basePath)
+ {
+ this.ApiClient = new ApiClient(basePath);
+ }
+
+ ///
+ /// Sets the base path of the API client.
+ ///
+ /// The base path
+ /// The base path
+ public void SetBasePath(String basePath)
+ {
+ this.ApiClient.BasePath = basePath;
+ }
+
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
+ /// The base path
+ public String GetBasePath(String basePath)
+ {
+ return this.ApiClient.BasePath;
+ }
+
+ ///
+ /// Gets or sets the API client.
+ ///
+ /// An instance of the ApiClient
+ public ApiClient ApiClient {get; set;}
+
+ ///
+ /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ ///
+ /// ID of the order that needs to be deleted
+ ///
+ public void DeleteOrder (string orderId)
+ {
+
+ // verify the required parameter 'orderId' is set
+ if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder");
+
+
+ var path = "/store/order/{orderId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Returns pet inventories by status Returns a map of status codes to quantities
+ ///
+ /// Dictionary<string, int?>
+ public Dictionary GetInventory ()
+ {
+
+
+ var path = "/store/inventory";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "api_key" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers);
+ }
+
+ ///
+ /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Order
+ public Order GetOrderById (long? orderId)
+ {
+
+ // verify the required parameter 'orderId' is set
+ if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById");
+
+
+ var path = "/store/order/{orderId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers);
+ }
+
+ ///
+ /// Place an order for a pet
+ ///
+ /// order placed for purchasing the pet
+ /// Order
+ public Order PlaceOrder (Order order)
+ {
+
+ // verify the required parameter 'order' is set
+ if (order == null) throw new ApiException(400, "Missing required parameter 'order' when calling PlaceOrder");
+
+
+ var path = "/store/order";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ postBody = ApiClient.Serialize(order); // http body (model) parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers);
+ }
+
+ }
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs
new file mode 100644
index 0000000000..60a0ccac59
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs
@@ -0,0 +1,420 @@
+using System;
+using System.Collections.Generic;
+using RestSharp;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Org.OpenAPITools.Api
+{
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IUserApi
+ {
+ ///
+ /// Create user This can only be done by the logged in user.
+ ///
+ /// Created user object
+ ///
+ void CreateUser (User user);
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// List of user object
+ ///
+ void CreateUsersWithArrayInput (List user);
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// List of user object
+ ///
+ void CreateUsersWithListInput (List user);
+ ///
+ /// Delete user This can only be done by the logged in user.
+ ///
+ /// The name that needs to be deleted
+ ///
+ void DeleteUser (string username);
+ ///
+ /// Get user by user name
+ ///
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// User
+ User GetUserByName (string username);
+ ///
+ /// Logs user into the system
+ ///
+ /// The user name for login
+ /// The password for login in clear text
+ /// string
+ string LoginUser (string username, string password);
+ ///
+ /// Logs out current logged in user session
+ ///
+ ///
+ void LogoutUser ();
+ ///
+ /// Updated user This can only be done by the logged in user.
+ ///
+ /// name that need to be deleted
+ /// Updated user object
+ ///
+ void UpdateUser (string username, User user);
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public class UserApi : IUserApi
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// an instance of ApiClient (optional)
+ ///
+ public UserApi(ApiClient apiClient = null)
+ {
+ if (apiClient == null) // use the default one in Configuration
+ this.ApiClient = Configuration.DefaultApiClient;
+ else
+ this.ApiClient = apiClient;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ public UserApi(String basePath)
+ {
+ this.ApiClient = new ApiClient(basePath);
+ }
+
+ ///
+ /// Sets the base path of the API client.
+ ///
+ /// The base path
+ /// The base path
+ public void SetBasePath(String basePath)
+ {
+ this.ApiClient.BasePath = basePath;
+ }
+
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
+ /// The base path
+ public String GetBasePath(String basePath)
+ {
+ return this.ApiClient.BasePath;
+ }
+
+ ///
+ /// Gets or sets the API client.
+ ///
+ /// An instance of the ApiClient
+ public ApiClient ApiClient {get; set;}
+
+ ///
+ /// Create user This can only be done by the logged in user.
+ ///
+ /// Created user object
+ ///
+ public void CreateUser (User user)
+ {
+
+ // verify the required parameter 'user' is set
+ if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUser");
+
+
+ var path = "/user";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ postBody = ApiClient.Serialize(user); // http body (model) parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// List of user object
+ ///
+ public void CreateUsersWithArrayInput (List user)
+ {
+
+ // verify the required parameter 'user' is set
+ if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithArrayInput");
+
+
+ var path = "/user/createWithArray";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ postBody = ApiClient.Serialize(user); // http body (model) parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// List of user object
+ ///
+ public void CreateUsersWithListInput (List user)
+ {
+
+ // verify the required parameter 'user' is set
+ if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithListInput");
+
+
+ var path = "/user/createWithList";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ postBody = ApiClient.Serialize(user); // http body (model) parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Delete user This can only be done by the logged in user.
+ ///
+ /// The name that needs to be deleted
+ ///
+ public void DeleteUser (string username)
+ {
+
+ // verify the required parameter 'username' is set
+ if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser");
+
+
+ var path = "/user/{username}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Get user by user name
+ ///
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// User
+ public User GetUserByName (string username)
+ {
+
+ // verify the required parameter 'username' is set
+ if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName");
+
+
+ var path = "/user/{username}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers);
+ }
+
+ ///
+ /// Logs user into the system
+ ///
+ /// The user name for login
+ /// The password for login in clear text
+ /// string
+ public string LoginUser (string username, string password)
+ {
+
+ // verify the required parameter 'username' is set
+ if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling LoginUser");
+
+ // verify the required parameter 'password' is set
+ if (password == null) throw new ApiException(400, "Missing required parameter 'password' when calling LoginUser");
+
+
+ var path = "/user/login";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter
+ if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage);
+
+ return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers);
+ }
+
+ ///
+ /// Logs out current logged in user session
+ ///
+ ///
+ public void LogoutUser ()
+ {
+
+
+ var path = "/user/logout";
+ path = path.Replace("{format}", "json");
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ ///
+ /// Updated user This can only be done by the logged in user.
+ ///
+ /// name that need to be deleted
+ /// Updated user object
+ ///
+ public void UpdateUser (string username, User user)
+ {
+
+ // verify the required parameter 'username' is set
+ if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser");
+
+ // verify the required parameter 'user' is set
+ if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling UpdateUser");
+
+
+ var path = "/user/{username}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ postBody = ApiClient.Serialize(user); // http body (model) parameter
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400)
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content);
+ else if (((int)response.StatusCode) == 0)
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage);
+
+ return;
+ }
+
+ }
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs
new file mode 100644
index 0000000000..095f97997e
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs
@@ -0,0 +1,297 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text.RegularExpressions;
+using System.IO;
+using System.Web;
+using System.Linq;
+using System.Net;
+using System.Text;
+using Newtonsoft.Json;
+using RestSharp;
+using RestSharp.Extensions;
+
+namespace Org.OpenAPITools.Client
+{
+ ///
+ /// API client is mainly responible for making the HTTP call to the API backend.
+ ///
+ public class ApiClient
+ {
+ private readonly Dictionary _defaultHeaderMap = new Dictionary();
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The base path.
+ public ApiClient(String basePath="http://petstore.swagger.io/v2")
+ {
+ BasePath = basePath;
+ RestClient = new RestClient(BasePath);
+ }
+
+ ///
+ /// Gets or sets the base path.
+ ///
+ /// The base path
+ public string BasePath { get; set; }
+
+ ///
+ /// Gets or sets the RestClient.
+ ///
+ /// An instance of the RestClient
+ public RestClient RestClient { get; set; }
+
+ ///
+ /// Gets the default header.
+ ///
+ public Dictionary DefaultHeader
+ {
+ get { return _defaultHeaderMap; }
+ }
+
+ ///
+ /// Makes the HTTP request (Sync).
+ ///
+ /// URL path.
+ /// HTTP method.
+ /// Query parameters.
+ /// HTTP body (POST request).
+ /// Header parameters.
+ /// Form parameters.
+ /// File parameters.
+ /// Authentication settings.
+ /// Object
+ public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody,
+ Dictionary headerParams, Dictionary formParams,
+ Dictionary fileParams, String[] authSettings)
+ {
+
+ var request = new RestRequest(path, method);
+
+ UpdateParamsForAuth(queryParams, headerParams, authSettings);
+
+ // add default header, if any
+ foreach(var defaultHeader in _defaultHeaderMap)
+ request.AddHeader(defaultHeader.Key, defaultHeader.Value);
+
+ // add header parameter, if any
+ foreach(var param in headerParams)
+ request.AddHeader(param.Key, param.Value);
+
+ // add query parameter, if any
+ foreach(var param in queryParams)
+ request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost);
+
+ // add form parameter, if any
+ foreach(var param in formParams)
+ request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost);
+
+ // add file parameter, if any
+ foreach(var param in fileParams)
+ request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType);
+
+ if (postBody != null) // http body (model) parameter
+ request.AddParameter("application/json", postBody, ParameterType.RequestBody);
+
+ return (Object)RestClient.Execute(request);
+
+ }
+
+ ///
+ /// Add default header.
+ ///
+ /// Header field name.
+ /// Header field value.
+ ///
+ public void AddDefaultHeader(string key, string value)
+ {
+ _defaultHeaderMap.Add(key, value);
+ }
+
+ ///
+ /// Escape string (url-encoded).
+ ///
+ /// String to be escaped.
+ /// Escaped string.
+ public string EscapeString(string str)
+ {
+ return RestSharp.Contrib.HttpUtility.UrlEncode(str);
+ }
+
+ ///
+ /// Create FileParameter based on Stream.
+ ///
+ /// Parameter name.
+ /// Input stream.
+ /// FileParameter.
+ public FileParameter ParameterToFile(string name, Stream stream)
+ {
+ if (stream is FileStream)
+ return FileParameter.Create(name, stream.ReadAsBytes(), Path.GetFileName(((FileStream)stream).Name));
+ else
+ return FileParameter.Create(name, stream.ReadAsBytes(), "no_file_name_provided");
+ }
+
+ ///
+ /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
+ /// If parameter is a list of string, join the list with ",".
+ /// Otherwise just return the string.
+ ///
+ /// The parameter (header, path, query, form).
+ /// Formatted string.
+ public string ParameterToString(object obj)
+ {
+ if (obj is DateTime)
+ // Return a formatted date string - Can be customized with Configuration.DateTimeFormat
+ // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
+ // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
+ // For example: 2009-06-15T13:45:30.0000000
+ return ((DateTime)obj).ToString (Configuration.DateTimeFormat);
+ else if (obj is List)
+ return String.Join(",", (obj as List).ToArray());
+ else
+ return Convert.ToString (obj);
+ }
+
+ ///
+ /// Deserialize the JSON string into a proper object.
+ ///
+ /// HTTP body (e.g. string, JSON).
+ /// Object type.
+ /// HTTP headers.
+ /// Object representation of the JSON string.
+ public object Deserialize(string content, Type type, IList headers=null)
+ {
+ if (type == typeof(Object)) // return an object
+ {
+ return content;
+ }
+
+ if (type == typeof(Stream))
+ {
+ var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath)
+ ? Path.GetTempPath()
+ : Configuration.TempFolderPath;
+
+ var fileName = filePath + Guid.NewGuid();
+ if (headers != null)
+ {
+ var regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$");
+ var match = regex.Match(headers.ToString());
+ if (match.Success)
+ fileName = filePath + match.Value.Replace("\"", "").Replace("'", "");
+ }
+ File.WriteAllText(fileName, content);
+ return new FileStream(fileName, FileMode.Open);
+
+ }
+
+ if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
+ {
+ return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind);
+ }
+
+ if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type
+ {
+ return ConvertType(content, type);
+ }
+
+ // at this point, it must be a model (json)
+ try
+ {
+ return JsonConvert.DeserializeObject(content, type);
+ }
+ catch (IOException e)
+ {
+ throw new ApiException(500, e.Message);
+ }
+ }
+
+ ///
+ /// Serialize an object into JSON string.
+ ///
+ /// Object.
+ /// JSON string.
+ public string Serialize(object obj)
+ {
+ try
+ {
+ return obj != null ? JsonConvert.SerializeObject(obj) : null;
+ }
+ catch (Exception e)
+ {
+ throw new ApiException(500, e.Message);
+ }
+ }
+
+ ///
+ /// Get the API key with prefix.
+ ///
+ /// API key identifier (authentication scheme).
+ /// API key with prefix.
+ public string GetApiKeyWithPrefix (string apiKeyIdentifier)
+ {
+ var apiKeyValue = "";
+ Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue);
+ var apiKeyPrefix = "";
+ if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix))
+ return apiKeyPrefix + " " + apiKeyValue;
+ else
+ return apiKeyValue;
+ }
+
+ ///
+ /// Update parameters based on authentication.
+ ///
+ /// Query parameters.
+ /// Header parameters.
+ /// Authentication settings.
+ public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings)
+ {
+ if (authSettings == null || authSettings.Length == 0)
+ return;
+
+ foreach (string auth in authSettings)
+ {
+ // determine which one to use
+ switch(auth)
+ {
+ case "api_key":
+ headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
+
+ break;
+ case "petstore_auth":
+
+ //TODO support oauth
+ break;
+ default:
+ //TODO show warning about security definition not found
+ break;
+ }
+ }
+ }
+
+ ///
+ /// Encode string in base64 format.
+ ///
+ /// String to be encoded.
+ /// Encoded string.
+ public static string Base64Encode(string text)
+ {
+ var textByte = System.Text.Encoding.UTF8.GetBytes(text);
+ return System.Convert.ToBase64String(textByte);
+ }
+
+ ///
+ /// Dynamically cast the object into target type.
+ ///
+ /// Object to be casted
+ /// Target type
+ /// Casted object
+ public static Object ConvertType(Object fromObject, Type toObject) {
+ return Convert.ChangeType(fromObject, toObject);
+ }
+
+ }
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs
new file mode 100644
index 0000000000..7985897b93
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs
@@ -0,0 +1,47 @@
+using System;
+
+namespace Org.OpenAPITools.Client {
+ ///
+ /// API Exception
+ ///
+ public class ApiException : Exception {
+ ///
+ /// Gets or sets the error code (HTTP status code)
+ ///
+ /// The error code (HTTP status code).
+ public int ErrorCode { get; set; }
+
+ ///
+ /// Gets or sets the error content (body json object)
+ ///
+ /// The error content (Http response body).
+ public Object ErrorContent { get; private set; }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ApiException() {}
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// Error message.
+ public ApiException(int errorCode, string message) : base(message) {
+ this.ErrorCode = errorCode;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// Error message.
+ /// Error content.
+ public ApiException(int errorCode, string message, Object errorContent = null) : base(message) {
+ this.ErrorCode = errorCode;
+ this.ErrorContent = errorContent;
+ }
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs
new file mode 100644
index 0000000000..8cac9c7d9d
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs
@@ -0,0 +1,132 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+namespace Org.OpenAPITools.Client
+{
+ ///
+ /// Represents a set of configuration settings
+ ///
+ public class Configuration
+ {
+
+ ///
+ /// Version of the package.
+ ///
+ /// Version of the package.
+ public const string Version = "1.0.0";
+
+ ///
+ /// Gets or sets the default API client for making HTTP calls.
+ ///
+ /// The API client.
+ public static ApiClient DefaultApiClient = new ApiClient();
+
+ ///
+ /// Gets or sets the username (HTTP basic authentication).
+ ///
+ /// The username.
+ public static String Username { get; set; }
+
+ ///
+ /// Gets or sets the password (HTTP basic authentication).
+ ///
+ /// The password.
+ public static String Password { get; set; }
+
+ ///
+ /// Gets or sets the API key based on the authentication name.
+ ///
+ /// The API key.
+ public static Dictionary ApiKey = new Dictionary();
+
+ ///
+ /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
+ ///
+ /// The prefix of the API key.
+ public static Dictionary ApiKeyPrefix = new Dictionary();
+
+ private static string _tempFolderPath = Path.GetTempPath();
+
+ ///
+ /// Gets or sets the temporary folder path to store the files downloaded from the server.
+ ///
+ /// Folder path.
+ public static String TempFolderPath
+ {
+ get { return _tempFolderPath; }
+
+ set
+ {
+ if (String.IsNullOrEmpty(value))
+ {
+ _tempFolderPath = value;
+ return;
+ }
+
+ // create the directory if it does not exist
+ if (!Directory.Exists(value))
+ Directory.CreateDirectory(value);
+
+ // check if the path contains directory separator at the end
+ if (value[value.Length - 1] == Path.DirectorySeparatorChar)
+ _tempFolderPath = value;
+ else
+ _tempFolderPath = value + Path.DirectorySeparatorChar;
+ }
+ }
+
+ private const string ISO8601_DATETIME_FORMAT = "o";
+
+ private static string _dateTimeFormat = ISO8601_DATETIME_FORMAT;
+
+ ///
+ /// Gets or sets the the date time format used when serializing in the ApiClient
+ /// By default, it's set to ISO 8601 - "o", for others see:
+ /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
+ /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
+ /// No validation is done to ensure that the string you're providing is valid
+ ///
+ /// The DateTimeFormat string
+ public static String DateTimeFormat
+ {
+ get
+ {
+ return _dateTimeFormat;
+ }
+ set
+ {
+ if (string.IsNullOrEmpty(value))
+ {
+ // Never allow a blank or null string, go back to the default
+ _dateTimeFormat = ISO8601_DATETIME_FORMAT;
+ return;
+ }
+
+ // Caution, no validation when you choose date time format other than ISO 8601
+ // Take a look at the above links
+ _dateTimeFormat = value;
+ }
+ }
+
+ ///
+ /// Returns a string with essential information for debugging.
+ ///
+ public static String ToDebugReport()
+ {
+ String report = "C# SDK (Org.OpenAPITools) Debug Report:\n";
+ report += " OS: " + Environment.OSVersion + "\n";
+ report += " .NET Framework Version: " + Assembly
+ .GetExecutingAssembly()
+ .GetReferencedAssemblies()
+ .Where(x => x.Name == "System.Core").First().Version.ToString() + "\n";
+ report += " Version of the API: 1.0.0\n";
+ report += " SDK Package Version: 1.0.0\n";
+
+ return report;
+ }
+ }
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs
new file mode 100644
index 0000000000..648aaeba5b
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Model {
+
+ ///
+ /// Describes the result of uploading an image resource
+ ///
+ [DataContract]
+ public class ApiResponse {
+ ///
+ /// Gets or Sets Code
+ ///
+ [DataMember(Name="code", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "code")]
+ public int? Code { get; set; }
+
+ ///
+ /// Gets or Sets Type
+ ///
+ [DataMember(Name="type", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or Sets Message
+ ///
+ [DataMember(Name="message", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString() {
+ var sb = new StringBuilder();
+ sb.Append("class ApiResponse {\n");
+ sb.Append(" Code: ").Append(Code).Append("\n");
+ sb.Append(" Type: ").Append(Type).Append("\n");
+ sb.Append(" Message: ").Append(Message).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson() {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+
+}
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs
new file mode 100644
index 0000000000..847279502e
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Model {
+
+ ///
+ /// A category for a pet
+ ///
+ [DataContract]
+ public class Category {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "id")]
+ public long? Id { get; set; }
+
+ ///
+ /// Gets or Sets Name
+ ///
+ [DataMember(Name="name", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString() {
+ var sb = new StringBuilder();
+ sb.Append("class Category {\n");
+ sb.Append(" Id: ").Append(Id).Append("\n");
+ sb.Append(" Name: ").Append(Name).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson() {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+
+}
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs
new file mode 100644
index 0000000000..c19511ca3f
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Model {
+
+ ///
+ /// An order for a pets from the pet store
+ ///
+ [DataContract]
+ public class Order {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "id")]
+ public long? Id { get; set; }
+
+ ///
+ /// Gets or Sets PetId
+ ///
+ [DataMember(Name="petId", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "petId")]
+ public long? PetId { get; set; }
+
+ ///
+ /// Gets or Sets Quantity
+ ///
+ [DataMember(Name="quantity", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "quantity")]
+ public int? Quantity { get; set; }
+
+ ///
+ /// Gets or Sets ShipDate
+ ///
+ [DataMember(Name="shipDate", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "shipDate")]
+ public DateTime? ShipDate { get; set; }
+
+ ///
+ /// Order Status
+ ///
+ /// Order Status
+ [DataMember(Name="status", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "status")]
+ public string Status { get; set; }
+
+ ///
+ /// Gets or Sets Complete
+ ///
+ [DataMember(Name="complete", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "complete")]
+ public bool? Complete { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString() {
+ var sb = new StringBuilder();
+ sb.Append("class Order {\n");
+ sb.Append(" Id: ").Append(Id).Append("\n");
+ sb.Append(" PetId: ").Append(PetId).Append("\n");
+ sb.Append(" Quantity: ").Append(Quantity).Append("\n");
+ sb.Append(" ShipDate: ").Append(ShipDate).Append("\n");
+ sb.Append(" Status: ").Append(Status).Append("\n");
+ sb.Append(" Complete: ").Append(Complete).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson() {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+
+}
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs
new file mode 100644
index 0000000000..71ec62aa9c
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Model {
+
+ ///
+ /// A pet for sale in the pet store
+ ///
+ [DataContract]
+ public class Pet {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "id")]
+ public long? Id { get; set; }
+
+ ///
+ /// Gets or Sets Category
+ ///
+ [DataMember(Name="category", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "category")]
+ public Category Category { get; set; }
+
+ ///
+ /// Gets or Sets Name
+ ///
+ [DataMember(Name="name", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or Sets PhotoUrls
+ ///
+ [DataMember(Name="photoUrls", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "photoUrls")]
+ public List PhotoUrls { get; set; }
+
+ ///
+ /// Gets or Sets Tags
+ ///
+ [DataMember(Name="tags", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "tags")]
+ public List Tags { get; set; }
+
+ ///
+ /// pet status in the store
+ ///
+ /// pet status in the store
+ [DataMember(Name="status", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "status")]
+ public string Status { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString() {
+ var sb = new StringBuilder();
+ sb.Append("class Pet {\n");
+ sb.Append(" Id: ").Append(Id).Append("\n");
+ sb.Append(" Category: ").Append(Category).Append("\n");
+ sb.Append(" Name: ").Append(Name).Append("\n");
+ sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n");
+ sb.Append(" Tags: ").Append(Tags).Append("\n");
+ sb.Append(" Status: ").Append(Status).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson() {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+
+}
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs
new file mode 100644
index 0000000000..6399695a50
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Model {
+
+ ///
+ /// A tag for a pet
+ ///
+ [DataContract]
+ public class Tag {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "id")]
+ public long? Id { get; set; }
+
+ ///
+ /// Gets or Sets Name
+ ///
+ [DataMember(Name="name", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString() {
+ var sb = new StringBuilder();
+ sb.Append("class Tag {\n");
+ sb.Append(" Id: ").Append(Id).Append("\n");
+ sb.Append(" Name: ").Append(Name).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson() {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+
+}
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs
new file mode 100644
index 0000000000..c6af059dcd
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Model {
+
+ ///
+ /// A User who is purchasing from the pet store
+ ///
+ [DataContract]
+ public class User {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "id")]
+ public long? Id { get; set; }
+
+ ///
+ /// Gets or Sets Username
+ ///
+ [DataMember(Name="username", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "username")]
+ public string Username { get; set; }
+
+ ///
+ /// Gets or Sets FirstName
+ ///
+ [DataMember(Name="firstName", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "firstName")]
+ public string FirstName { get; set; }
+
+ ///
+ /// Gets or Sets LastName
+ ///
+ [DataMember(Name="lastName", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "lastName")]
+ public string LastName { get; set; }
+
+ ///
+ /// Gets or Sets Email
+ ///
+ [DataMember(Name="email", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "email")]
+ public string Email { get; set; }
+
+ ///
+ /// Gets or Sets Password
+ ///
+ [DataMember(Name="password", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "password")]
+ public string Password { get; set; }
+
+ ///
+ /// Gets or Sets Phone
+ ///
+ [DataMember(Name="phone", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// User Status
+ ///
+ /// User Status
+ [DataMember(Name="userStatus", EmitDefaultValue=false)]
+ [JsonProperty(PropertyName = "userStatus")]
+ public int? UserStatus { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString() {
+ var sb = new StringBuilder();
+ sb.Append("class User {\n");
+ sb.Append(" Id: ").Append(Id).Append("\n");
+ sb.Append(" Username: ").Append(Username).Append("\n");
+ sb.Append(" FirstName: ").Append(FirstName).Append("\n");
+ sb.Append(" LastName: ").Append(LastName).Append("\n");
+ sb.Append(" Email: ").Append(Email).Append("\n");
+ sb.Append(" Password: ").Append(Password).Append("\n");
+ sb.Append(" Phone: ").Append(Phone).Append("\n");
+ sb.Append(" UserStatus: ").Append(UserStatus).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson() {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+
+}
+}
diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config
new file mode 100644
index 0000000000..7b9cf18630
--- /dev/null
+++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs
index b9444fb360..1504638f6f 100644
--- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs
+++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs
@@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model
/// Validation Result
IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
{
- foreach(var x in BaseValidate(validationContext)) yield return x;
+ foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;
}
}
diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs
index 90c181c11b..ecd67f40b6 100644
--- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs
+++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs
@@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model
/// Validation Result
IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
{
- foreach(var x in BaseValidate(validationContext)) yield return x;
+ foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;
}
}
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION
index 096bf47efe..6d94c9c2e1 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.3.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md
index 441abc4088..a2b8a9b17a 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md
@@ -76,12 +76,12 @@ namespace Example
try
{
// To test special tags
- ModelClient result = apiInstance.TestSpecialTags(modelClient);
+ ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
Debug.WriteLine(result);
}
catch (Exception e)
{
- Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message );
+ Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
}
}
@@ -96,11 +96,12 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
-*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
+*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
+*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -116,6 +117,7 @@ Class | Method | HTTP request | Description
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
@@ -148,6 +150,8 @@ Class | Method | HTTP request | Description
- [Model.EnumArrays](docs/EnumArrays.md)
- [Model.EnumClass](docs/EnumClass.md)
- [Model.EnumTest](docs/EnumTest.md)
+ - [Model.File](docs/File.md)
+ - [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Model.FormatTest](docs/FormatTest.md)
- [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [Model.List](docs/List.md)
@@ -164,6 +168,7 @@ Class | Method | HTTP request | Description
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.Return](docs/Return.md)
- [Model.SpecialModelName](docs/SpecialModelName.md)
+ - [Model.StringBooleanMap](docs/StringBooleanMap.md)
- [Model.Tag](docs/Tag.md)
- [Model.User](docs/User.md)
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md
index 2dca444f27..81cc3106d6 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md
@@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
-[**TestSpecialTags**](AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
+[**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
-
-# **TestSpecialTags**
-> ModelClient TestSpecialTags (ModelClient modelClient)
+
+# **Call123TestSpecialTags**
+> ModelClient Call123TestSpecialTags (ModelClient modelClient)
To test special tags
-To test special tags
+To test special tags and operation ID starting with number
### Example
```csharp
@@ -25,7 +25,7 @@ using Org.OpenAPITools.Model;
namespace Example
{
- public class TestSpecialTagsExample
+ public class Call123TestSpecialTagsExample
{
public void main()
{
@@ -35,12 +35,12 @@ namespace Example
try
{
// To test special tags
- ModelClient result = apiInstance.TestSpecialTags(modelClient);
+ ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
Debug.WriteLine(result);
}
catch (Exception e)
{
- Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message );
+ Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
}
}
}
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md
index 2a4fb6094a..d51d29c09a 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md
@@ -8,6 +8,7 @@ Method | HTTP request | Description
[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
+[**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -159,7 +160,7 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
- var body = 1.2; // decimal? | Input number as post body (optional)
+ var body = 1.2D; // decimal? | Input number as post body (optional)
try
{
@@ -256,6 +257,65 @@ No authorization required
[[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)
+
+# **TestBodyWithFileSchema**
+> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass)
+
+
+
+For this test, the body for this request much reference a schema named `File`.
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class TestBodyWithFileSchemaExample
+ {
+ public void main()
+ {
+ var apiInstance = new FakeApi();
+ var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
+
+ try
+ {
+ apiInstance.TestBodyWithFileSchema(fileSchemaTestClass);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[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)
+
# **TestBodyWithQueryParams**
> void TestBodyWithQueryParams (string query, User user)
@@ -404,13 +464,13 @@ namespace Example
var apiInstance = new FakeApi();
var number = 8.14; // decimal? | None
- var _double = 1.2; // double? | None
+ var _double = 1.2D; // double? | None
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None
var integer = 56; // int? | None (optional)
var int32 = 56; // int? | None (optional)
var int64 = 789; // long? | None (optional)
- var _float = 3.4; // float? | None (optional)
+ var _float = 3.4F; // float? | None (optional)
var _string = _string_example; // string | None (optional)
var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional)
var date = 2013-10-20; // DateTime? | None (optional)
@@ -494,8 +554,8 @@ namespace Example
var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional)
var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg)
var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional)
- var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional)
- var enumFormStringArray = enumFormStringArray_example; // List | Form parameter enum test (string array) (optional) (default to $)
+ var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional)
+ var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $)
var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg)
try
@@ -522,7 +582,7 @@ Name | Type | Description | Notes
**enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg]
**enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional]
- **enumFormStringArray** | **List<string>**| Form parameter enum test (string array) | [optional] [default to $]
+ **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $]
**enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg]
### Return type
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/File.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/File.md
new file mode 100644
index 0000000000..acf85a4c00
--- /dev/null
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/File.md
@@ -0,0 +1,9 @@
+# Org.OpenAPITools.Model.File
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**SourceURI** | **string** | Test capitalization | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FileSchemaTestClass.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FileSchemaTestClass.md
new file mode 100644
index 0000000000..e0820fa4e6
--- /dev/null
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FileSchemaTestClass.md
@@ -0,0 +1,10 @@
+# Org.OpenAPITools.Model.FileSchemaTestClass
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**File** | **System.IO.Stream** | | [optional]
+**Files** | **List<System.IO.Stream>** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md
index 2baba08d85..ee62dbf135 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md
@@ -5,6 +5,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional]
**MapOfEnumString** | **Dictionary<string, string>** | | [optional]
+**DirectMap** | **Dictionary<string, bool?>** | | [optional]
+**IndirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md
index 244ece53a3..dd23df9b36 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md
@@ -12,6 +12,7 @@ Method | HTTP request | Description
[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
@@ -524,3 +525,69 @@ Name | Type | Description | Notes
[[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)
+
+# **UploadFileWithRequiredFile**
+> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null)
+
+uploads an image (required)
+
+### Example
+```csharp
+using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class UploadFileWithRequiredFileExample
+ {
+ public void main()
+ {
+ // Configure OAuth2 access token for authorization: petstore_auth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ var apiInstance = new PetApi();
+ var petId = 789; // long? | ID of pet to update
+ var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload
+ var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
+
+ try
+ {
+ // uploads an image (required)
+ ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message );
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **long?**| ID of pet to update |
+ **requiredFile** | **System.IO.Stream**| file to upload |
+ **additionalMetadata** | **string**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StringBooleanMap.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StringBooleanMap.md
new file mode 100644
index 0000000000..6e7a71368d
--- /dev/null
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StringBooleanMap.md
@@ -0,0 +1,8 @@
+# Org.OpenAPITools.Model.StringBooleanMap
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs
new file mode 100644
index 0000000000..bb47c43dc7
--- /dev/null
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs
@@ -0,0 +1,88 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using NUnit.Framework;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Client;
+using System.Reflection;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Test
+{
+ ///
+ /// Class for testing FileSchemaTestClass
+ ///
+ ///
+ /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
+ /// Please update the test case below to test the model.
+ ///
+ [TestFixture]
+ public class FileSchemaTestClassTests
+ {
+ // TODO uncomment below to declare an instance variable for FileSchemaTestClass
+ //private FileSchemaTestClass instance;
+
+ ///
+ /// Setup before each test
+ ///
+ [SetUp]
+ public void Init()
+ {
+ // TODO uncomment below to create an instance of FileSchemaTestClass
+ //instance = new FileSchemaTestClass();
+ }
+
+ ///
+ /// Clean up after each test
+ ///
+ [TearDown]
+ public void Cleanup()
+ {
+
+ }
+
+ ///
+ /// Test an instance of FileSchemaTestClass
+ ///
+ [Test]
+ public void FileSchemaTestClassInstanceTest()
+ {
+ // TODO uncomment below to test "IsInstanceOfType" FileSchemaTestClass
+ //Assert.IsInstanceOfType (instance, "variable 'instance' is a FileSchemaTestClass");
+ }
+
+
+ ///
+ /// Test the property 'File'
+ ///
+ [Test]
+ public void FileTest()
+ {
+ // TODO unit test for the property 'File'
+ }
+ ///
+ /// Test the property 'Files'
+ ///
+ [Test]
+ public void FilesTest()
+ {
+ // TODO unit test for the property 'Files'
+ }
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/FileTests.cs
new file mode 100644
index 0000000000..f1cf54c22e
--- /dev/null
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/FileTests.cs
@@ -0,0 +1,80 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using NUnit.Framework;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Client;
+using System.Reflection;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Test
+{
+ ///
+ /// Class for testing File
+ ///
+ ///
+ /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
+ /// Please update the test case below to test the model.
+ ///
+ [TestFixture]
+ public class FileTests
+ {
+ // TODO uncomment below to declare an instance variable for File
+ //private File instance;
+
+ ///
+ /// Setup before each test
+ ///
+ [SetUp]
+ public void Init()
+ {
+ // TODO uncomment below to create an instance of File
+ //instance = new File();
+ }
+
+ ///
+ /// Clean up after each test
+ ///
+ [TearDown]
+ public void Cleanup()
+ {
+
+ }
+
+ ///
+ /// Test an instance of File
+ ///
+ [Test]
+ public void FileInstanceTest()
+ {
+ // TODO uncomment below to test "IsInstanceOfType" File
+ //Assert.IsInstanceOfType (instance, "variable 'instance' is a File");
+ }
+
+
+ ///
+ /// Test the property 'SourceURI'
+ ///
+ [Test]
+ public void SourceURITest()
+ {
+ // TODO unit test for the property 'SourceURI'
+ }
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/StringBooleanMapTests.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/StringBooleanMapTests.cs
new file mode 100644
index 0000000000..efc4cd9077
--- /dev/null
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/StringBooleanMapTests.cs
@@ -0,0 +1,72 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using NUnit.Framework;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Client;
+using System.Reflection;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Test
+{
+ ///
+ /// Class for testing StringBooleanMap
+ ///
+ ///
+ /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
+ /// Please update the test case below to test the model.
+ ///
+ [TestFixture]
+ public class StringBooleanMapTests
+ {
+ // TODO uncomment below to declare an instance variable for StringBooleanMap
+ //private StringBooleanMap instance;
+
+ ///
+ /// Setup before each test
+ ///
+ [SetUp]
+ public void Init()
+ {
+ // TODO uncomment below to create an instance of StringBooleanMap
+ //instance = new StringBooleanMap();
+ }
+
+ ///
+ /// Clean up after each test
+ ///
+ [TearDown]
+ public void Cleanup()
+ {
+
+ }
+
+ ///
+ /// Test an instance of StringBooleanMap
+ ///
+ [Test]
+ public void StringBooleanMapInstanceTest()
+ {
+ // TODO uncomment below to test "IsInstanceOfType" StringBooleanMap
+ //Assert.IsInstanceOfType (instance, "variable 'instance' is a StringBooleanMap");
+ }
+
+
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs
index be68c4ede5..193c4907a1 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs
@@ -28,23 +28,23 @@ namespace Org.OpenAPITools.Api
/// To test special tags
///
///
- /// To test special tags
+ /// To test special tags and operation ID starting with number
///
/// Thrown when fails to make API call
/// client model
/// ModelClient
- ModelClient TestSpecialTags (ModelClient modelClient);
+ ModelClient Call123TestSpecialTags (ModelClient modelClient);
///
/// To test special tags
///
///
- /// To test special tags
+ /// To test special tags and operation ID starting with number
///
/// Thrown when fails to make API call
/// client model
/// ApiResponse of ModelClient
- ApiResponse TestSpecialTagsWithHttpInfo (ModelClient modelClient);
+ ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient);
#endregion Synchronous Operations
}
@@ -146,28 +146,28 @@ namespace Org.OpenAPITools.Api
}
///
- /// To test special tags To test special tags
+ /// To test special tags To test special tags and operation ID starting with number
///
/// Thrown when fails to make API call
/// client model
/// ModelClient
- public ModelClient TestSpecialTags (ModelClient modelClient)
+ public ModelClient Call123TestSpecialTags (ModelClient modelClient)
{
- ApiResponse localVarResponse = TestSpecialTagsWithHttpInfo(modelClient);
+ ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(modelClient);
return localVarResponse.Data;
}
///
- /// To test special tags To test special tags
+ /// To test special tags To test special tags and operation ID starting with number
///
/// Thrown when fails to make API call
/// client model
/// ApiResponse of ModelClient
- public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient modelClient)
+ public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient)
{
// verify the required parameter 'modelClient' is set
if (modelClient == null)
- throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->TestSpecialTags");
+ throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags");
var localVarPath = "/another-fake/dummy";
var localVarPathParams = new Dictionary();
@@ -210,7 +210,7 @@ namespace Org.OpenAPITools.Api
if (ExceptionFactory != null)
{
- Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse);
+ Exception exception = ExceptionFactory("Call123TestSpecialTags", localVarResponse);
if (exception != null) throw exception;
}
diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs
index c9d0b50be1..20430b4bbd 100644
--- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs
+++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs
@@ -112,6 +112,27 @@ namespace Org.OpenAPITools.Api
///
///
///
+ /// For this test, the body for this request much reference a schema named `File`.
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass);
+
+ ///
+ ///
+ ///
+ ///
+ /// For this test, the body for this request much reference a schema named `File`.
+ ///
+ /// Thrown when fails to make API call
+ ///
+ /// ApiResponse of Object(void)
+ ApiResponse