Merge remote-tracking branch 'origin/master' into 2.3.0

This commit is contained in:
wing328 2017-07-01 15:47:27 +08:00
commit 9269dac6cf
340 changed files with 4075 additions and 1014 deletions

View File

@ -88,20 +88,24 @@ script:
- set -e
# fail if templates/generators contain carriage return '\r'
- /bin/bash ./bin/utils/detect_carriage_return.sh
# fail if generators contain merge conflicts
- /bin/bash ./bin/utils/detect_merge_conflict.sh
# fail if generators contain tab '\t'
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
# run integration tests defined in maven pom.xml
- mvn -q --batch-mode verify -Psamples
### docker-related tasks have been moved to CircleCI
# docker: build generator image and push to Docker Hub
#- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi
## docker: build cli image and push to Docker Hub
#- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi
env:
- DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli
#env:
# - DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli
after_success:
- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ $TRAVIS_PULL_REQUEST == false ]; then
# push a snapshot version to maven repo
- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_BRANCH" = "master" ]; then
mvn clean deploy --settings .travis/settings.xml;
echo "Finished mvn clean deploy";
fi;

View File

@ -27,6 +27,7 @@ This is the swagger codegen project, which allows generation of API client libra
- **API clients**: **ActionScript**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Kotlin**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node)
- **Server stubs**: **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra)
- **API documentation generators**: **HTML**, **Confluence Wiki**
- **Configuration files**: [**Apache2**](https://httpd.apache.org/)
- **Others**: **JMeter**
Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project.
@ -775,6 +776,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
- [Kubernetes](https://kubernetes.io/)
- [LANDR Audio](https://www.landr.com/)
- [Lascaux](http://www.lascaux.it/)
- [Leanix](http://www.leanix.net/)
- [Leica Geosystems AG](http://leica-geosystems.com)
- [LiveAgent](https://www.ladesk.com/)
- [LXL Tech](http://lxltech.com)
@ -968,6 +970,8 @@ Here is a list of template creators:
* Documentation
* HTML Doc 2: @jhitchcock
* Confluence Wiki: @jhitchcock
* Configuration
* Apache2: @stkrwork
## How to join the core team

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l javascript-closure-angular -o samples/client/petstore/javascript-closure-angular"
ags="generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l javascript-closure-angular -o samples/client/petstore/javascript-closure-angular $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,9 +26,9 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \
ags="generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \
-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \
-o samples/client/petstore/javascript-es6 \
--additional-properties useES6=true"
--additional-properties useES6=true $@"
java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples/client/petstore/javascript -DappName=PetstoreClient --additional-properties useES6=false"
ags="generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples/client/petstore/javascript -DappName=PetstoreClient --additional-properties useES6=false $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,9 +26,9 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \
ags="generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \
-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \
-o samples/client/petstore/javascript-promise-es6 \
--additional-properties usePromises=true,useES6=true"
--additional-properties usePromises=true,useES6=true $@"
java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags

View File

@ -26,12 +26,12 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate \
ags="generate \
-t modules/swagger-codegen/src/main/resources/Javascript \
-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml \
-l javascript \
-o samples/client/petstore/javascript-promise \
--additional-properties usePromises=true,useES6=false \
-DappName=PetstoreClient"
-DappName=PetstoreClient $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/php -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l php -o samples/client/petstore/php"
ags="generate -t modules/swagger-codegen/src/main/resources/php -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l php -o samples/client/petstore/php $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/python -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l python -o samples/client/petstore/python -DpackageName=petstore_api"
ags="generate -t modules/swagger-codegen/src/main/resources/python -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l python -o samples/client/petstore/python -DpackageName=petstore_api $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/ruby -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby"
ags="generate -t modules/swagger-codegen/src/main/resources/ruby -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore-promisekit.json -o samples/client/petstore/swift/promisekit"
ags="generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore-promisekit.json -o samples/client/petstore/swift/promisekit $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore-rxswift.json -o samples/client/petstore/swift/rxswift"
ags="generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore-rxswift.json -o samples/client/petstore/swift/rxswift $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore.json -o samples/client/petstore/swift/default"
ags="generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore.json -o samples/client/petstore/swift/default $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-promisekit.json -o samples/client/petstore/swift3/promisekit"
ags="generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-promisekit.json -o samples/client/petstore/swift3/promisekit $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-rxswift.json -o samples/client/petstore/swift3/rxswift"
ags="generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-rxswift.json -o samples/client/petstore/swift3/rxswift $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore.json -o samples/client/petstore/swift3/default"
ags="generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore.json -o samples/client/petstore/swift3/default $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -0,0 +1,17 @@
#!/bin/bash
# grep for '<<<<<<< HEAD' in swagger codegen
grep -RUIl '<<<<<<< HEAD' modules/swagger-codegen/src
if [ $? -ne 1 ]; then
echo "modules/swagger-codegen/src contain merge conflicts '<<<<<<< HEAD'. Please remove it and try again."
exit 1;
fi
# grep for '<<<<<<< HEAD' in the samples
grep -RUIl '<<<<<<< HEAD' samples/
if [ $? -ne 1 ]; then
echo "samples/ contain merge conflicts '<<<<<<< HEAD'. Please remove it and try again."
exit 1;
fi

View File

@ -120,7 +120,7 @@
<properties>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.22.2</jersey-version>
<jackson-version>2.7.0</jackson-version>
<jackson-version>2.8.9</jackson-version>
<jodatime-version>2.7</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.8.1</junit-version>

View File

@ -13,6 +13,9 @@
<name>swagger-codegen (maven-plugin)</name>
<packaging>maven-plugin</packaging>
<description>maven plugin to build modules from swagger codegen</description>
<prerequisites>
<maven>3.2.5</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

View File

@ -2579,8 +2579,8 @@ public class DefaultCodegen {
name = typeMapping.get(name);
p.baseType = name;
} else {
p.baseType = name;
name = toModelName(name);
p.baseType = name;
if (defaultIncludes.contains(name)) {
imports.add(name);
}

View File

@ -78,8 +78,8 @@ public class Apache2ConfigCodegen extends DefaultCodegen implements CodegenConfi
item = "*";
}
splitPath.add(item);
op.path += item + "/";
}
op.path = String.join("/", splitPath);
op.vendorExtensions.put("x-codegen-userInfoPath", userInfoPath);
boolean foundInNewList = false;
for (CodegenOperation op1 : newOpList) {

View File

@ -266,7 +266,7 @@
<swagger-core-version>1.5.15</swagger-core-version>
<feign-version>9.4.0</feign-version>
<feign-form-version>2.1.0</feign-form-version>
<jackson-version>2.8.7</jackson-version>
<jackson-version>2.8.9</jackson-version>
{{#threetenbp}}
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
{{/threetenbp}}

View File

@ -243,7 +243,6 @@
<version>${jackson-version}</version>
</dependency>
{{/threetenbp}}
{{^java8}}
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
@ -258,14 +257,12 @@
<artifactId>commons-lang3</artifactId>
<version>${commons_lang3_version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons_io_version}</version>
</dependency>
{{/supportJava6}}
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>

View File

@ -206,7 +206,7 @@
<properties>
<swagger-core-version>1.5.15</swagger-core-version>
<resteasy-version>3.1.3.Final</resteasy-version>
<jackson-version>2.7.5</jackson-version>
<jackson-version>2.8.9</jackson-version>
{{^java8}}
<jodatime-version>2.9.9</jodatime-version>
{{/java8}}

View File

@ -244,7 +244,6 @@
<version>${jackson-version}</version>
</dependency>
{{/threetenbp}}
{{^java8}}
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
@ -253,14 +252,12 @@
<version>2.2</version>
</dependency>
{{/java8}}
{{#supportJava6}}
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons_lang3_version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
@ -276,7 +273,6 @@
<scope>provided</scope>
</dependency>
{{/useBeanValidation}}
{{#parcelableModel}}
<!-- Needed for Parcelable support-->
<dependency>
@ -286,7 +282,6 @@
<scope>provided</scope>
</dependency>
{{/parcelableModel}}
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>

View File

@ -35,7 +35,7 @@
<!-- Java EE 7 doesn't need a web.xml -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
@ -89,4 +89,4 @@
</dependencies>
</project>
</project>

View File

@ -80,7 +80,7 @@
<!-- build WAR file -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
@ -212,7 +212,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>2.1.8-M1</version>
<version>3.0.17</version>
</dependency>
{{/useSwaggerUI}}
</dependencies>
@ -238,10 +238,10 @@
<beanvalidation-version>1.1.0.Final</beanvalidation-version>
{{/useBeanValidation}}
{{#generateSpringApplication}}
<spring-version>4.2.5.RELEASE</spring-version>
<spring-version>4.3.9.RELEASE</spring-version>
{{/generateSpringApplication}}
{{#generateSpringBootApplication}}
<spring.boot-version>1.3.3.RELEASE</spring.boot-version>
<spring.boot-version>1.4.7.RELEASE</spring.boot-version>
{{/generateSpringBootApplication}}
<cxf-version>3.1.11</cxf-version>
<jackson-jaxrs-version>2.8.9</jackson-jaxrs-version>

View File

@ -11,7 +11,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
@ -194,7 +194,7 @@
<swagger-core-version>1.5.15</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<jersey-version>1.19.1</jersey-version>
<jackson-version>2.8.7</jackson-version>
<jackson-version>2.8.9</jackson-version>
<slf4j-version>1.7.21</slf4j-version>
<junit-version>4.12</junit-version>
<servlet-api-version>2.5</servlet-api-version>

View File

@ -20,7 +20,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
@ -191,7 +191,7 @@
<swagger-core-version>1.5.15</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<jersey2-version>2.22.2</jersey2-version>
<jackson-version>2.8.7</jackson-version>
<jackson-version>2.8.9</jackson-version>
{{#supportJava6}}
<commons_io_version>2.5</commons_io_version>
<commons_lang3_version>3.5</commons_lang3_version>

View File

@ -12,7 +12,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>

View File

@ -12,7 +12,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>

View File

@ -11,7 +11,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>

View File

@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.5.RELEASE</version>
<version>1.4.7.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<version>1.4.7.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -11,7 +11,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
@ -160,7 +160,7 @@
<junit-version>4.12</junit-version>
<servlet-api-version>2.5</servlet-api-version>
<springfox-version>2.6.0</springfox-version>
<jackson-version>2.6.4</jackson-version>
<spring-version>4.2.5.RELEASE</spring-version>
<jackson-version>2.8.9</jackson-version>
<spring-version>4.3.9.RELEASE</spring-version>
</properties>
</project>

View File

@ -120,11 +120,11 @@ export const {{classname}}FetchParamCreator = {
{{#hasHeaderParams}}
fetchOptions.headers = {{#supportsES6}}Object.{{/supportsES6}}assign({
{{#headerParams}}"{{baseName}}": params["{{paramName}}"],{{/headerParams}}
}, contentTypeHeader);
}, contentTypeHeader, fetchOptions.headers);
{{/hasHeaderParams}}
{{^hasHeaderParams}}
if (contentTypeHeader) {
fetchOptions.headers = contentTypeHeader;
fetchOptions.headers = {{#supportsES6}}Object.{{/supportsES6}}assign({}, contentTypeHeader, fetchOptions.headers);
}
{{/hasHeaderParams}}
{{#authMethods}}

View File

@ -67,10 +67,10 @@
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
@ -78,9 +78,11 @@
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
</Reference>
{{#generatePropertyChanged}}<Reference Include="PropertyChanged">
{{#generatePropertyChanged}}
<Reference Include="PropertyChanged">
<HintPath>..\..\packages\PropertyChanged.Fody.1.51.3\Lib\portable-net4+sl4+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
</Reference>{{/generatePropertyChanged}}
</Reference>
{{/generatePropertyChanged}}
{{/netStandard}}
{{#netStandard}}
<!-- A reference to the entire .NET Framework is automatically included -->
@ -94,10 +96,13 @@
{{^netStandard}}
<ItemGroup>
<None Include="packages.config" />
{{#generatePropertyChanged}}<None Include="FodyWeavers.xml" />{{/generatePropertyChanged}}
{{#generatePropertyChanged}}
<None Include="FodyWeavers.xml" />
{{/generatePropertyChanged}}
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />{{#generatePropertyChanged}}
<Import Project="..\..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
{{#generatePropertyChanged}}
<Import Project="..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
{{/generatePropertyChanged}}
{{/netStandard}}
{{#netStandard}}

View File

@ -59,10 +59,10 @@
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>

View File

@ -15,10 +15,10 @@ mono nuget.exe install src/{{packageName}}/packages.config -o packages;
echo "[INFO] Copy DLLs to the 'bin' folder"
mkdir -p bin;
cp packages/Newtonsoft.Json.8.0.3/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/Newtonsoft.Json.10.0.3/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll;
{{#generatePropertyChanged}}
cp packages/Fody.1.29.2/Fody.dll bin/Fody.dll
cp packages/Fody.1.29.4/Fody.dll bin/Fody.dll
cp packages/PropertyChanged.Fody.1.51.3/PropertyChanged.Fody.dll bin/PropertyChanged.Fody.dll
cp packages/PropertyChanged.Fody.1.51.3/Lib/dotnet/PropertyChanged.dll bin/PropertyChanged.dll
{{/generatePropertyChanged}}

View File

@ -15,10 +15,10 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
if not exist ".\bin" mkdir bin
copy packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll bin\RestSharp.dll
{{#generatePropertyChanged}}
copy packages\Fody.1.29.2\Fody.dll bin\Fody.dll
copy packages\Fody.1.29.4\Fody.dll bin\Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll
{{/generatePropertyChanged}}

View File

@ -19,17 +19,23 @@
<!-- The description can be used in package manager UI. Note that the
nuget.org gallery uses information you add in the portal. -->
<description>{{packageDescription}}</description>{{#termsOfService}}
<copyright>{{termsOfService}}</copyright>{{/termsOfService}}{{#licenseUrl}}
<licenseUrl>{{licenseUrl}}</licenseUrl>{{/licenseUrl}}
<description>{{packageDescription}}</description>
{{#termsOfService}}
<copyright>{{termsOfService}}</copyright>
{{/termsOfService}}
{{#licenseUrl}}
<licenseUrl>{{licenseUrl}}</licenseUrl>
{{/licenseUrl}}
<!-- Dependencies are automatically installed when the package is installed -->
<dependencies>
<dependency id="NewtonSoft.Json" version="8.0.3" />
<dependency id="RestSharp" version="105.1.0" />{{#generatePropertyChanged}}
<dependency id="Fody" version="1.29.2" />
<dependency id="PropertyChanged.Fody" version="1.51.3" />{{/generatePropertyChanged}}
<dependency id="NewtonSoft.Json" version="10.0.3" />
<dependency id="RestSharp" version="105.1.0" />
{{#generatePropertyChanged}}
<dependency id="Fody" version="1.29.4" />
<dependency id="PropertyChanged.Fody" version="1.51.3" />
{{/generatePropertyChanged}}
</dependencies>
</metadata>
@ -37,9 +43,10 @@
<!-- A readme.txt will be displayed when the package is installed -->
<file src="..\..\README.md" target="" />
<file src="..\..\docs\**\*.*" target="docs" />{{#generatePropertyChanged}}
<file src="..\..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" />
{{/generatePropertyChanged}}
<file src="..\..\docs\**\*.*" target="docs" />
{{#generatePropertyChanged}}
<file src="..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" />
{{/generatePropertyChanged}}
</files>
</package>
</package>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.1.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
{{#generatePropertyChanged}}
<package id="Fody" version="1.29.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
{{/generatePropertyChanged}}
</packages>

View File

@ -2,5 +2,5 @@
<packages>
<package id="NUnit" version="2.6.4" targetFramework="{{targetFrameworkNuget}}" />
<package id="RestSharp" version="105.1.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
</packages>

View File

@ -7,166 +7,11 @@ using NodaTime;
{{#imports}}using {{import}};
{{/imports}}
{{#models}}
{{#model}}
namespace {{packageName}}.{{packageContext}}.Models
{
/// <summary>
/// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
/// </summary>
public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>
{ {{#vars}}{{^isInherited}}
/// <summary>
/// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
/// </summary>
public {{>nullableDataType}} {{name}} { get; private set; }
{{/isInherited}}{{/vars}}
/// <summary>
/// Empty constructor required by some serializers.
/// Use {{classname}}.Builder() for instance creation instead.
/// </summary>
[Obsolete]
public {{classname}}(){{#parent}} : base({{/parent}}{{#parentVars}}null{{#hasMore}}, {{/hasMore}}{{/parentVars}}{{#parent}}){{/parent}}
{
}
{{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{classname}}({{#vars}}{{>nullableDataType}} {{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}){{#parent}} : base({{#parentVars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/parentVars}}){{/parent}}
{
{{#vars}}{{^isInherited}}
this.{{name}} = {{name}};
{{/isInherited}}{{/vars}}
}
/// <summary>
/// Returns builder of {{classname}}.
/// </summary>
/// <returns>{{classname}}Builder</returns>
public static {{#parent}}new {{/parent}}{{classname}}Builder Builder()
{
return new {{classname}}Builder();
}
/// <summary>
/// Returns {{classname}}Builder with properties set.
/// Use it to change properties.
/// </summary>
/// <returns>{{classname}}Builder</returns>
public {{#parent}}new {{/parent}}{{classname}}Builder With()
{
return Builder()
{{#vars}}
.{{name}}({{name}}){{#hasMore}}
{{/hasMore}}{{/vars}};
}
public override string ToString()
{
return this.PropertiesToString();
}
public override bool Equals(object obj)
{
return this.EqualsByProperties(obj);
}
public bool Equals({{classname}} other)
{
return Equals((object) other);
}
public override int GetHashCode()
{
return this.PropertiesHash();
}
/// <summary>
/// Implementation of == operator for ({{classname}}.
/// </summary>
/// <param name="left">Compared ({{classname}}</param>
/// <param name="right">Compared ({{classname}}</param>
/// <returns>true if compared items are equals, false otherwise</returns>
public static bool operator == ({{classname}} left, {{classname}} right)
{
return Equals(left, right);
}
/// <summary>
/// Implementation of != operator for ({{classname}}.
/// </summary>
/// <param name="left">Compared ({{classname}}</param>
/// <param name="right">Compared ({{classname}}</param>
/// <returns>true if compared items are not equals, false otherwise</returns>
public static bool operator != ({{classname}} left, {{classname}} right)
{
return !Equals(left, right);
}
/// <summary>
/// Builder of {{classname}}.
/// </summary>
public sealed class {{classname}}Builder
{
{{#vars}}
private {{>nullableDataType}} _{{name}};
{{/vars}}
internal {{classname}}Builder()
{
SetupDefaults();
}
private void SetupDefaults()
{
{{#vars}}
{{^required}}
{{#defaultValue}}
_{{name}} = {{{defaultValue}}};
{{/defaultValue}}
{{/required}}
{{/vars}}
}
{{#vars}}
/// <summary>
/// Sets value for {{classname}}.{{{name}}} property.
/// </summary>
/// <param name="value">{{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}}</param>
public {{classname}}Builder {{name}}({{>nullableDataType}} value)
{
_{{name}} = value;
return this;
}
{{/vars}}
/// <summary>
/// Builds instance of {{classname}}.
/// </summary>
/// <returns>{{classname}}</returns>
public {{classname}} Build()
{
Validate();
return new {{classname}}(
{{#vars}}
{{name}}: _{{name}}{{#hasMore}},{{/hasMore}}
{{/vars}}
);
}
private void Validate()
{ {{#vars}}{{#required}}
if (_{{name}} == null)
{
throw new ArgumentException("{{name}} is a required property for {{classname}} and cannot be null");
} {{/required}}{{/vars}}
}
}
{{#vars}}{{#isEnum}}{{^parent}}
{{>innerModelEnum}}{{/parent}}{{/isEnum}}{{#items.isEnum}}
{{#items}}{{>innerModelEnum}}{{/items}}{{/items.isEnum}}{{/vars}}
}
{{#models}}
{{#model}}
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}}
{{/model}}
{{/models}}
}
}

View File

@ -0,0 +1,13 @@
/// <summary>
/// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
/// </summary>{{#description}}
/// <value>{{{description}}}</value>{{/description}}
public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}
{
{{#allowableValues}}{{#enumVars}}
/// <summary>
/// Enum {{name}}
/// </summary>
{{name}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}},
{{/-last}}{{/enumVars}}{{/allowableValues}}
}

View File

@ -0,0 +1,156 @@
/// <summary>
/// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
/// </summary>
public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>
{ {{#vars}}{{^isInherited}}
/// <summary>
/// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
/// </summary>
public {{>nullableDataType}} {{name}} { get; private set; }
{{/isInherited}}{{/vars}}
/// <summary>
/// Empty constructor required by some serializers.
/// Use {{classname}}.Builder() for instance creation instead.
/// </summary>
[Obsolete]
public {{classname}}(){{#parent}} : base({{/parent}}{{#parentVars}}null{{#hasMore}}, {{/hasMore}}{{/parentVars}}{{#parent}}){{/parent}}
{
}
{{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{classname}}({{#vars}}{{>nullableDataType}} {{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}){{#parent}} : base({{#parentVars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/parentVars}}){{/parent}}
{
{{#vars}}{{^isInherited}}
this.{{name}} = {{name}};
{{/isInherited}}{{/vars}}
}
/// <summary>
/// Returns builder of {{classname}}.
/// </summary>
/// <returns>{{classname}}Builder</returns>
public static {{#parent}}new {{/parent}}{{classname}}Builder Builder()
{
return new {{classname}}Builder();
}
/// <summary>
/// Returns {{classname}}Builder with properties set.
/// Use it to change properties.
/// </summary>
/// <returns>{{classname}}Builder</returns>
public {{#parent}}new {{/parent}}{{classname}}Builder With()
{
return Builder()
{{#vars}}
.{{name}}({{name}}){{#hasMore}}
{{/hasMore}}{{/vars}};
}
public override string ToString()
{
return this.PropertiesToString();
}
public override bool Equals(object obj)
{
return this.EqualsByProperties(obj);
}
public bool Equals({{classname}} other)
{
return Equals((object) other);
}
public override int GetHashCode()
{
return this.PropertiesHash();
}
/// <summary>
/// Implementation of == operator for ({{classname}}.
/// </summary>
/// <param name="left">Compared ({{classname}}</param>
/// <param name="right">Compared ({{classname}}</param>
/// <returns>true if compared items are equals, false otherwise</returns>
public static bool operator == ({{classname}} left, {{classname}} right)
{
return Equals(left, right);
}
/// <summary>
/// Implementation of != operator for ({{classname}}.
/// </summary>
/// <param name="left">Compared ({{classname}}</param>
/// <param name="right">Compared ({{classname}}</param>
/// <returns>true if compared items are not equals, false otherwise</returns>
public static bool operator != ({{classname}} left, {{classname}} right)
{
return !Equals(left, right);
}
/// <summary>
/// Builder of {{classname}}.
/// </summary>
public sealed class {{classname}}Builder
{
{{#vars}}
private {{>nullableDataType}} _{{name}};
{{/vars}}
internal {{classname}}Builder()
{
SetupDefaults();
}
private void SetupDefaults()
{
{{#vars}}
{{^required}}
{{#defaultValue}}
_{{name}} = {{{defaultValue}}};
{{/defaultValue}}
{{/required}}
{{/vars}}
}
{{#vars}}
/// <summary>
/// Sets value for {{classname}}.{{{name}}} property.
/// </summary>
/// <param name="value">{{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}}</param>
public {{classname}}Builder {{name}}({{>nullableDataType}} value)
{
_{{name}} = value;
return this;
}
{{/vars}}
/// <summary>
/// Builds instance of {{classname}}.
/// </summary>
/// <returns>{{classname}}</returns>
public {{classname}} Build()
{
Validate();
return new {{classname}}(
{{#vars}}
{{name}}: _{{name}}{{#hasMore}},{{/hasMore}}
{{/vars}}
);
}
private void Validate()
{ {{#vars}}{{#required}}
if (_{{name}} == null)
{
throw new ArgumentException("{{name}} is a required property for {{classname}} and cannot be null");
} {{/required}}{{/vars}}
}
}
{{#vars}}{{#isEnum}}{{^parent}}
{{>innerModelEnum}}{{/parent}}{{/isEnum}}{{#items.isEnum}}
{{#items}}{{>innerModelEnum}}{{/items}}{{/items.isEnum}}{{/vars}}
}

View File

@ -223,7 +223,7 @@
<swagger-core-version>1.5.15</swagger-core-version>
<jersey-async-version>1.0.5</jersey-async-version>
<maven-plugin.version>1.0.0</maven-plugin.version>
<jackson-version>2.4.2</jackson-version>
<jackson-version>2.8.9</jackson-version>
<junit-version>4.8.1</junit-version>
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>

View File

@ -82,6 +82,8 @@ public class JavaClientOptionsTest extends AbstractOptionsTest {
times = 1;
clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaClientOptionsProvider.PERFORM_BEANVALIDATION));
times = 1;
clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaClientOptionsProvider.PERFORM_BEANVALIDATION));
times = 1;
}};
}
}

View File

@ -25,6 +25,7 @@ public class JavaClientOptionsProvider extends JavaOptionsProvider {
options.put(JavaClientCodegen.PERFORM_BEANVALIDATION, PERFORM_BEANVALIDATION);
options.put(JavaClientCodegen.USE_GZIP_FEATURE, "false");
options.put(JavaClientCodegen.USE_RUNTIME_EXCEPTION, "false");
options.put(JavaClientCodegen.JAVA8_MODE, "false");
return options;
}

View File

@ -276,7 +276,7 @@
<properties>
<swagger-core-version>1.5.15</swagger-core-version>
<jersey-version>2.22.2</jersey-version>
<jackson-version>2.7.5</jackson-version>
<jackson-version>2.8.9</jackson-version>
{{^java8}}
<jodatime-version>2.9.4</jodatime-version>
{{/java8}}

View File

@ -40,7 +40,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<version>3.1.0</version>
<configuration>
<webResources>
<resource>

25
pom.xml
View File

@ -16,9 +16,6 @@
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
<developers>
<developer>
<id>fehguy</id>
@ -222,6 +219,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.2.5</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
@ -895,7 +912,7 @@
<commons-io-version>2.4</commons-io-version>
<commons-cli-version>1.2</commons-cli-version>
<junit-version>4.8.1</junit-version>
<jackson-version>2.8.5</jackson-version>
<jackson-version>2.8.9</jackson-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<commons-lang-version>3.4</commons-lang-version>
<slf4j-version>1.7.12</slf4j-version>

View File

@ -904,7 +904,7 @@
<commons-io-version>2.4</commons-io-version>
<commons-cli-version>1.2</commons-cli-version>
<junit-version>4.8.1</junit-version>
<jackson-version>2.8.5</jackson-version>
<jackson-version>2.8.9</jackson-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<commons-lang-version>3.4</commons-lang-version>
<slf4j-version>1.7.12</slf4j-version>

View File

@ -218,7 +218,7 @@
<swagger-core-version>1.5.15</swagger-core-version>
<jersey-async-version>1.0.5</jersey-async-version>
<maven-plugin.version>1.0.0</maven-plugin.version>
<jackson-version>2.4.2</jackson-version>
<jackson-version>2.8.9</jackson-version>
<junit-version>4.8.1</junit-version>
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>

View File

@ -10,7 +10,7 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
if not exist ".\bin" mkdir bin
copy packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml

View File

@ -15,7 +15,7 @@ mono nuget.exe install src/IO.Swagger/packages.config -o packages;
echo "[INFO] Copy DLLs to the 'bin' folder"
mkdir -p bin;
cp packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
echo "[INFO] Run 'mcs' to build bin/IO.Swagger.dll"

View File

@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -60,29 +60,29 @@ limitations under the License.
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<Compile Include="**\*.cs" Exclude="obj\**" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
@ -95,3 +95,4 @@ limitations under the License.
<EmbeddedResource Include="swagger-logo.png" />
</ItemGroup>
</Project>

View File

@ -2,5 +2,5 @@
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" developmentDependency="true" />
</packages>

View File

@ -48,10 +48,10 @@ Contact: apiteam@swagger.io
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
@ -59,7 +59,6 @@ Contact: apiteam@swagger.io
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs"
@ -67,7 +66,7 @@ Contact: apiteam@swagger.io
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" /></Project>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -26,7 +26,7 @@
<!-- Dependencies are automatically installed when the package is installed -->
<dependencies>
<dependency id="NewtonSoft.Json" version="8.0.3" />
<dependency id="NewtonSoft.Json" version="10.0.3" />
<dependency id="RestSharp" version="105.1.0" />
</dependencies>
@ -36,5 +36,6 @@
<!-- A readme.txt will be displayed when the package is installed -->
<file src="..\..\README.md" target="" />
<file src="..\..\docs\**\*.*" target="docs" />
</files>
</package>
</package>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" developmentDependency="true" />
</packages>

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--This file represents the results of running a test suite-->
<test-results name="/Users/williamcheng/Code/sep2016/swagger-codegen/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll" total="136" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2016-09-14" time="16:47:45">
<environment nunit-version="2.6.4.14350" clr-version="4.0.30319.17020" os-version="Unix 15.6.0.0" platform="Unix" cwd="/Users/williamcheng/Code/sep2016/swagger-codegen/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged" machine-name="Williams-MacBook-Pro.local" user="williamcheng" user-domain="Williams-MacBook-Pro.local" />
<test-results name="/private/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll" total="153" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2017-06-27" time="22:47:41">
<environment nunit-version="2.6.4.14350" clr-version="4.0.30319.42000" os-version="Unix 16.6.0.0" platform="Unix" cwd="/private/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged" machine-name="Williams-MacBook-Pro.local" user="williamcheng" user-domain="Williams-MacBook-Pro.local" />
<culture-info current-culture="en-US" current-uiculture="en-US" />
<test-suite type="Assembly" name="/Users/williamcheng/Code/sep2016/swagger-codegen/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll" executed="True" result="Success" success="True" time="0.119" asserts="0">
<test-suite type="Assembly" name="/private/tmp/swagger-codegen/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll" executed="True" result="Success" success="True" time="0.154" asserts="0">
<results>
<test-suite type="Namespace" name="IO" executed="True" result="Success" success="True" time="0.113" asserts="0">
<test-suite type="Namespace" name="IO" executed="True" result="Success" success="True" time="0.147" asserts="0">
<results>
<test-suite type="Namespace" name="Swagger" executed="True" result="Success" success="True" time="0.113" asserts="0">
<test-suite type="Namespace" name="Swagger" executed="True" result="Success" success="True" time="0.147" asserts="0">
<results>
<test-suite type="Namespace" name="Test" executed="True" result="Success" success="True" time="0.113" asserts="0">
<test-suite type="Namespace" name="Test" executed="True" result="Success" success="True" time="0.147" asserts="0">
<results>
<test-suite type="TestFixture" name="AdditionalPropertiesClassTests" executed="True" result="Success" success="True" time="0.013" asserts="0">
<test-suite type="TestFixture" name="AdditionalPropertiesClassTests" executed="True" result="Success" success="True" time="0.024" asserts="0">
<results>
<test-case name="IO.Swagger.Test.AdditionalPropertiesClassTests.AdditionalPropertiesClassInstanceTest" executed="True" result="Success" success="True" time="0.006" asserts="0" />
<test-case name="IO.Swagger.Test.AdditionalPropertiesClassTests.AdditionalPropertiesClassInstanceTest" executed="True" result="Success" success="True" time="0.012" asserts="0" />
<test-case name="IO.Swagger.Test.AdditionalPropertiesClassTests.MapOfMapPropertyTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.AdditionalPropertiesClassTests.MapPropertyTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="AnimalFarmTests" executed="True" result="Success" success="True" time="0.000" asserts="0">
<test-suite type="TestFixture" name="AnimalFarmTests" executed="True" result="Success" success="True" time="0.001" asserts="0">
<results>
<test-case name="IO.Swagger.Test.AnimalFarmTests.AnimalFarmInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
@ -58,6 +58,17 @@
<test-case name="IO.Swagger.Test.ArrayTestTests.ArrayTestInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="CapitalizationTests" executed="True" result="Success" success="True" time="0.006" asserts="0">
<results>
<test-case name="IO.Swagger.Test.CapitalizationTests.ATT_NAMETest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.CapitalizationTests.CapitalCamelTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.CapitalizationTests.CapitalizationInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.CapitalizationTests.CapitalSnakeTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.CapitalizationTests.SCAETHFlowPointsTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.CapitalizationTests.SmallCamelTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.CapitalizationTests.SmallSnakeTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="CategoryTests" executed="True" result="Success" success="True" time="0.001" asserts="0">
<results>
<test-case name="IO.Swagger.Test.CategoryTests.CategoryInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
@ -73,6 +84,12 @@
<test-case name="IO.Swagger.Test.CatTests.DeclawedTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="ClassModelTests" executed="True" result="Success" success="True" time="0.001" asserts="0">
<results>
<test-case name="IO.Swagger.Test.ClassModelTests._ClassTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.ClassModelTests.ClassModelInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="DogTests" executed="True" result="Success" success="True" time="0.002" asserts="0">
<results>
<test-case name="IO.Swagger.Test.DogTests.BreedTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
@ -88,7 +105,7 @@
<test-case name="IO.Swagger.Test.EnumArraysTests.JustSymbolTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="EnumClassTests" executed="True" result="Success" success="True" time="0.000" asserts="0">
<test-suite type="TestFixture" name="EnumClassTests" executed="True" result="Success" success="True" time="0.001" asserts="0">
<results>
<test-case name="IO.Swagger.Test.EnumClassTests.EnumClassInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
@ -101,15 +118,15 @@
<test-case name="IO.Swagger.Test.EnumTestTests.EnumTestInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="FakeApiTests" executed="True" result="Success" success="True" time="0.011" asserts="0">
<test-suite type="TestFixture" name="FakeApiTests" executed="True" result="Success" success="True" time="0.012" asserts="0">
<results>
<test-case name="IO.Swagger.Test.FakeApiTests.InstanceTest" executed="True" result="Success" success="True" time="0.008" asserts="0" />
<test-case name="IO.Swagger.Test.FakeApiTests.InstanceTest" executed="True" result="Success" success="True" time="0.010" asserts="0" />
<test-case name="IO.Swagger.Test.FakeApiTests.TestClientModelTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.FakeApiTests.TestEndpointParametersTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.FakeApiTests.TestEnumParametersTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="FormatTestTests" executed="True" result="Success" success="True" time="0.006" asserts="0">
<test-suite type="TestFixture" name="FormatTestTests" executed="True" result="Success" success="True" time="0.009" asserts="0">
<results>
<test-case name="IO.Swagger.Test.FormatTestTests._ByteTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.FormatTestTests._DoubleTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
@ -127,7 +144,7 @@
<test-case name="IO.Swagger.Test.FormatTestTests.UuidTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="HasOnlyReadOnlyTests" executed="True" result="Success" success="True" time="0.001" asserts="0">
<test-suite type="TestFixture" name="HasOnlyReadOnlyTests" executed="True" result="Success" success="True" time="0.002" asserts="0">
<results>
<test-case name="IO.Swagger.Test.HasOnlyReadOnlyTests.BarTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.HasOnlyReadOnlyTests.FooTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
@ -200,6 +217,34 @@
<test-case name="IO.Swagger.Test.OrderTests.StatusTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="OuterBooleanTests" executed="True" result="Success" success="True" time="0.000" asserts="0">
<results>
<test-case name="IO.Swagger.Test.OuterBooleanTests.OuterBooleanInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="OuterCompositeTests" executed="True" result="Success" success="True" time="0.002" asserts="0">
<results>
<test-case name="IO.Swagger.Test.OuterCompositeTests.MyBooleanTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.OuterCompositeTests.MyNumberTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.OuterCompositeTests.MyStringTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.OuterCompositeTests.OuterCompositeInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="OuterEnumTests" executed="True" result="Success" success="True" time="0.000" asserts="0">
<results>
<test-case name="IO.Swagger.Test.OuterEnumTests.OuterEnumInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="OuterNumberTests" executed="True" result="Success" success="True" time="0.001" asserts="0">
<results>
<test-case name="IO.Swagger.Test.OuterNumberTests.OuterNumberInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="OuterStringTests" executed="True" result="Success" success="True" time="0.000" asserts="0">
<results>
<test-case name="IO.Swagger.Test.OuterStringTests.OuterStringInstanceTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="PetApiTests" executed="True" result="Success" success="True" time="0.004" asserts="0">
<results>
<test-case name="IO.Swagger.Test.PetApiTests.AddPetTest" executed="True" result="Success" success="True" time="0.001" asserts="0" />
@ -213,7 +258,7 @@
<test-case name="IO.Swagger.Test.PetApiTests.UploadFileTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="PetTests" executed="True" result="Success" success="True" time="0.003" asserts="0">
<test-suite type="TestFixture" name="PetTests" executed="True" result="Success" success="True" time="0.004" asserts="0">
<results>
<test-case name="IO.Swagger.Test.PetTests.CategoryTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.PetTests.IdTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
@ -237,7 +282,7 @@
<test-case name="IO.Swagger.Test.SpecialModelNameTests.SpecialPropertyNameTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="StoreApiTests" executed="True" result="Success" success="True" time="0.002" asserts="0">
<test-suite type="TestFixture" name="StoreApiTests" executed="True" result="Success" success="True" time="0.003" asserts="0">
<results>
<test-case name="IO.Swagger.Test.StoreApiTests.DeleteOrderTest" executed="True" result="Success" success="True" time="0.001" asserts="0" />
<test-case name="IO.Swagger.Test.StoreApiTests.GetInventoryTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
@ -266,7 +311,7 @@
<test-case name="IO.Swagger.Test.UserApiTests.UpdateUserTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="UserTests" executed="True" result="Success" success="True" time="0.004" asserts="0">
<test-suite type="TestFixture" name="UserTests" executed="True" result="Success" success="True" time="0.005" asserts="0">
<results>
<test-case name="IO.Swagger.Test.UserTests.EmailTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />
<test-case name="IO.Swagger.Test.UserTests.FirstNameTest" executed="True" result="Success" success="True" time="0.000" asserts="0" />

View File

@ -10,9 +10,9 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
if not exist ".\bin" mkdir bin
copy packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
copy packages\Fody.1.29.2\Fody.dll bin\Fody.dll
copy packages\Fody.1.29.4\Fody.dll bin\Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml

View File

@ -15,9 +15,9 @@ mono nuget.exe install src/IO.Swagger/packages.config -o packages;
echo "[INFO] Copy DLLs to the 'bin' folder"
mkdir -p bin;
cp packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
cp packages/Fody.1.29.2/Fody.dll bin/Fody.dll
cp packages/Fody.1.29.4/Fody.dll bin/Fody.dll
cp packages/PropertyChanged.Fody.1.51.3/PropertyChanged.Fody.dll bin/PropertyChanged.Fody.dll
cp packages/PropertyChanged.Fody.1.51.3/Lib/dotnet/PropertyChanged.dll bin/PropertyChanged.dll

View File

@ -47,10 +47,10 @@ Contact: apiteam@swagger.io
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>

View File

@ -2,5 +2,5 @@
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" developmentDependency="true" />
</packages>

View File

@ -48,10 +48,10 @@ Contact: apiteam@swagger.io
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
@ -72,6 +72,6 @@ Contact: apiteam@swagger.io
<None Include="FodyWeavers.xml" />
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
<Import Project="..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
</Project>

View File

@ -26,9 +26,9 @@
<!-- Dependencies are automatically installed when the package is installed -->
<dependencies>
<dependency id="NewtonSoft.Json" version="8.0.3" />
<dependency id="NewtonSoft.Json" version="10.0.3" />
<dependency id="RestSharp" version="105.1.0" />
<dependency id="Fody" version="1.29.2" />
<dependency id="Fody" version="1.29.4" />
<dependency id="PropertyChanged.Fody" version="1.51.3" />
</dependencies>
@ -38,7 +38,7 @@
<!-- A readme.txt will be displayed when the package is installed -->
<file src="..\..\README.md" target="" />
<file src="..\..\docs\**\*.*" target="docs" />
<file src="..\..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" />
<file src="..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" />
</files>
</package>
</package>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" developmentDependency="true" />
<package id="Fody" version="1.29.2" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net45" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net45" developmentDependency="true" />
</packages>

View File

@ -0,0 +1 @@
../packages

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -96,6 +96,7 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.5.9"
jackson_version = "2.8.7"
threepane_version = "2.6.4"
feign_version = "9.4.0"
feign_form_version = "2.1.0"
junit_version = "4.12"
@ -111,7 +112,7 @@ dependencies {
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threepane_version"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"
compile "com.brsanthu:migbase64:2.2"
testCompile "junit:junit:$junit_version"

View File

@ -213,9 +213,9 @@
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>${jackson-threetenbp-version}</version>
</dependency>
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>
@ -250,7 +250,8 @@
<swagger-core-version>1.5.15</swagger-core-version>
<feign-version>9.4.0</feign-version>
<feign-form-version>2.1.0</feign-form-version>
<jackson-version>2.8.7</jackson-version>
<jackson-version>2.8.9</jackson-version>
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
<junit-version>4.12</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<oltu-version>1.0.1</oltu-version>

View File

@ -5,11 +5,12 @@ import java.util.Map;
import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder;
import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder;
import org.threeten.bp.*;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.joda.JodaModule;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import feign.Feign;
import feign.RequestInterceptor;
@ -135,7 +136,11 @@ public class ApiClient {
objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE);
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
objectMapper.setDateFormat(new RFC3339DateFormat());
objectMapper.registerModule(new JodaModule());
ThreeTenModule module = new ThreeTenModule();
module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
objectMapper.registerModule(module);
return objectMapper;
}

View File

@ -0,0 +1,232 @@
package io.swagger.client;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonTokenId;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils;
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.Instant;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import org.threeten.bp.temporal.Temporal;
import org.threeten.bp.temporal.TemporalAccessor;
import java.io.IOException;
import java.math.BigDecimal;
/**
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s.
* Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format.
*
* @author Nick Williams
*/
public class CustomInstantDeserializer<T extends Temporal>
extends ThreeTenDateTimeDeserializerBase<T> {
private static final long serialVersionUID = 1L;
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(
Instant.class, DateTimeFormatter.ISO_INSTANT,
new Function<TemporalAccessor, Instant>() {
@Override
public Instant apply(TemporalAccessor temporalAccessor) {
return Instant.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, Instant>() {
@Override
public Instant apply(FromIntegerArguments a) {
return Instant.ofEpochMilli(a.value);
}
},
new Function<FromDecimalArguments, Instant>() {
@Override
public Instant apply(FromDecimalArguments a) {
return Instant.ofEpochSecond(a.integer, a.fraction);
}
},
null
);
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
new Function<TemporalAccessor, OffsetDateTime>() {
@Override
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
return OffsetDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromIntegerArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromDecimalArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
@Override
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
}
}
);
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
new Function<TemporalAccessor, ZonedDateTime>() {
@Override
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
return ZonedDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromIntegerArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromDecimalArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
@Override
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
return zonedDateTime.withZoneSameInstant(zoneId);
}
}
);
protected final Function<FromIntegerArguments, T> fromMilliseconds;
protected final Function<FromDecimalArguments, T> fromNanoseconds;
protected final Function<TemporalAccessor, T> parsedToValue;
protected final BiFunction<T, ZoneId, T> adjust;
protected CustomInstantDeserializer(Class<T> supportedType,
DateTimeFormatter parser,
Function<TemporalAccessor, T> parsedToValue,
Function<FromIntegerArguments, T> fromMilliseconds,
Function<FromDecimalArguments, T> fromNanoseconds,
BiFunction<T, ZoneId, T> adjust) {
super(supportedType, parser);
this.parsedToValue = parsedToValue;
this.fromMilliseconds = fromMilliseconds;
this.fromNanoseconds = fromNanoseconds;
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
@Override
public T apply(T t, ZoneId zoneId) {
return t;
}
} : adjust;
}
@SuppressWarnings("unchecked")
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
super((Class<T>) base.handledType(), f);
parsedToValue = base.parsedToValue;
fromMilliseconds = base.fromMilliseconds;
fromNanoseconds = base.fromNanoseconds;
adjust = base.adjust;
}
@Override
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
if (dtf == _formatter) {
return this;
}
return new CustomInstantDeserializer<T>(this, dtf);
}
@Override
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
//string values have to be adjusted to the configured TZ.
switch (parser.getCurrentTokenId()) {
case JsonTokenId.ID_NUMBER_FLOAT: {
BigDecimal value = parser.getDecimalValue();
long seconds = value.longValue();
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
return fromNanoseconds.apply(new FromDecimalArguments(
seconds, nanoseconds, getZone(context)));
}
case JsonTokenId.ID_NUMBER_INT: {
long timestamp = parser.getLongValue();
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
return this.fromNanoseconds.apply(new FromDecimalArguments(
timestamp, 0, this.getZone(context)
));
}
return this.fromMilliseconds.apply(new FromIntegerArguments(
timestamp, this.getZone(context)
));
}
case JsonTokenId.ID_STRING: {
String string = parser.getText().trim();
if (string.length() == 0) {
return null;
}
if (string.endsWith("+0000")) {
string = string.substring(0, string.length() - 5) + "Z";
}
T value;
try {
TemporalAccessor acc = _formatter.parse(string);
value = parsedToValue.apply(acc);
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
return adjust.apply(value, this.getZone(context));
}
} catch (DateTimeException e) {
throw _peelDTE(e);
}
return value;
}
}
throw context.mappingException("Expected type float, integer, or string.");
}
private ZoneId getZone(DeserializationContext context) {
// Instants are always in UTC, so don't waste compute cycles
return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone());
}
private static class FromIntegerArguments {
public final long value;
public final ZoneId zoneId;
private FromIntegerArguments(long value, ZoneId zoneId) {
this.value = value;
this.zoneId = zoneId;
}
}
private static class FromDecimalArguments {
public final long integer;
public final int fraction;
public final ZoneId zoneId;
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
this.integer = integer;
this.fraction = fraction;
this.zoneId = zoneId;
}
}
}

View File

@ -5,8 +5,8 @@ import io.swagger.client.EncodingUtils;
import java.math.BigDecimal;
import io.swagger.client.model.Client;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import io.swagger.client.model.OuterComposite;
import java.util.ArrayList;
@ -107,7 +107,7 @@ public interface FakeApi extends ApiClient.Api {
"Content-Type: application/xml; charset&#x3D;utf-8",
"Accept: application/xml; charset&#x3D;utf-8,application/json; charset&#x3D;utf-8",
})
void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("patternWithoutDelimiter") String patternWithoutDelimiter, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("string") String string, @Param("binary") byte[] binary, @Param("date") LocalDate date, @Param("dateTime") DateTime dateTime, @Param("password") String password, @Param("paramCallback") String paramCallback);
void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("patternWithoutDelimiter") String patternWithoutDelimiter, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("string") String string, @Param("binary") byte[] binary, @Param("date") LocalDate date, @Param("dateTime") OffsetDateTime dateTime, @Param("password") String password, @Param("paramCallback") String paramCallback);
/**
* To test enum parameters

View File

@ -21,8 +21,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.UUID;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
/**
* FormatTest
@ -60,7 +60,7 @@ public class FormatTest {
private LocalDate date = null;
@JsonProperty("dateTime")
private DateTime dateTime = null;
private OffsetDateTime dateTime = null;
@JsonProperty("uuid")
private UUID uuid = null;
@ -258,7 +258,7 @@ public class FormatTest {
this.date = date;
}
public FormatTest dateTime(DateTime dateTime) {
public FormatTest dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@ -268,11 +268,11 @@ public class FormatTest {
* @return dateTime
**/
@ApiModelProperty(value = "")
public DateTime getDateTime() {
public OffsetDateTime getDateTime() {
return dateTime;
}
public void setDateTime(DateTime dateTime) {
public void setDateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
}

View File

@ -24,7 +24,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.joda.time.DateTime;
import org.threeten.bp.OffsetDateTime;
/**
* MixedPropertiesAndAdditionalPropertiesClass
@ -35,7 +35,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private UUID uuid = null;
@JsonProperty("dateTime")
private DateTime dateTime = null;
private OffsetDateTime dateTime = null;
@JsonProperty("map")
private Map<String, Animal> map = null;
@ -58,7 +58,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.uuid = uuid;
}
public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) {
public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@ -68,11 +68,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
* @return dateTime
**/
@ApiModelProperty(value = "")
public DateTime getDateTime() {
public OffsetDateTime getDateTime() {
return dateTime;
}
public void setDateTime(DateTime dateTime) {
public void setDateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
}

View File

@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
import org.threeten.bp.OffsetDateTime;
/**
* Order
@ -36,7 +36,7 @@ public class Order {
private Integer quantity = null;
@JsonProperty("shipDate")
private DateTime shipDate = null;
private OffsetDateTime shipDate = null;
/**
* Order Status
@ -135,7 +135,7 @@ public class Order {
this.quantity = quantity;
}
public Order shipDate(DateTime shipDate) {
public Order shipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
return this;
}
@ -145,11 +145,11 @@ public class Order {
* @return shipDate
**/
@ApiModelProperty(value = "")
public DateTime getShipDate() {
public OffsetDateTime getShipDate() {
return shipDate;
}
public void setShipDate(DateTime shipDate) {
public void setShipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
}

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -95,7 +95,7 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.5.15"
jackson_version = "2.8.9"
jackson_version = "2.6.4"
jersey_version = "1.19.4"
jodatime_version = "2.9.9"
junit_version = "4.12"
@ -109,7 +109,7 @@ dependencies {
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version",
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version",
compile "com.brsanthu:migbase64:2.2"
testCompile "junit:junit:$junit_version"
}

View File

@ -267,7 +267,7 @@ FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = B; // byte[] | None
byte[] _byte = _byte_example; // byte[] | None
Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | None
Long int64 = 789L; // Long | None
@ -275,7 +275,7 @@ Float _float = 3.4F; // Float | None
String string = "string_example"; // String | None
byte[] binary = B; // byte[] | None
LocalDate date = new LocalDate(); // LocalDate | None
DateTime dateTime = new DateTime(); // DateTime | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None
String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None
try {
@ -301,7 +301,7 @@ Name | Type | Description | Notes
**string** | **String**| None | [optional]
**binary** | **byte[]**| None | [optional]
**date** | **LocalDate**| None | [optional]
**dateTime** | **DateTime**| None | [optional]
**dateTime** | **OffsetDateTime**| None | [optional]
**password** | **String**| None | [optional]
**paramCallback** | **String**| None | [optional]

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
**_byte** | **byte[]** | |
**binary** | **byte[]** | | [optional]
**date** | [**LocalDate**](LocalDate.md) | |
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**uuid** | [**UUID**](UUID.md) | | [optional]
**password** | **String** | |

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | [**UUID**](UUID.md) | | [optional]
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**map** | [**Map&lt;String, Animal&gt;**](Animal.md) | | [optional]

View File

@ -7,7 +7,7 @@ Name | Type | Description | Notes
**id** | **Long** | | [optional]
**petId** | **Long** | | [optional]
**quantity** | **Integer** | | [optional]
**shipDate** | [**DateTime**](DateTime.md) | | [optional]
**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
**complete** | **Boolean** | | [optional]

View File

@ -218,20 +218,16 @@
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>${jackson-version}</version>
</dependency>
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
@ -244,7 +240,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.15</swagger-annotations-version>
<jersey-version>1.19.4</jersey-version>
<jackson-version>2.7.5</jackson-version>
<jackson-version>2.6.4</jackson-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.12</junit-version>
</properties>

View File

@ -12,9 +12,11 @@
package io.swagger.client;
import org.threeten.bp.*;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.datatype.joda.JodaModule;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import com.sun.jersey.api.client.Client;
@ -78,7 +80,11 @@ public class ApiClient {
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
objectMapper.registerModule(new JodaModule());
ThreeTenModule module = new ThreeTenModule();
module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
objectMapper.registerModule(module);
objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat());
dateFormat = ApiClient.buildDefaultDateFormat();

View File

@ -0,0 +1,232 @@
package io.swagger.client;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonTokenId;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils;
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.Instant;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import org.threeten.bp.temporal.Temporal;
import org.threeten.bp.temporal.TemporalAccessor;
import java.io.IOException;
import java.math.BigDecimal;
/**
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s.
* Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format.
*
* @author Nick Williams
*/
public class CustomInstantDeserializer<T extends Temporal>
extends ThreeTenDateTimeDeserializerBase<T> {
private static final long serialVersionUID = 1L;
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(
Instant.class, DateTimeFormatter.ISO_INSTANT,
new Function<TemporalAccessor, Instant>() {
@Override
public Instant apply(TemporalAccessor temporalAccessor) {
return Instant.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, Instant>() {
@Override
public Instant apply(FromIntegerArguments a) {
return Instant.ofEpochMilli(a.value);
}
},
new Function<FromDecimalArguments, Instant>() {
@Override
public Instant apply(FromDecimalArguments a) {
return Instant.ofEpochSecond(a.integer, a.fraction);
}
},
null
);
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
new Function<TemporalAccessor, OffsetDateTime>() {
@Override
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
return OffsetDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromIntegerArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromDecimalArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
@Override
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
}
}
);
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
new Function<TemporalAccessor, ZonedDateTime>() {
@Override
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
return ZonedDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromIntegerArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromDecimalArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
@Override
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
return zonedDateTime.withZoneSameInstant(zoneId);
}
}
);
protected final Function<FromIntegerArguments, T> fromMilliseconds;
protected final Function<FromDecimalArguments, T> fromNanoseconds;
protected final Function<TemporalAccessor, T> parsedToValue;
protected final BiFunction<T, ZoneId, T> adjust;
protected CustomInstantDeserializer(Class<T> supportedType,
DateTimeFormatter parser,
Function<TemporalAccessor, T> parsedToValue,
Function<FromIntegerArguments, T> fromMilliseconds,
Function<FromDecimalArguments, T> fromNanoseconds,
BiFunction<T, ZoneId, T> adjust) {
super(supportedType, parser);
this.parsedToValue = parsedToValue;
this.fromMilliseconds = fromMilliseconds;
this.fromNanoseconds = fromNanoseconds;
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
@Override
public T apply(T t, ZoneId zoneId) {
return t;
}
} : adjust;
}
@SuppressWarnings("unchecked")
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
super((Class<T>) base.handledType(), f);
parsedToValue = base.parsedToValue;
fromMilliseconds = base.fromMilliseconds;
fromNanoseconds = base.fromNanoseconds;
adjust = base.adjust;
}
@Override
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
if (dtf == _formatter) {
return this;
}
return new CustomInstantDeserializer<T>(this, dtf);
}
@Override
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
//string values have to be adjusted to the configured TZ.
switch (parser.getCurrentTokenId()) {
case JsonTokenId.ID_NUMBER_FLOAT: {
BigDecimal value = parser.getDecimalValue();
long seconds = value.longValue();
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
return fromNanoseconds.apply(new FromDecimalArguments(
seconds, nanoseconds, getZone(context)));
}
case JsonTokenId.ID_NUMBER_INT: {
long timestamp = parser.getLongValue();
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
return this.fromNanoseconds.apply(new FromDecimalArguments(
timestamp, 0, this.getZone(context)
));
}
return this.fromMilliseconds.apply(new FromIntegerArguments(
timestamp, this.getZone(context)
));
}
case JsonTokenId.ID_STRING: {
String string = parser.getText().trim();
if (string.length() == 0) {
return null;
}
if (string.endsWith("+0000")) {
string = string.substring(0, string.length() - 5) + "Z";
}
T value;
try {
TemporalAccessor acc = _formatter.parse(string);
value = parsedToValue.apply(acc);
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
return adjust.apply(value, this.getZone(context));
}
} catch (DateTimeException e) {
throw _peelDTE(e);
}
return value;
}
}
throw context.mappingException("Expected type float, integer, or string.");
}
private ZoneId getZone(DeserializationContext context) {
// Instants are always in UTC, so don't waste compute cycles
return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone());
}
private static class FromIntegerArguments {
public final long value;
public final ZoneId zoneId;
private FromIntegerArguments(long value, ZoneId zoneId) {
this.value = value;
this.zoneId = zoneId;
}
}
private static class FromDecimalArguments {
public final long integer;
public final int fraction;
public final ZoneId zoneId;
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
this.integer = integer;
this.fraction = fraction;
this.zoneId = zoneId;
}
}
}

View File

@ -22,8 +22,8 @@ import io.swagger.client.Pair;
import java.math.BigDecimal;
import io.swagger.client.model.Client;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import io.swagger.client.model.OuterComposite;
@ -261,7 +261,7 @@ public class FakeApi {
* @param paramCallback None (optional)
* @throws ApiException if fails to make API call
*/
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback) throws ApiException {
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'number' is set

View File

@ -21,8 +21,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.UUID;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
/**
* FormatTest
@ -60,7 +60,7 @@ public class FormatTest {
private LocalDate date = null;
@JsonProperty("dateTime")
private DateTime dateTime = null;
private OffsetDateTime dateTime = null;
@JsonProperty("uuid")
private UUID uuid = null;
@ -258,7 +258,7 @@ public class FormatTest {
this.date = date;
}
public FormatTest dateTime(DateTime dateTime) {
public FormatTest dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@ -268,11 +268,11 @@ public class FormatTest {
* @return dateTime
**/
@ApiModelProperty(value = "")
public DateTime getDateTime() {
public OffsetDateTime getDateTime() {
return dateTime;
}
public void setDateTime(DateTime dateTime) {
public void setDateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
}

View File

@ -24,7 +24,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.joda.time.DateTime;
import org.threeten.bp.OffsetDateTime;
/**
* MixedPropertiesAndAdditionalPropertiesClass
@ -35,7 +35,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private UUID uuid = null;
@JsonProperty("dateTime")
private DateTime dateTime = null;
private OffsetDateTime dateTime = null;
@JsonProperty("map")
private Map<String, Animal> map = null;
@ -58,7 +58,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.uuid = uuid;
}
public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) {
public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@ -68,11 +68,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
* @return dateTime
**/
@ApiModelProperty(value = "")
public DateTime getDateTime() {
public OffsetDateTime getDateTime() {
return dateTime;
}
public void setDateTime(DateTime dateTime) {
public void setDateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
}

View File

@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
import org.threeten.bp.OffsetDateTime;
/**
* Order
@ -36,7 +36,7 @@ public class Order {
private Integer quantity = null;
@JsonProperty("shipDate")
private DateTime shipDate = null;
private OffsetDateTime shipDate = null;
/**
* Order Status
@ -135,7 +135,7 @@ public class Order {
this.quantity = quantity;
}
public Order shipDate(DateTime shipDate) {
public Order shipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
return this;
}
@ -145,11 +145,11 @@ public class Order {
* @return shipDate
**/
@ApiModelProperty(value = "")
public DateTime getShipDate() {
public OffsetDateTime getShipDate() {
return shipDate;
}
public void setShipDate(DateTime shipDate) {
public void setShipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
}

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -96,7 +96,6 @@ ext {
swagger_annotations_version = "1.5.15"
jackson_version = "2.8.9"
jersey_version = "2.25.1"
jodatime_version = "2.9.9"
commons_io_version=2.5
commons_lang3_version=3.6
junit_version = "4.12"
@ -110,10 +109,9 @@ dependencies {
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
compile "joda-time:joda-time:$jodatime_version"
compile "com.brsanthu:migbase64:2.2"
compile "commons-io:commons-io:$commons_io_version"
compile "org.apache.commons:commons-lang3:$commons_lang3_version"
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version",
compile "com.brsanthu:migbase64:2.2"
testCompile "junit:junit:$junit_version"
}

View File

@ -13,11 +13,10 @@ lazy val root = (project in file(".")).
"org.glassfish.jersey.core" % "jersey-client" % "2.25.1",
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1",
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1",
"com.fasterxml.jackson.core" % "jackson-core" % "2.8.9",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9",
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.8.9",
"joda-time" % "joda-time" % "2.9.9",
"com.fasterxml.jackson.core" % "jackson-core" % "2.6.4" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.4" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.4" % "compile",
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile",
"com.brsanthu" % "migbase64" % "2.2",
"org.apache.commons" % "commons-lang3" % "3.6",
"commons-io" % "commons-io" % "2.5",

View File

@ -267,7 +267,7 @@ FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = B; // byte[] | None
byte[] _byte = _byte_example; // byte[] | None
Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | None
Long int64 = 789L; // Long | None
@ -275,7 +275,7 @@ Float _float = 3.4F; // Float | None
String string = "string_example"; // String | None
byte[] binary = B; // byte[] | None
LocalDate date = new LocalDate(); // LocalDate | None
DateTime dateTime = new DateTime(); // DateTime | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None
String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None
try {
@ -301,7 +301,7 @@ Name | Type | Description | Notes
**string** | **String**| None | [optional]
**binary** | **byte[]**| None | [optional]
**date** | **LocalDate**| None | [optional]
**dateTime** | **DateTime**| None | [optional]
**dateTime** | **OffsetDateTime**| None | [optional]
**password** | **String**| None | [optional]
**paramCallback** | **String**| None | [optional]

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
**_byte** | **byte[]** | |
**binary** | **byte[]** | | [optional]
**date** | [**LocalDate**](LocalDate.md) | |
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**uuid** | [**UUID**](UUID.md) | | [optional]
**password** | **String** | |

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | [**UUID**](UUID.md) | | [optional]
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**map** | [**Map&lt;String, Animal&gt;**](Animal.md) | | [optional]

View File

@ -7,7 +7,7 @@ Name | Type | Description | Notes
**id** | **Long** | | [optional]
**petId** | **Long** | | [optional]
**quantity** | **Integer** | | [optional]
**shipDate** | [**DateTime**](DateTime.md) | | [optional]
**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
**complete** | **Boolean** | | [optional]

View File

@ -217,35 +217,26 @@
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons_lang3_version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons_io_version}</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
@ -257,10 +248,9 @@
<properties>
<swagger-core-version>1.5.15</swagger-core-version>
<jersey-version>2.25.1</jersey-version>
<jackson-version>2.8.9</jackson-version>
<jodatime-version>2.9.9</jodatime-version>
<commons_io_version>2.5</commons_io_version>
<commons_lang3_version>3.6</commons_lang3_version>
<jackson-version>2.6.4</jackson-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.12</junit-version>
</properties>

Some files were not shown because too many files have changed in this diff Show More