diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 89e344b08d2..277a7741fab 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -14,17 +14,17 @@ Also please indicate in the issue title which language/library is concerned. Eg: ##### Swagger declaration file content or url ##### Command line used for generation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6f127186321..85641dcbae5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ ### PR checklist -- [ ] Read the [contribution guildelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md). +- [ ] Read the [contribution guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md). - [ ] Ran the shell/batch script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh` and `./bin/security/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates) - [ ] Filed the PR against the correct branch: master for non-breaking changes and `2.3.0` branch for breaking (non-backward compatible) changes. diff --git a/.gitignore b/.gitignore index 7e1a68ee63a..1644461681c 100644 --- a/.gitignore +++ b/.gitignore @@ -144,6 +144,8 @@ samples/client/petstore/typescript-node/**/typings samples/client/petstore/typescript-angular/**/typings samples/client/petstore/typescript-fetch/**/dist/ samples/client/petstore/typescript-fetch/**/typings +samples/client/petstore/typescript-angular2/npm/npm-debug.log +samples/client/petstore/typescript-node/npm/npm-debug.log # aspnetcore samples/server/petstore/aspnetcore/.vs/ diff --git a/.travis.yml b/.travis.yml index e0290b10205..bc9f8dfc2e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,22 @@ jdk: cache: directories: - $HOME/.m2 + - $HOME/.ivy2 + - $HOME/samples/client/petstore/php/SwaggerClient-php/vendor + - $HOME/samples/client/petstore/ruby/venodr/bundle + - $HOME/samples/client/petstore/python/.venv/ + - $HOME/samples/client/petstore/typescript-node/npm/node_modules + - $HOME/samples/client/petstore/typescript-node/npm/typings/ + - $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules + - $HOME/samples/client/petstore/typescript-fetch/tests/default/typings + - $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules + - $HOME/samples/client/petstore/typescript-fetch/builds/default/typings + - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules + - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings + - $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules + - $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings + - $HOME/samples/client/petstore/typescript-angular/node_modules + - $HOME/samples/client/petstore/typescript-angular/typings services: - docker @@ -47,9 +63,11 @@ script: # 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 verify -Psamples - # docker test - - if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_IMAGE_NAME:latest $DOCKER_IMAGE_NAME:$TRAVIS_TAG; fi && docker push $DOCKER_IMAGE_NAME; fi + - mvn --batch-mode verify -Psamples + # 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_IMAGE_NAME=swaggerapi/swagger-generator + - DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli diff --git a/README.md b/README.md index a9a4b63a596..1417007641e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Swagger Code Generator -[![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) +[![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) @@ -12,6 +12,8 @@ :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: +:rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket: + ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: @@ -66,19 +68,20 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- -2.3.0 (upcoming minor release) | TBD | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes -2.2.2 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release (without breaking changes) -2.2.1 (**current stable**) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) +2.3.0 (upcoming minor release) | Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes +2.2.3 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes +2.2.2 (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) +2.2.1 | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) 2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites -If you're looking for the latest stable version, you can grab it directly from maven central (you'll need java 7 runtime at a minimum): +If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum): ``` -wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar -O swagger-codegen-cli.jar +wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` @@ -161,7 +164,7 @@ cd /vagrant - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) -======= + ##### Swagger Generator Docker Image @@ -188,7 +191,7 @@ docker stop $CID && docker rm $CID In the example above, `result.zip` will contain the generated client. -##### Swagger Codegen Docker Image +##### Swagger Codegen CLI Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. @@ -197,7 +200,7 @@ To generate code with this image, you'll need to mount a local location as a vol Example: ``` -docker run --rm -v ${PWD}:/local swagger-api/swagger-codegen generate \ +docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go @@ -219,7 +222,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar ) +You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` @@ -849,11 +852,13 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) +- [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [Germin8](http://www.germin8.com) - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) +- [HashData](http://www.hashdata.cn/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) @@ -887,6 +892,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) +- [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) @@ -903,6 +909,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [SRC](https://www.src.si/) +- [Stingray](http://www.stingray.com) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [TaskData](http://www.taskdata.com/) @@ -955,6 +962,7 @@ Swagger Codegen core team members are contributors who have been making signific | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | +| Java Play Framework | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsum (2016/05/01) | @@ -1002,9 +1010,11 @@ Here is a list of template creators: * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu + * Java Play Framework: @JFCote * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard + * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsum * PHP Slim: @jfastnacht * PHP Zend Expressive (with Path Handler): @Articus @@ -1073,3 +1083,4 @@ limitations under the License. --- + diff --git a/bin/dart-petstore.sh b/bin/dart-petstore.sh index bfb9e8179f0..466a27b657b 100755 --- a/bin/dart-petstore.sh +++ b/bin/dart-petstore.sh @@ -27,7 +27,7 @@ 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/dart -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/dart -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger -DhideGenerationTimestamp=true" # then options to generate the library for vm would be: #ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger_vm -DbrowserClient=false -DpubName=swagger_vm" diff --git a/bin/java-inflector-petstore-server.sh b/bin/java-inflector-petstore-server.sh index 701a2c3cf06..91e3481e7a1 100755 --- a/bin/java-inflector-petstore-server.sh +++ b/bin/java-inflector-petstore-server.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaInflector -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l inflector -o samples/server/petstore/java-inflector" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaInflector -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l inflector -o samples/server/petstore/java-inflector -DhideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-play-framework-petstore-server.sh b/bin/java-play-framework-petstore-server.sh new file mode 100755 index 00000000000..ff8103e2204 --- /dev/null +++ b/bin/java-play-framework-petstore-server.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaPlayFramework -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java-play-framework -o samples/server/petstore/java-play-framework -DhideGenerationTimestamp=true" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/springboot-petstore-server-implicitHeaders.json b/bin/springboot-petstore-server-implicitHeaders.json new file mode 100755 index 00000000000..8b76ddb5d26 --- /dev/null +++ b/bin/springboot-petstore-server-implicitHeaders.json @@ -0,0 +1,3 @@ +{ + "implicitHeaders": true +} \ No newline at end of file diff --git a/bin/springboot-petstore-server-implicitHeaders.sh b/bin/springboot-petstore-server-implicitHeaders.sh new file mode 100755 index 00000000000..98e20af9d61 --- /dev/null +++ b/bin/springboot-petstore-server-implicitHeaders.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaSpring -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l spring -c bin/springboot-petstore-server-implicitHeaders.json -o samples/server/petstore/springboot-implicitHeaders -DhideGenerationTimestamp=true" + +echo "Removing files and folders under samples/server/petstore/springboot-implicitHeaders/src/main" +rm -rf samples/server/petstore/springboot-implicitHeaders/src/main +find samples/server/petstore/springboot-implicitHeaders -maxdepth 1 -type f ! -name "README.md" -exec rm {} + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/java-play-framework-petstore-server.bat b/bin/windows/java-play-framework-petstore-server.bat new file mode 100644 index 00000000000..b2d2604f59c --- /dev/null +++ b/bin/windows/java-play-framework-petstore-server.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l java-play-framework -o samples\server\petstore\java-play-framework + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift-petstore-all.bat b/bin/windows/swift-petstore-all.bat new file mode 100755 index 00000000000..e837f4c1ec6 --- /dev/null +++ b/bin/windows/swift-petstore-all.bat @@ -0,0 +1,3 @@ +call .\bin\windows\swift-petstore.bat +call .\bin\windows\swift-petstore-promisekit.bat +call .\bin\windows\swift-petstore-rxswift.bat diff --git a/bin/windows/swift-petstore-promisekit.bat b/bin/windows/swift-petstore-promisekit.bat new file mode 100755 index 00000000000..bbd0d4c87b9 --- /dev/null +++ b/bin/windows/swift-petstore-promisekit.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -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% diff --git a/bin/windows/swift-petstore-rxswift.bat b/bin/windows/swift-petstore-rxswift.bat new file mode 100755 index 00000000000..92d80c3a71b --- /dev/null +++ b/bin/windows/swift-petstore-rxswift.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -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% diff --git a/bin/windows/swift-petstore.bat b/bin/windows/swift-petstore.bat index b0ef85d695d..3728a8da8ad 100755 --- a/bin/windows/swift-petstore.bat +++ b/bin/windows/swift-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l swift -o samples\client\petstore\swift +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l swift -o samples\client\petstore\swift\default java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift3-petstore-all.bat b/bin/windows/swift3-petstore-all.bat new file mode 100755 index 00000000000..7f2b6a9b5d9 --- /dev/null +++ b/bin/windows/swift3-petstore-all.bat @@ -0,0 +1,3 @@ +call .\bin\windows\swift3-petstore.bat +call .\bin\windows\swift3-petstore-promisekit.bat +call .\bin\windows\swift3-petstore-rxswift.bat diff --git a/bin/windows/swift3-petstore-promisekit.bat b/bin/windows/swift3-petstore-promisekit.bat new file mode 100755 index 00000000000..658c395e72e --- /dev/null +++ b/bin/windows/swift3-petstore-promisekit.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -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% diff --git a/bin/windows/swift3-petstore-rxswift.bat b/bin/windows/swift3-petstore-rxswift.bat new file mode 100755 index 00000000000..3fa97f55245 --- /dev/null +++ b/bin/windows/swift3-petstore-rxswift.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -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% diff --git a/bin/windows/swift3-petstore.bat b/bin/windows/swift3-petstore.bat new file mode 100755 index 00000000000..a3dbf929b94 --- /dev/null +++ b/bin/windows/swift3-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -o samples\client\petstore\swift3\default + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index 3a0db92c5a4..db0464ba7bd 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -6,28 +6,33 @@ import java.util.Map; import java.util.List; public class CodegenParameter { - public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, + public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore, isContainer, secondaryParam, isCollectionFormatMulti, isPrimitiveType; - public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName; + public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, + collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName; + + //This was added for javaPlayFramework specifically to get around a bug in swagger-play. See generator for more info on the bug. + public String dataTypeForImplicitParam; + public String example; // example value (x-example) public String jsonSchema; - public Boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime; - public Boolean isListContainer, isMapContainer; - public Boolean isFile, notFile; + public boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime; + public boolean isListContainer, isMapContainer; + public boolean isFile, notFile; public boolean isEnum; public List _enum; public Map allowableValues; public CodegenProperty items; public Map vendorExtensions; - public Boolean hasValidation; + public boolean hasValidation; /** * Determines whether this parameter is mandatory. If the parameter is in "path", * this property is required and its value MUST be true. Otherwise, the property * MAY be included and its default value is false. */ - public Boolean required; + public boolean required; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor17. @@ -36,7 +41,7 @@ public class CodegenParameter { /** * See http://json-schema.org/latest/json-schema-validation.html#anchor17 */ - public Boolean exclusiveMaximum; + public boolean exclusiveMaximum; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor21 */ @@ -44,7 +49,7 @@ public class CodegenParameter { /** * See http://json-schema.org/latest/json-schema-validation.html#anchor21 */ - public Boolean exclusiveMinimum; + public boolean exclusiveMinimum; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor26 */ @@ -68,7 +73,7 @@ public class CodegenParameter { /** * See http://json-schema.org/latest/json-schema-validation.html#anchor49 */ - public Boolean uniqueItems; + public boolean uniqueItems; /** * See http://json-schema.org/latest/json-schema-validation.html#anchor14 */ @@ -156,27 +161,27 @@ public class CodegenParameter { CodegenParameter that = (CodegenParameter) o; if (isEnum != that.isEnum) return false; - if (isFormParam != null ? !isFormParam.equals(that.isFormParam) : that.isFormParam != null) + if (isFormParam != that.isFormParam) return false; - if (isQueryParam != null ? !isQueryParam.equals(that.isQueryParam) : that.isQueryParam != null) + if (isQueryParam != that.isQueryParam) return false; - if (isPathParam != null ? !isPathParam.equals(that.isPathParam) : that.isPathParam != null) + if (isPathParam != that.isPathParam) return false; - if (isHeaderParam != null ? !isHeaderParam.equals(that.isHeaderParam) : that.isHeaderParam != null) + if (isHeaderParam != that.isHeaderParam) return false; - if (isCookieParam != null ? !isCookieParam.equals(that.isCookieParam) : that.isCookieParam != null) + if (isCookieParam != that.isCookieParam) return false; - if (isBodyParam != null ? !isBodyParam.equals(that.isBodyParam) : that.isBodyParam != null) + if (isBodyParam != that.isBodyParam) return false; - if (hasMore != null ? !hasMore.equals(that.hasMore) : that.hasMore != null) + if (hasMore != that.hasMore) return false; - if (isContainer != null ? !isContainer.equals(that.isContainer) : that.isContainer != null) + if (isContainer != that.isContainer) return false; - if (secondaryParam != null ? !secondaryParam.equals(that.secondaryParam) : that.secondaryParam != null) + if (secondaryParam != that.secondaryParam) return false; - if (isCollectionFormatMulti != null ? !isCollectionFormatMulti.equals(that.isCollectionFormatMulti) : that.isCollectionFormatMulti != null) + if (isCollectionFormatMulti != that.isCollectionFormatMulti) return false; - if (isPrimitiveType != null ? !isPrimitiveType.equals(that.isPrimitiveType) : that.isPrimitiveType != null) + if (isPrimitiveType != that.isPrimitiveType) return false; if (baseName != null ? !baseName.equals(that.baseName) : that.baseName != null) return false; @@ -204,33 +209,33 @@ public class CodegenParameter { return false; if (jsonSchema != null ? !jsonSchema.equals(that.jsonSchema) : that.jsonSchema != null) return false; - if (isString != null ? !isString.equals(that.isString) : that.isString != null) + if (isString != that.isString) return false; - if (isInteger != null ? !isInteger.equals(that.isInteger) : that.isInteger != null) + if (isInteger != that.isInteger) return false; - if (isLong != null ? !isLong.equals(that.isLong) : that.isLong != null) + if (isLong != that.isLong) return false; - if (isFloat != null ? !isFloat.equals(that.isFloat) : that.isFloat != null) + if (isFloat != that.isFloat) return false; - if (isDouble != null ? !isDouble.equals(that.isDouble) : that.isDouble != null) + if (isDouble != that.isDouble) return false; - if (isByteArray != null ? !isByteArray.equals(that.isByteArray) : that.isByteArray != null) + if (isByteArray != that.isByteArray) return false; - if (isBinary != null ? !isBinary.equals(that.isBinary) : that.isBinary != null) + if (isBinary != that.isBinary) return false; - if (isBoolean != null ? !isBoolean.equals(that.isBoolean) : that.isBoolean != null) + if (isBoolean != that.isBoolean) return false; - if (isDate != null ? !isDate.equals(that.isDate) : that.isDate != null) + if (isDate != that.isDate) return false; - if (isDateTime != null ? !isDateTime.equals(that.isDateTime) : that.isDateTime != null) + if (isDateTime != that.isDateTime) return false; - if (isListContainer != null ? !isListContainer.equals(that.isListContainer) : that.isListContainer != null) + if (isListContainer != that.isListContainer) return false; - if (isMapContainer != null ? !isMapContainer.equals(that.isMapContainer) : that.isMapContainer != null) + if (isMapContainer != that.isMapContainer) return false; - if (isFile != null ? !isFile.equals(that.isFile) : that.isFile != null) + if (isFile != that.isFile) return false; - if (notFile != null ? !notFile.equals(that.notFile) : that.notFile != null) + if (notFile != that.notFile) return false; if (_enum != null ? !_enum.equals(that._enum) : that._enum != null) return false; @@ -240,17 +245,17 @@ public class CodegenParameter { return false; if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null) return false; - if (hasValidation != null ? !hasValidation.equals(that.hasValidation) : that.hasValidation != null) + if (hasValidation != that.hasValidation) return false; - if (required != null ? !required.equals(that.required) : that.required != null) + if (required != that.required) return false; if (maximum != null ? !maximum.equals(that.maximum) : that.maximum != null) return false; - if (exclusiveMaximum != null ? !exclusiveMaximum.equals(that.exclusiveMaximum) : that.exclusiveMaximum != null) + if (exclusiveMaximum != that.exclusiveMaximum) return false; if (minimum != null ? !minimum.equals(that.minimum) : that.minimum != null) return false; - if (exclusiveMinimum != null ? !exclusiveMinimum.equals(that.exclusiveMinimum) : that.exclusiveMinimum != null) + if (exclusiveMinimum != that.exclusiveMinimum) return false; if (maxLength != null ? !maxLength.equals(that.maxLength) : that.maxLength != null) return false; @@ -262,7 +267,7 @@ public class CodegenParameter { return false; if (minItems != null ? !minItems.equals(that.minItems) : that.minItems != null) return false; - if (uniqueItems != null ? !uniqueItems.equals(that.uniqueItems) : that.uniqueItems != null) + if (uniqueItems != that.uniqueItems) return false; return multipleOf != null ? multipleOf.equals(that.multipleOf) : that.multipleOf == null; @@ -270,17 +275,17 @@ public class CodegenParameter { @Override public int hashCode() { - int result = isFormParam != null ? isFormParam.hashCode() : 0; - result = 31 * result + (isQueryParam != null ? isQueryParam.hashCode() : 0); - result = 31 * result + (isPathParam != null ? isPathParam.hashCode() : 0); - result = 31 * result + (isHeaderParam != null ? isHeaderParam.hashCode() : 0); - result = 31 * result + (isCookieParam != null ? isCookieParam.hashCode() : 0); - result = 31 * result + (isBodyParam != null ? isBodyParam.hashCode() : 0); - result = 31 * result + (hasMore != null ? hasMore.hashCode() : 0); - result = 31 * result + (isContainer != null ? isContainer.hashCode() : 0); - result = 31 * result + (secondaryParam != null ? secondaryParam.hashCode() : 0); - result = 31 * result + (isCollectionFormatMulti != null ? isCollectionFormatMulti.hashCode() : 0); - result = 31 * result + (isPrimitiveType != null ? isPrimitiveType.hashCode() : 0); + int result = isFormParam ? 13:31; + result = 31 * result + (isQueryParam ? 13:31); + result = 31 * result + (isPathParam ? 13:31); + result = 31 * result + (isHeaderParam ? 13:31); + result = 31 * result + (isCookieParam ? 13:31); + result = 31 * result + (isBodyParam ? 13:31); + result = 31 * result + (hasMore ? 13:31); + result = 31 * result + (isContainer ? 13:31); + result = 31 * result + (secondaryParam ? 13:31); + result = 31 * result + (isCollectionFormatMulti ? 13:31); + result = 31 * result + (isPrimitiveType ? 13:31); result = 31 * result + (baseName != null ? baseName.hashCode() : 0); result = 31 * result + (paramName != null ? paramName.hashCode() : 0); result = 31 * result + (dataType != null ? dataType.hashCode() : 0); @@ -294,37 +299,37 @@ public class CodegenParameter { result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0); result = 31 * result + (example != null ? example.hashCode() : 0); result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0); - result = 31 * result + (isString != null ? isString.hashCode() : 0); - result = 31 * result + (isInteger != null ? isInteger.hashCode() : 0); - result = 31 * result + (isLong != null ? isLong.hashCode() : 0); - result = 31 * result + (isFloat != null ? isFloat.hashCode() : 0); - result = 31 * result + (isDouble != null ? isDouble.hashCode() : 0); - result = 31 * result + (isByteArray != null ? isByteArray.hashCode() : 0); - result = 31 * result + (isBinary != null ? isBinary.hashCode() : 0); - result = 31 * result + (isBoolean != null ? isBoolean.hashCode() : 0); - result = 31 * result + (isDate != null ? isDate.hashCode() : 0); - result = 31 * result + (isDateTime != null ? isDateTime.hashCode() : 0); - result = 31 * result + (isListContainer != null ? isListContainer.hashCode() : 0); - result = 31 * result + (isMapContainer != null ? isMapContainer.hashCode() : 0); - result = 31 * result + (isFile != null ? isFile.hashCode() : 0); - result = 31 * result + (notFile != null ? notFile.hashCode() : 0); + result = 31 * result + (isString ? 13:31); + result = 31 * result + (isInteger ? 13:31); + result = 31 * result + (isLong ? 13:31); + result = 31 * result + (isFloat ? 13:31); + result = 31 * result + (isDouble ? 13:31); + result = 31 * result + (isByteArray ? 13:31); + result = 31 * result + (isBinary ? 13:31); + result = 31 * result + (isBoolean ? 13:31); + result = 31 * result + (isDate ? 13:31); + result = 31 * result + (isDateTime ? 13:31); + result = 31 * result + (isListContainer ? 13:31); + result = 31 * result + (isMapContainer ? 13:31); + result = 31 * result + (isFile ? 13:31); + result = 31 * result + (notFile ? 13:31); result = 31 * result + (isEnum ? 1 : 0); result = 31 * result + (_enum != null ? _enum.hashCode() : 0); result = 31 * result + (allowableValues != null ? allowableValues.hashCode() : 0); result = 31 * result + (items != null ? items.hashCode() : 0); result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0); - result = 31 * result + (hasValidation != null ? hasValidation.hashCode() : 0); - result = 31 * result + (required != null ? required.hashCode() : 0); + result = 31 * result + (hasValidation ? 13:31); + result = 31 * result + (required ? 13:31); result = 31 * result + (maximum != null ? maximum.hashCode() : 0); - result = 31 * result + (exclusiveMaximum != null ? exclusiveMaximum.hashCode() : 0); + result = 31 * result + (exclusiveMaximum ? 13:31); result = 31 * result + (minimum != null ? minimum.hashCode() : 0); - result = 31 * result + (exclusiveMinimum != null ? exclusiveMinimum.hashCode() : 0); + result = 31 * result + (exclusiveMinimum ? 13:31); result = 31 * result + (maxLength != null ? maxLength.hashCode() : 0); result = 31 * result + (minLength != null ? minLength.hashCode() : 0); result = 31 * result + (pattern != null ? pattern.hashCode() : 0); result = 31 * result + (maxItems != null ? maxItems.hashCode() : 0); result = 31 * result + (minItems != null ? minItems.hashCode() : 0); - result = 31 * result + (uniqueItems != null ? uniqueItems.hashCode() : 0); + result = 31 * result + (uniqueItems ? 13:31); result = 31 * result + (multipleOf != null ? multipleOf.hashCode() : 0); return result; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java index 4f1c9c54c3e..b2a734fc9b2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenResponse.java @@ -7,24 +7,22 @@ import java.util.Map; public class CodegenResponse { public final List headers = new ArrayList(); public String code, message; - public Boolean hasMore; + public boolean hasMore; public List> examples; public String dataType, baseType, containerType; - public Boolean isDefault; - public Boolean simpleType; - public Boolean primitiveType; - public Boolean isMapContainer; - public Boolean isListContainer; - public Boolean isBinary = Boolean.FALSE; - public Boolean isFile = Boolean.FALSE; + public boolean hasHeaders; + public boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBoolean, isDate, isDateTime; + public boolean isDefault; + public boolean simpleType; + public boolean primitiveType; + public boolean isMapContainer; + public boolean isListContainer; + public boolean isBinary = false; + public boolean isFile = false; public Object schema; public String jsonSchema; public Map vendorExtensions; - public boolean isWildcard() { - return "0".equals(code) || "default".equals(code); - } - @Override public String toString() { return String.format("%s(%s)", code, containerType); @@ -43,7 +41,7 @@ public class CodegenResponse { return false; if (message != null ? !message.equals(that.message) : that.message != null) return false; - if (hasMore != null ? !hasMore.equals(that.hasMore) : that.hasMore != null) + if (hasMore != that.hasMore) return false; if (examples != null ? !examples.equals(that.examples) : that.examples != null) return false; @@ -53,19 +51,19 @@ public class CodegenResponse { return false; if (containerType != null ? !containerType.equals(that.containerType) : that.containerType != null) return false; - if (isDefault != null ? !isDefault.equals(that.isDefault) : that.isDefault != null) + if (isDefault != that.isDefault) return false; - if (simpleType != null ? !simpleType.equals(that.simpleType) : that.simpleType != null) + if (simpleType != that.simpleType) return false; - if (primitiveType != null ? !primitiveType.equals(that.primitiveType) : that.primitiveType != null) + if (primitiveType != that.primitiveType) return false; - if (isMapContainer != null ? !isMapContainer.equals(that.isMapContainer) : that.isMapContainer != null) + if (isMapContainer != that.isMapContainer) return false; - if (isListContainer != null ? !isListContainer.equals(that.isListContainer) : that.isListContainer != null) + if (isListContainer != that.isListContainer) return false; - if (isBinary != null ? !isBinary.equals(that.isBinary) : that.isBinary != null) + if (isBinary != that.isBinary) return false; - if (isFile != null ? !isFile.equals(that.isFile) : that.isFile != null) + if (isFile != that.isFile) return false; if (schema != null ? !schema.equals(that.schema) : that.schema != null) return false; @@ -80,18 +78,18 @@ public class CodegenResponse { int result = headers.hashCode(); result = 31 * result + (code != null ? code.hashCode() : 0); result = 31 * result + (message != null ? message.hashCode() : 0); - result = 31 * result + (hasMore != null ? hasMore.hashCode() : 0); + result = 31 * result + (hasMore ? 13:31); result = 31 * result + (examples != null ? examples.hashCode() : 0); result = 31 * result + (dataType != null ? dataType.hashCode() : 0); result = 31 * result + (baseType != null ? baseType.hashCode() : 0); result = 31 * result + (containerType != null ? containerType.hashCode() : 0); - result = 31 * result + (isDefault != null ? isDefault.hashCode() : 0); - result = 31 * result + (simpleType != null ? simpleType.hashCode() : 0); - result = 31 * result + (primitiveType != null ? primitiveType.hashCode() : 0); - result = 31 * result + (isMapContainer != null ? isMapContainer.hashCode() : 0); - result = 31 * result + (isListContainer != null ? isListContainer.hashCode() : 0); - result = 31 * result + (isBinary != null ? isBinary.hashCode() : 0); - result = 31 * result + (isFile != null ? isFile.hashCode() : 0); + result = 31 * result + (isDefault ? 13:31); + result = 31 * result + (simpleType ? 13:31); + result = 31 * result + (primitiveType ? 13:31); + result = 31 * result + (isMapContainer ? 13:31); + result = 31 * result + (isListContainer ? 13:31); + result = 31 * result + (isBinary ? 13:31); + result = 31 * result + (isFile ? 13:31); result = 31 * result + (schema != null ? schema.hashCode() : 0); result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0); result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 99b9ba4f381..8e9449bdfde 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -811,6 +811,7 @@ public class DefaultCodegen { typeMapping.put("ByteArray", "byte[]"); typeMapping.put("binary", "byte[]"); typeMapping.put("file", "File"); + typeMapping.put("UUID", "UUID"); instantiationTypes = new HashMap(); @@ -1481,7 +1482,10 @@ public class DefaultCodegen { property.title = p.getTitle(); property.getter = "get" + getterAndSetterCapitalize(name); property.setter = "set" + getterAndSetterCapitalize(name); - property.example = toExampleValue(p); + String example = toExampleValue(p); + if(!"null".equals(example)) { + property.example = example; + } property.defaultValue = toDefaultValue(p); property.defaultValueWithParam = toDefaultValueWithParam(name, p); property.jsonSchema = Json.pretty(p); @@ -2046,10 +2050,10 @@ public class DefaultCodegen { } r.isDefault = response == methodResponse; op.responses.add(r); - if (r.isBinary && r.isDefault){ + if (Boolean.TRUE.equals(r.isBinary) && Boolean.TRUE.equals(r.isDefault)){ op.isResponseBinary = Boolean.TRUE; } - if (r.isFile && r.isDefault){ + if (Boolean.TRUE.equals(r.isFile) && Boolean.TRUE.equals(r.isDefault)){ op.isResponseFile = Boolean.TRUE; } } @@ -2161,7 +2165,7 @@ public class DefaultCodegen { } else if (param instanceof FormParameter) { formParams.add(p.copy()); } - if (p.required == null || !p.required) { + if (!p.required) { op.hasOptionalParams = true; } } @@ -2179,10 +2183,8 @@ public class DefaultCodegen { Collections.sort(allParams, new Comparator() { @Override public int compare(CodegenParameter one, CodegenParameter another) { - boolean oneRequired = one.required == null ? false : one.required; - boolean anotherRequired = another.required == null ? false : another.required; - if (oneRequired == anotherRequired) return 0; - else if (oneRequired) return -1; + if (one.required == another.required) return 0; + else if (one.required) return -1; else return 1; } }); @@ -2233,6 +2235,7 @@ public class DefaultCodegen { r.jsonSchema = Json.pretty(response); r.vendorExtensions = response.getVendorExtensions(); addHeaders(response, r.headers); + r.hasHeaders = !r.headers.isEmpty(); if (r.schema != null) { Property responseProperty = response.getSchema(); @@ -2251,8 +2254,33 @@ public class DefaultCodegen { } } r.dataType = cm.datatype; - r.isBinary = isDataTypeBinary(cm.datatype); - r.isFile = isDataTypeFile(cm.datatype); + + if (Boolean.TRUE.equals(cm.isString)) { + r.isString = true; + } else if (Boolean.TRUE.equals(cm.isBoolean)) { + r.isBoolean = true; + } else if (Boolean.TRUE.equals(cm.isLong)) { + r.isLong = true; + } else if (Boolean.TRUE.equals(cm.isInteger)) { + r.isInteger = true; + } else if (Boolean.TRUE.equals(cm.isDouble)) { + r.isDouble = true; + } else if (Boolean.TRUE.equals(cm.isFloat)) { + r.isFloat = true; + } else if (Boolean.TRUE.equals(cm.isByteArray)) { + r.isByteArray = true; + } else if (Boolean.TRUE.equals(cm.isBinary)) { + r.isBinary = true; + } else if (Boolean.TRUE.equals(cm.isFile)) { + r.isFile = true; + } else if (Boolean.TRUE.equals(cm.isDate)) { + r.isDate = true; + } else if (Boolean.TRUE.equals(cm.isDateTime)) { + r.isDateTime = true; + } else { + LOGGER.debug("Property type is not primitive: " + cm.datatype); + } + if (cm.isContainer) { r.simpleType = false; r.containerType = cm.containerType; @@ -2410,14 +2438,14 @@ public class DefaultCodegen { p.minimum = qp.getMinimum() == null ? null : String.valueOf(qp.getMinimum()); } - p.exclusiveMaximum = qp.isExclusiveMaximum(); - p.exclusiveMinimum = qp.isExclusiveMinimum(); + p.exclusiveMaximum = qp.isExclusiveMaximum() == null ? false : qp.isExclusiveMaximum(); + p.exclusiveMinimum = qp.isExclusiveMinimum() == null ? false : qp.isExclusiveMinimum(); p.maxLength = qp.getMaxLength(); p.minLength = qp.getMinLength(); p.pattern = toRegularExpression(qp.getPattern()); p.maxItems = qp.getMaxItems(); p.minItems = qp.getMinItems(); - p.uniqueItems = qp.isUniqueItems(); + p.uniqueItems = qp.isUniqueItems() == null ? false : qp.isUniqueItems(); p.multipleOf = qp.getMultipleOf(); // exclusive* are noop without corresponding min/max @@ -2452,6 +2480,9 @@ public class DefaultCodegen { p.isPrimitiveType = cp.isPrimitiveType; p.isBinary = isDataTypeBinary(cp.datatype); p.isFile = isDataTypeFile(cp.datatype); + if (cp.complexType != null) { + imports.add(cp.complexType); + } } // set boolean flag (e.g. isString) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index 03433e64580..6bd8931fc61 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -75,12 +75,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { StringBuilder hostBuilder = new StringBuilder(); hostBuilder.append(getScheme()); hostBuilder.append("://"); - if (swagger.getHost() != null) { + if (!StringUtils.isEmpty(swagger.getHost())) { hostBuilder.append(swagger.getHost()); } else { hostBuilder.append("localhost"); } - if (swagger.getBasePath() != null) { + if (!StringUtils.isEmpty(swagger.getBasePath()) && !swagger.getBasePath().equals("/")) { hostBuilder.append(swagger.getBasePath()); } return hostBuilder.toString(); @@ -154,8 +154,10 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { // set a default description if none if provided config.additionalProperties().put("appDescription", "No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)"); + config.additionalProperties().put("unescapedAppDescription", "No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)"); } else { config.additionalProperties().put("appDescription", config.escapeText(info.getDescription())); + config.additionalProperties().put("unescapedAppDescription", info.getDescription()); } if (info.getContact() != null) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java index b21e89711ff..86a7238cf04 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java @@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; +import java.io.Serializable; import java.nio.file.Paths; import java.util.HashMap; import java.util.HashSet; @@ -34,7 +35,7 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty; * It also has a convenience method for creating a ClientOptInput class which is THE object DefaultGenerator.java needs * to generate code. */ -public class CodegenConfigurator { +public class CodegenConfigurator implements Serializable { public static final Logger LOGGER = LoggerFactory.getLogger(CodegenConfigurator.class); @@ -62,7 +63,7 @@ public class CodegenConfigurator { private Map importMappings = new HashMap(); private Set languageSpecificPrimitives = new HashSet(); private Map reservedWordMappings = new HashMap(); - + private String gitUserId="GIT_USER_ID"; private String gitRepoId="GIT_REPO_ID"; private String releaseNote="Minor update"; @@ -155,7 +156,7 @@ public class CodegenConfigurator { // check to see if the folder exists if (!(f.exists() && f.isDirectory())) { - throw new IllegalArgumentException("Template directory " + templateDir + " does not exist."); + throw new IllegalArgumentException("Template directory " + templateDir + " does not exist."); } this.templateDir = f.getAbsolutePath(); @@ -266,7 +267,7 @@ public class CodegenConfigurator { this.additionalProperties = additionalProperties; return this; } - + public CodegenConfigurator addAdditionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; @@ -344,16 +345,16 @@ public class CodegenConfigurator { this.httpUserAgent= httpUserAgent; return this; } - + public Map getReservedWordsMappings() { return reservedWordMappings; } - + public CodegenConfigurator setReservedWordsMappings(Map reservedWordsMappings) { this.reservedWordMappings = reservedWordsMappings; return this; } - + public CodegenConfigurator addAdditionalReservedWordMapping(String key, String value) { this.reservedWordMappings.put(key, value); return this; @@ -367,7 +368,7 @@ public class CodegenConfigurator { this.ignoreFileOverride = ignoreFileOverride; return this; } - + public ClientOptInput toClientOptInput() { Validate.notEmpty(lang, "language must be specified"); @@ -388,7 +389,7 @@ public class CodegenConfigurator { config.importMapping().putAll(importMappings); config.languageSpecificPrimitives().addAll(languageSpecificPrimitives); config.reservedWordsMappings().putAll(reservedWordMappings); - + checkAndSetAdditionalProperty(apiPackage, CodegenConstants.API_PACKAGE); checkAndSetAdditionalProperty(modelPackage, CodegenConstants.MODEL_PACKAGE); checkAndSetAdditionalProperty(invokerPackage, CodegenConstants.INVOKER_PACKAGE); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java index bff78820b25..08a04769e87 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java @@ -1,5 +1,8 @@ package io.swagger.codegen.examples; +import static io.swagger.models.properties.StringProperty.Format.URI; +import static io.swagger.models.properties.StringProperty.Format.URL; + import io.swagger.models.Model; import io.swagger.models.ModelImpl; import io.swagger.models.properties.ArrayProperty; @@ -11,7 +14,6 @@ import io.swagger.models.properties.DecimalProperty; import io.swagger.models.properties.DoubleProperty; import io.swagger.models.properties.FileProperty; import io.swagger.models.properties.FloatProperty; -import io.swagger.models.properties.IntegerProperty; import io.swagger.models.properties.LongProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.ObjectProperty; @@ -20,10 +22,12 @@ import io.swagger.models.properties.RefProperty; import io.swagger.models.properties.StringProperty; import io.swagger.models.properties.UUIDProperty; import io.swagger.util.Json; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -31,6 +35,17 @@ import java.util.Map; import java.util.Set; public class ExampleGenerator { + private static final Logger logger = LoggerFactory.getLogger(ExampleGenerator.class); + + // TODO: move constants to more appropriate location + private static final String MIME_TYPE_JSON = "application/json"; + private static final String MIME_TYPE_XML = "application/xml"; + + private static final String EXAMPLE = "example"; + private static final String CONTENT_TYPE = "contentType"; + private static final String OUTPUT = "output"; + private static final String NONE = "none"; + protected Map examples; public ExampleGenerator(Map examples) { @@ -38,53 +53,76 @@ public class ExampleGenerator { } public List> generate(Map examples, List mediaTypes, Property property) { - List> output = new ArrayList>(); - Set processedModels = new HashSet(); + List> output = new ArrayList<>(); + Set processedModels = new HashSet<>(); if (examples == null) { if (mediaTypes == null) { // assume application/json for this - mediaTypes = Arrays.asList("application/json"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + mediaTypes = Collections.singletonList(MIME_TYPE_JSON); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. } for (String mediaType : mediaTypes) { - Map kv = new HashMap(); - kv.put("contentType", mediaType); - if (property != null && mediaType.startsWith("application/json")) { + Map kv = new HashMap<>(); + kv.put(CONTENT_TYPE, mediaType); + if (property != null && mediaType.startsWith(MIME_TYPE_JSON)) { String example = Json.pretty(resolvePropertyToExample(mediaType, property, processedModels)); if (example != null) { - kv.put("example", example); + kv.put(EXAMPLE, example); output.add(kv); } - } else if (property != null && mediaType.startsWith("application/xml")) { + } else if (property != null && mediaType.startsWith(MIME_TYPE_XML)) { String example = new XmlExampleGenerator(this.examples).toXml(property); if (example != null) { - kv.put("example", example); + kv.put(EXAMPLE, example); output.add(kv); } } } } else { for (Map.Entry entry : examples.entrySet()) { - final Map kv = new HashMap(); - kv.put("contentType", entry.getKey()); - kv.put("example", Json.pretty(entry.getValue())); + final Map kv = new HashMap<>(); + kv.put(CONTENT_TYPE, entry.getKey()); + kv.put(EXAMPLE, Json.pretty(entry.getValue())); output.add(kv); } } if (output.size() == 0) { - Map kv = new HashMap(); - kv.put("output", "none"); + Map kv = new HashMap<>(); + kv.put(OUTPUT, NONE); output.add(kv); } return output; } - protected Object resolvePropertyToExample(String mediaType, Property property, Set processedModels) { + private Object resolvePropertyToExample(String mediaType, Property property, Set processedModels) { + logger.debug("Resolving example for property {}...", property); if (property.getExample() != null) { + logger.debug("Example set in swagger spec, returning example: '{}'", property.getExample().toString()); return property.getExample(); } else if (property instanceof StringProperty) { + logger.debug("String property"); + String defaultValue = ((StringProperty) property).getDefault(); + if (defaultValue != null && !defaultValue.isEmpty()) { + logger.debug("Default value found: '{}'", defaultValue); + return defaultValue; + } + List enumValues = ((StringProperty) property).getEnum(); + if (enumValues != null && !enumValues.isEmpty()) { + logger.debug("Enum value found: '{}'", enumValues.get(0)); + return enumValues.get(0); + } + String format = property.getFormat(); + if (format != null && (URI.getName().equals(format) || URL.getName().equals(format))) { + logger.debug("URI or URL format, without default or enum, generating random one."); + return "http://example.com/aeiou"; + } + logger.debug("No values found, using default string 'aeiou' as example"); return "aeiou"; } else if (property instanceof BooleanProperty) { + Boolean defaultValue = ((BooleanProperty) property).getDefault(); + if (defaultValue != null) { + return defaultValue; + } return Boolean.TRUE; } else if (property instanceof ArrayProperty) { Property innerType = ((ArrayProperty) property).getItems(); @@ -97,21 +135,28 @@ public class ExampleGenerator { return "2000-01-23"; } else if (property instanceof DateTimeProperty) { return "2000-01-23T04:56:07.000+00:00"; - } else if (property instanceof DecimalProperty) { - return new BigDecimal(1.3579); } else if (property instanceof DoubleProperty) { - return 3.149; + Double min = ((DecimalProperty) property).getMinimum() == null ? null : ((DecimalProperty) property).getMinimum().doubleValue(); + Double max = ((DecimalProperty) property).getMaximum() == null ? null : ((DecimalProperty) property).getMaximum().doubleValue(); + return randomNumber(min, max); + } else if (property instanceof FloatProperty) { + Double min = ((DecimalProperty) property).getMinimum() == null ? null : ((DecimalProperty) property).getMinimum().doubleValue(); + Double max = ((DecimalProperty) property).getMaximum() == null ? null : ((DecimalProperty) property).getMaximum().doubleValue(); + return (float) randomNumber(min, max); + } else if (property instanceof DecimalProperty) { + Double min = ((DecimalProperty) property).getMinimum() == null ? null : ((DecimalProperty) property).getMinimum().doubleValue(); + Double max = ((DecimalProperty) property).getMaximum() == null ? null : ((DecimalProperty) property).getMaximum().doubleValue(); + return new BigDecimal(randomNumber(min, max)); } else if (property instanceof FileProperty) { return ""; // TODO - } else if (property instanceof FloatProperty) { - return 1.23f; - } else if (property instanceof IntegerProperty) { - return 123; } else if (property instanceof LongProperty) { - return 123456789L; - // Properties that are not Integer or Long may still be BaseInteger - } else if (property instanceof BaseIntegerProperty) { - return 123; + Double min = ((BaseIntegerProperty) property).getMinimum() == null ? null : ((BaseIntegerProperty) property).getMinimum().doubleValue(); + Double max = ((BaseIntegerProperty) property).getMaximum() == null ? null : ((BaseIntegerProperty) property).getMaximum().doubleValue(); + return (long) randomNumber(min, max); + } else if (property instanceof BaseIntegerProperty) { // Includes IntegerProperty + Double min = ((BaseIntegerProperty) property).getMinimum() == null ? null : ((BaseIntegerProperty) property).getMinimum().doubleValue(); + Double max = ((BaseIntegerProperty) property).getMaximum() == null ? null : ((BaseIntegerProperty) property).getMaximum().doubleValue(); + return (int) randomNumber(min, max); } else if (property instanceof MapProperty) { Map mp = new HashMap(); if (property.getName() != null) { @@ -126,10 +171,12 @@ public class ExampleGenerator { return "{}"; } else if (property instanceof RefProperty) { String simpleName = ((RefProperty) property).getSimpleRef(); + logger.debug("Ref property, simple name: {}", simpleName); Model model = examples.get(simpleName); if (model != null) { return resolveModelToExample(simpleName, mediaType, model, processedModels); } + logger.warn("Ref property with empty model."); } else if (property instanceof UUIDProperty) { return "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; } @@ -137,16 +184,35 @@ public class ExampleGenerator { return ""; } - public Object resolveModelToExample(String name, String mediaType, Model model, Set processedModels) { + private double randomNumber(Double min, Double max) { + if (min != null && max != null) { + double range = max - min; + return Math.random() * range + min; + } else if (min != null) { + return Math.random() + min; + } else if (max != null) { + return Math.random() * max; + } else { + return Math.random() * 10; + } + } + + private Object resolveModelToExample(String name, String mediaType, Model model, Set processedModels) { if (processedModels.contains(name)) { return ""; } if (model instanceof ModelImpl) { processedModels.add(name); ModelImpl impl = (ModelImpl) model; - Map values = new HashMap(); + Map values = new HashMap<>(); - if (impl.getProperties() != null) { + logger.debug("Resolving model '{}' to example", name); + + if (impl.getExample() != null) { + logger.debug("Using example from spec: {}", impl.getExample()); + return impl.getExample(); + } else if (impl.getProperties() != null) { + logger.debug("Creating example from model values"); for (String propertyName : impl.getProperties().keySet()) { Property property = impl.getProperties().get(propertyName); values.put(propertyName, resolvePropertyToExample(mediaType, property, processedModels)); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java index c59449be439..9ccba055dbc 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java @@ -20,7 +20,7 @@ import io.swagger.models.properties.Property; import io.swagger.models.properties.RefProperty; import io.swagger.models.properties.StringProperty; -import org.codehaus.plexus.util.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java index 2852c6eed96..0de8d29862f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/CodegenIgnoreProcessor.java @@ -45,7 +45,7 @@ public class CodegenIgnoreProcessor { if (directory.exists() && directory.isDirectory()) { loadFromFile(targetIgnoreFile); } else { - LOGGER.warn("Directory does not exist, or is inaccessible. No file will be evaluated."); + LOGGER.warn("Output directory does not exist, or is inaccessible. No file (.swager-codegen-ignore) will be evaluated."); } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 3ab3895bb4b..4ab981970a3 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -318,6 +318,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code typeMapping.put("array", "java.util.List"); typeMapping.put("map", "java.util.Map"); typeMapping.put("DateTime", "java.util.Date"); + typeMapping.put("UUID", "java.util.UUID"); typeMapping.remove("List"); importMapping.remove("Date"); importMapping.remove("Map"); @@ -327,6 +328,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code importMapping.remove("List"); importMapping.remove("Set"); importMapping.remove("DateTime"); + importMapping.remove("UUID"); instantiationTypes.put("array", "java.util.ArrayList"); instantiationTypes.put("map", "java.util.HashMap"); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java index 3dc349edb70..4f935161730 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -21,7 +21,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen protected String testResourcesFolder = "src/test/resources"; protected String title = "Swagger Server"; - protected boolean useBeanValidation = true; + protected boolean useBeanValidation = true; static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); @@ -44,7 +44,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen cliOptions.add(new CliOption(CodegenConstants.IMPL_FOLDER, CodegenConstants.IMPL_FOLDER_DESC)); cliOptions.add(new CliOption("title", "a title describing the application")); - cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); } @@ -67,13 +67,13 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); } - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } - if (useBeanValidation) { - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - } + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } } @@ -153,6 +153,12 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen if ( "0".equals(resp.code) ) { resp.code = "200"; } + + // set vendorExtensions.x-java-is-response-void to true as dataType is set to "void" + if (resp.dataType == null) { + resp.vendorExtensions.put("x-java-is-response-void", true); + } + } } @@ -220,8 +226,8 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen return outputFolder + "/" + output + "/" + apiPackage().replace('.', '/'); } - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java index 49cd8352866..8ee22c57c84 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java @@ -1,29 +1,31 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.*; -import io.swagger.models.properties.*; -import io.swagger.models.parameters.*; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; +import io.swagger.codegen.CodegenType; +import io.swagger.codegen.DefaultCodegen; +import io.swagger.codegen.SupportingFile; import io.swagger.models.Model; import io.swagger.models.Operation; import io.swagger.models.Swagger; +import io.swagger.models.parameters.BodyParameter; +import io.swagger.models.parameters.Parameter; +import io.swagger.models.parameters.SerializableParameter; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; - import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; -import java.util.HashMap; + +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.*; -import java.io.File; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.Set; public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -194,29 +196,22 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public void processOpts() { super.processOpts(); - String curlopts = ""; if (additionalProperties.containsKey(CURL_OPTIONS)) { setCurlOptions(additionalProperties.get(CURL_OPTIONS).toString()); - additionalProperties.put("x-codegen-curl-options", curlopts); + additionalProperties.put("x-codegen-curl-options", this.curlOptions); } if (additionalProperties.containsKey(PROCESS_MARKDOWN)) { - setProcessMarkdown( - Boolean.parseBoolean( - additionalProperties.get(PROCESS_MARKDOWN).toString())); + setProcessMarkdown(convertPropertyToBooleanAndWriteBack(PROCESS_MARKDOWN)); } if (additionalProperties.containsKey(GENERATE_BASH_COMPLETION)) { - setGenerateBashCompletion( - Boolean.parseBoolean( - additionalProperties.get(GENERATE_BASH_COMPLETION).toString())); + setGenerateBashCompletion(convertPropertyToBooleanAndWriteBack(GENERATE_BASH_COMPLETION)); } if (additionalProperties.containsKey(GENERATE_ZSH_COMPLETION)) { - setGenerateZshCompletion( - Boolean.parseBoolean( - additionalProperties.get(GENERATE_ZSH_COMPLETION).toString())); + setGenerateZshCompletion(convertPropertyToBooleanAndWriteBack(GENERATE_ZSH_COMPLETION)); } if (additionalProperties.containsKey(SCRIPT_NAME)) { @@ -578,16 +573,17 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { List codesamples = (List)op.vendorExtensions.get("x-code-samples"); for (Object codesample : codesamples) { - ObjectNode codesample_object = (ObjectNode)codesample; + if(codesample instanceof ObjectNode) { + ObjectNode codesample_object = (ObjectNode) codesample; - if((codesample_object.get("lang").asText()).equals("Shell")) { + if ((codesample_object.get("lang").asText()).equals("Shell")) { - op.vendorExtensions.put("x-bash-codegen-sample", - escapeUnsafeCharacters( - codesample_object.get("source").asText())); - - } + op.vendorExtensions.put("x-bash-codegen-sample", + escapeUnsafeCharacters( + codesample_object.get("source").asText())); + } + } } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java index ea4c358c197..7857fc765fe 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java @@ -113,6 +113,7 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi typeMapping.put("file", "HttpContent"); typeMapping.put("object", "Object"); typeMapping.put("binary", "std::string"); + typeMapping.put("number", "double"); super.importMapping = new HashMap(); importMapping.put("std::vector", "#include "); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java index d2a09a8ee3c..b85b1dd0151 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java @@ -117,8 +117,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { super.processOpts(); if (additionalProperties.containsKey(BROWSER_CLIENT)) { - this.setBrowserClient(Boolean.parseBoolean((String) additionalProperties.get(BROWSER_CLIENT))); - additionalProperties.put(BROWSER_CLIENT, browserClient); + this.setBrowserClient(convertPropertyToBooleanAndWriteBack(BROWSER_CLIENT)); } else { //not set, use to be passed to template additionalProperties.put(BROWSER_CLIENT, browserClient); @@ -149,6 +148,14 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); } + // default HIDE_GENERATION_TIMESTAMP to true + if (!additionalProperties.containsKey(CodegenConstants.HIDE_GENERATION_TIMESTAMP)) { + additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, Boolean.TRUE.toString()); + } else { + additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, + Boolean.valueOf(additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP).toString())); + } + // make api and model doc path available in mustache template additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java index 4a3eed3a01b..f807325c144 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java @@ -15,12 +15,12 @@ import java.util.List; import java.util.Map; public class FinchServerCodegen extends DefaultCodegen implements CodegenConfig { - protected String invokerPackage = "io.swagger.petstore.client"; + protected String invokerPackage = "io.swagger.client"; protected String groupId = "io.swagger"; protected String artifactId = "finch-server"; protected String artifactVersion = "1.0.0"; protected String sourceFolder = "src/main/scala"; - protected String packageName = "io.swagger.petstore"; + protected String packageName = "io.swagger"; public FinchServerCodegen() { super(); @@ -156,7 +156,7 @@ public class FinchServerCodegen extends DefaultCodegen implements CodegenConfig importMapping.put("LocalTime", "java.time.LocalTime"); cliOptions.clear(); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Finch package name (e.g. io.swagger.petstore).") + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Finch package name (e.g. io.swagger).") .defaultValue(this.packageName)); cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java index e99a6b29e38..61a624648ba 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java @@ -50,6 +50,7 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf languageSpecificPrimitives.add("datetime"); languageSpecificPrimitives.add("date"); languageSpecificPrimitives.add("file"); + languageSpecificPrimitives.add("object"); typeMapping.clear(); typeMapping.put("integer", "int"); @@ -413,33 +414,9 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf @Override public String toModelFilename(String name) { - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - // remove dollar sign - name = name.replaceAll("$", ""); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - LOGGER.warn(name + " (reserved word) cannot be used as model filename. Renamed to " + underscore(dropDots("model_" + name))); - name = "model_" + name; // e.g. return => ModelReturn (after camelize) - } - - // model name starts with number - if (name.matches("^\\d.*")) { - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + underscore("model_" + name)); - name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) - } - - if (!StringUtils.isEmpty(modelNamePrefix)) { - name = modelNamePrefix + "_" + name; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - name = name + "_" + modelNameSuffix; - } - // underscore the model file name // PhoneNumber => phone_number - return underscore(dropDots(name)); + return underscore(dropDots(toModelName(name))); } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java index 97f73fcebb6..96a8a7bb926 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java @@ -389,7 +389,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf // Query parameters appended to routes for (CodegenParameter param : op.queryParams) { String paramType = param.dataType; - if(param.isListContainer != null && param.isListContainer) { + if (param.isListContainer) { paramType = makeQueryListType(paramType, param.collectionFormat); } path.add("QueryParam \"" + param.baseName + "\" " + paramType); @@ -420,7 +420,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf path.add("Header \"" + param.baseName + "\" " + param.dataType); String paramType = param.dataType; - if(param.isListContainer != null && param.isListContainer) { + if (param.isListContainer) { paramType = makeQueryListType(paramType, param.collectionFormat); } type.add("Maybe " + paramType); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java index d1c9d41ae31..214b73e0e29 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFClientCodegen.java @@ -21,30 +21,30 @@ import io.swagger.codegen.languages.features.LoggingTestFeatures; import io.swagger.models.Operation; public class JavaCXFClientCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures -{ + implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures +{ private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class); - + /** * Name of the sub-directory in "src/main/resource" where to find the * Mustache template for the JAX-RS Codegen. */ protected static final String JAXRS_TEMPLATE_DIRECTORY_NAME = "JavaJaxRS"; - + protected boolean useJaxbAnnotations = true; protected boolean useBeanValidation = false; - + protected boolean useGzipFeatureForTests = false; - + protected boolean useLoggingFeatureForTests = false; - + public JavaCXFClientCodegen() { super(); supportsInheritance = true; - + sourceFolder = "src/gen/java"; invokerPackage = "io.swagger.api"; artifactId = "swagger-jaxrs-client"; @@ -52,9 +52,9 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen apiPackage = "io.swagger.api"; modelPackage = "io.swagger.model"; - + outputFolder = "generated-code/JavaJaxRS-CXF"; - + // clear model and api doc template as this codegen // does not support auto-generated markdown doc at the moment //TODO: add doc templates @@ -63,7 +63,6 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "javax.xml.datatype.XMLGregorianCalendar"); // Map DateTime fields to Java standart class 'XMLGregorianCalendar' importMapping.put("LocalDate", "org.joda.time.LocalDate"); @@ -72,11 +71,11 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(USE_JAXB_ANNOTATIONS, "Use JAXB annotations for XML")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); - + cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests")); cliOptions.add(CliOption.newBoolean(USE_LOGGING_FEATURE_FOR_TESTS, "Use Logging Feature for tests")); - - + + } @@ -84,7 +83,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen public void processOpts() { super.processOpts(); - + if (additionalProperties.containsKey(USE_JAXB_ANNOTATIONS)) { boolean useJaxbAnnotationsProp = convertPropertyToBooleanAndWriteBack(USE_JAXB_ANNOTATIONS); this.setUseJaxbAnnotations(useJaxbAnnotationsProp); @@ -94,15 +93,15 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen boolean useBeanValidationProp = convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION); this.setUseBeanValidation(useBeanValidationProp); } - + this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS)); this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS)); - - + + supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen - + writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); - + } @Override @@ -117,13 +116,13 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen { return CodegenType.CLIENT; } - + @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { - super.addOperationToGroup(tag, resourcePath, operation, co, operations); + super.addOperationToGroup(tag, resourcePath, operation, co, operations); co.subresourceOperation = !co.path.isEmpty(); } - + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); @@ -132,17 +131,17 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen model.imports.remove("JsonSerialize"); model.imports.remove("ToStringSerializer"); } - + @Override public String getHelp() { return "Generates a Java JAXRS Client based on Apache CXF framework."; } - + public void setUseBeanValidation(boolean useBeanValidation) { this.useBeanValidation = useBeanValidation; } - + public void setUseJaxbAnnotations(boolean useJaxbAnnotations) { this.useJaxbAnnotations = useJaxbAnnotations; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java index 720cbc49331..8c1b012ba62 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaCXFServerCodegen.java @@ -78,7 +78,6 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "javax.xml.datatype.XMLGregorianCalendar"); // Map DateTime fields to Java standart class 'XMLGregorianCalendar' importMapping.put("LocalDate", "org.joda.time.LocalDate"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index a39852247fe..6ef0f416135 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -2,6 +2,7 @@ package io.swagger.codegen.languages; import io.swagger.codegen.*; import io.swagger.codegen.languages.features.BeanValidationFeatures; +import io.swagger.codegen.languages.features.GzipFeatures; import io.swagger.codegen.languages.features.PerformBeanValidationFeatures; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -13,13 +14,17 @@ import java.util.*; import java.util.regex.Pattern; public class JavaClientCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, PerformBeanValidationFeatures { + implements BeanValidationFeatures, PerformBeanValidationFeatures, + GzipFeatures +{ static final String MEDIA_TYPE = "mediaType"; - @SuppressWarnings("hiding") + @SuppressWarnings("hiding") private static final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class); public static final String USE_RX_JAVA = "useRxJava"; + public static final String USE_RX_JAVA2 = "useRxJava2"; + public static final String DO_NOT_USE_RX = "doNotUseRx"; public static final String USE_PLAY24_WS = "usePlay24WS"; public static final String PARCELABLE_MODEL = "parcelableModel"; @@ -28,10 +33,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected String gradleWrapperPackage = "gradle.wrapper"; protected boolean useRxJava = false; + protected boolean useRxJava2 = false; + protected boolean doNotUseRx = true; // backwards compatibility for swagger configs that specify neither rx1 nor rx2 (mustache does not allow for boolean operators so we need this extra field) protected boolean usePlay24WS = false; protected boolean parcelableModel = false; protected boolean useBeanValidation = false; protected boolean performBeanValidation = false; + protected boolean useGzipFeature = false; public JavaClientCodegen() { super(); @@ -43,18 +51,20 @@ public class JavaClientCodegen extends AbstractJavaCodegen modelPackage = "io.swagger.client.model"; cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library.")); + cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library.")); cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library.")); cliOptions.add(CliOption.newBoolean(USE_PLAY24_WS, "Use Play! 2.4 Async HTTP client (Play WS API)")); cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library.")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation")); + cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE, "Send gzip-encoded requests")); - supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.1. JSON processing: Jackson 2.7.0. Enable Java6 support using '-DsupportJava6=true'."); + supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.1. JSON processing: Jackson 2.7.0. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); supportedLibraries.put("feign", "HTTP client: Netflix Feign 8.16.0. JSON processing: Jackson 2.7.0"); supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.22.2. JSON processing: Jackson 2.7.0"); - supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.6.2. Enable Parcelable modles on Android using '-DparcelableModel=true'"); + supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.6.2. Enable Parcelable modles on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead."); - supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.2.0. JSON processing: Gson 2.6.1 (Retrofit 2.0.2). Enable the RxJava adapter using '-DuseRxJava=true'. (RxJava 1.1.3)"); + supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.2.0. JSON processing: Gson 2.6.1 (Retrofit 2.0.2). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); libraryOption.setEnum(supportedLibraries); @@ -84,9 +94,17 @@ public class JavaClientCodegen extends AbstractJavaCodegen public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(USE_RX_JAVA)) { + if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)) { + LOGGER.warn("You specified both RxJava versions 1 and 2 but they are mutually exclusive. Defaulting to v2."); + } else if (additionalProperties.containsKey(USE_RX_JAVA)) { this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString())); } + if (additionalProperties.containsKey(USE_RX_JAVA2)) { + this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString())); + } + if (!useRxJava && !useRxJava2) { + additionalProperties.put(DO_NOT_USE_RX, true); + } if (additionalProperties.containsKey(USE_PLAY24_WS)) { this.setUsePlay24WS(Boolean.valueOf(additionalProperties.get(USE_PLAY24_WS).toString())); } @@ -106,6 +124,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen this.setPerformBeanValidation(convertPropertyToBooleanAndWriteBack(PERFORM_BEANVALIDATION)); } + if (additionalProperties.containsKey(USE_GZIP_FEATURE)) { + this.setUseGzipFeature(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE)); + } + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); final String authFolder = (sourceFolder + '/' + invokerPackage + ".auth").replace(".", "/"); @@ -161,6 +183,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); supportingFiles.add(new SupportingFile("ProgressRequestBody.mustache", invokerFolder, "ProgressRequestBody.java")); supportingFiles.add(new SupportingFile("ProgressResponseBody.mustache", invokerFolder, "ProgressResponseBody.java")); + supportingFiles.add(new SupportingFile("GzipRequestInterceptor.mustache", invokerFolder, "GzipRequestInterceptor.java")); additionalProperties.put("gson", "true"); } else if (usesAnyRetrofitLibrary()) { supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); @@ -233,7 +256,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen if ( isMultipartType(operation.consumes) ) { operation.isMultipart = Boolean.TRUE; - } + } else { operation.prioritizedContentTypes = prioritizeContentTypes(operation.consumes); } @@ -341,6 +364,16 @@ public class JavaClientCodegen extends AbstractJavaCodegen public void setUseRxJava(boolean useRxJava) { this.useRxJava = useRxJava; + doNotUseRx = false; + } + + public void setUseRxJava2(boolean useRxJava2) { + this.useRxJava2 = useRxJava2; + doNotUseRx = false; + } + + public void setDoNotUseRx(boolean doNotUseRx) { + this.doNotUseRx = doNotUseRx; } public void setUsePlay24WS(boolean usePlay24WS) { @@ -360,6 +393,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen this.performBeanValidation = performBeanValidation; } + public void setUseGzipFeature(boolean useGzipFeature) { + this.useGzipFeature = useGzipFeature; + } + final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?"); final private static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java index 6c91e175db5..55b2b87da64 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -21,9 +21,9 @@ import io.swagger.models.Swagger; import io.swagger.models.properties.Property; import io.swagger.util.Json; -public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen -{ - +public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen +{ + public JavaJAXRSSpecServerCodegen() { super(); @@ -48,7 +48,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen additionalProperties.put("title", title); typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "javax.xml.datatype.XMLGregorianCalendar"); // Map DateTime fields to Java standart class 'XMLGregorianCalendar' importMapping.put("LocalDate", "org.joda.time.LocalDate"); @@ -60,7 +59,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen break; } } - + CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); library.setDefault(DEFAULT_LIBRARY); @@ -71,20 +70,20 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen cliOptions.add(library); } - + @Override public void processOpts() { super.processOpts(); - + supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); - + writeOptional(outputFolder, new SupportingFile("RestApplication.mustache", (sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestApplication.java")); - - } - + + } + @Override public String getName() @@ -119,7 +118,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen opList.add(co); co.baseName = basePath; } - + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); @@ -130,10 +129,10 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen model.imports.remove("JsonValue"); model.imports.remove("JsonProperty"); } - + @Override public void preprocessSwagger(Swagger swagger) { - //copy input swagger to output folder + //copy input swagger to output folder try { String swaggerJson = Json.pretty(swagger); FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java new file mode 100644 index 00000000000..ef87ed93b05 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java @@ -0,0 +1,248 @@ +package io.swagger.codegen.languages; + +import io.swagger.codegen.*; +import io.swagger.codegen.languages.features.BeanValidationFeatures; + +import java.io.File; +import java.util.List; +import java.util.Map; + +public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { + + public static final String TITLE = "title"; + public static final String CONFIG_PACKAGE = "configPackage"; + public static final String BASE_PACKAGE = "basePackage"; + public static final String CONTROLLER_ONLY = "controllerOnly"; + public static final String SINGLE_CONTENT_TYPES = "singleContentTypes"; + public static final String RESPONSE_WRAPPER = "responseWrapper"; + public static final String USE_TAGS = "useTags"; + + protected String title = "swagger-petstore"; + protected String configPackage = "io.swagger.configuration"; + protected String basePackage = "io.swagger"; + protected boolean controllerOnly = false; + protected boolean singleContentTypes = false; + protected String responseWrapper = ""; + protected boolean useTags = false; + protected boolean useBeanValidation = true; + + public JavaPlayFrameworkCodegen() { + super(); + outputFolder = "generated-code/javaPlayFramework"; + apiTestTemplateFiles.clear(); + embeddedTemplateDir = templateDir = "JavaPlayFramework"; + apiPackage = "controllers"; + modelPackage = "apimodels"; + invokerPackage = "io.swagger.api"; + artifactId = "swagger-java-playframework"; + + projectFolder = ""; + sourceFolder = projectFolder + File.separator + "app"; + projectTestFolder = projectFolder + File.separator + "test"; + testFolder = projectTestFolder; + + additionalProperties.put(CONFIG_PACKAGE, configPackage); + additionalProperties.put(BASE_PACKAGE, basePackage); + + additionalProperties.put("jackson", "true"); + + cliOptions.add(new CliOption(TITLE, "server title name or client service name")); + cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code")); + cliOptions.add(new CliOption(BASE_PACKAGE, "base package for generated code")); + cliOptions.add(CliOption.newBoolean(CONTROLLER_ONLY, "Whether to generate only API interface stubs without the server files.")); + cliOptions.add(CliOption.newBoolean(SINGLE_CONTENT_TYPES, "Whether to select only one produces/consumes content-type by operation.")); + cliOptions.add(new CliOption(RESPONSE_WRAPPER, "wrap the responses in given type (Future,Callable,CompletableFuture,ListenableFuture,DeferredResult,HystrixCommand,RxObservable,RxSingle or fully qualified type)")); + cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames")); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + } + + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + @Override + public String getName() { + return "java-play-framework"; + } + + @Override + public String getHelp() { + return "Generates a Java Play Framework Server application."; + } + + @Override + public void processOpts() { + super.processOpts(); + + // clear model and api doc template as this codegen + // does not support auto-generated markdown doc at the moment + //TODO: add doc templates + modelDocTemplateFiles.remove("model_doc.mustache"); + apiDocTemplateFiles.remove("api_doc.mustache"); + + if (additionalProperties.containsKey(TITLE)) { + this.setTitle((String) additionalProperties.get(TITLE)); + } + + if (additionalProperties.containsKey(CONFIG_PACKAGE)) { + this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE)); + } + + if (additionalProperties.containsKey(BASE_PACKAGE)) { + this.setBasePackage((String) additionalProperties.get(BASE_PACKAGE)); + } + + if (additionalProperties.containsKey(CONTROLLER_ONLY)) { + this.setControllerOnly(Boolean.valueOf(additionalProperties.get(CONTROLLER_ONLY).toString())); + } + + if (additionalProperties.containsKey(SINGLE_CONTENT_TYPES)) { + this.setSingleContentTypes(Boolean.valueOf(additionalProperties.get(SINGLE_CONTENT_TYPES).toString())); + } + + if (additionalProperties.containsKey(RESPONSE_WRAPPER)) { + this.setResponseWrapper((String) additionalProperties.get(RESPONSE_WRAPPER)); + } + + if (additionalProperties.containsKey(USE_TAGS)) { + this.setUseTags(Boolean.valueOf(additionalProperties.get(USE_TAGS).toString())); + } + + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } + + //Root folder + supportingFiles.add(new SupportingFile("README.mustache", "", "README")); + supportingFiles.add(new SupportingFile("LICENSE.mustache", "", "LICENSE")); + supportingFiles.add(new SupportingFile("build.mustache", "", "build.sbt")); + + //Project folder + supportingFiles.add(new SupportingFile("buildproperties.mustache", "project", "build.properties")); + supportingFiles.add(new SupportingFile("plugins.mustache", "project", "plugins.sbt")); + + //Conf folder + supportingFiles.add(new SupportingFile("logback.mustache", "conf", "logback.xml")); + supportingFiles.add(new SupportingFile("application.mustache", "conf", "application.conf")); + supportingFiles.add(new SupportingFile("routes.mustache", "conf", "routes")); + + //App/Utils folder + supportingFiles.add(new SupportingFile("swaggerUtils.mustache", "app/swagger", "SwaggerUtils.java")); + + //App/Controllers + supportingFiles.add(new SupportingFile("apiDocController.mustache", "app/controllers", "ApiDocController.java")); + + //We remove the default api.mustache that is used + apiTemplateFiles.remove("api.mustache"); + apiTemplateFiles.put("newApiController.mustache", "Controller.java"); + if (!this.controllerOnly) { + apiTemplateFiles.put("newApi.mustache", "ControllerImp.java"); + } + + additionalProperties.put("javaVersion", "1.8"); + additionalProperties.put("jdk8", "true"); + typeMapping.put("date", "LocalDate"); + typeMapping.put("DateTime", "OffsetDateTime"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("OffsetDateTime", "java.time.OffsetDateTime"); + + // Some well-known Spring or Spring-Cloud response wrappers + switch (this.responseWrapper) { + case "Future": + case "Callable": + case "CompletableFuture": + additionalProperties.put(RESPONSE_WRAPPER, "java.util.concurrent" + this.responseWrapper); + break; + default: + break; + } + } + + public void setTitle(String title) { + this.title = title; + } + + public void setConfigPackage(String configPackage) { + this.configPackage = configPackage; + } + + public void setBasePackage(String configPackage) { + this.basePackage = configPackage; + } + + public void setControllerOnly(boolean controllerOnly) { this.controllerOnly = controllerOnly; } + + public void setSingleContentTypes(boolean singleContentTypes) { + this.singleContentTypes = singleContentTypes; + } + + public void setResponseWrapper(String responseWrapper) { this.responseWrapper = responseWrapper; } + + public void setUseTags(boolean useTags) { + this.useTags = useTags; + } + + @Override + public Map postProcessOperations(Map objs) { + Map operations = (Map) objs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation operation : ops) { + + //This is to fix this bug in the swagger-play project: https://github.com/swagger-api/swagger-play/issues/131 + //We need to explicitly add the model package name in front of the dataType because if we don't, the + //implicitParam is not valid and show error when loading the documentation + //This can be removed safely after the bug has been fixed + for (CodegenParameter param : operation.allParams) { + if (!param.isPathParam ) { + if (!param.isPrimitiveType && !param.isListContainer && !param.isMapContainer) { + param.dataTypeForImplicitParam = String.format("%s.%s", modelPackage, param.dataType); + } else { + param.dataTypeForImplicitParam = param.dataType; + } + } + } + + if (operation.path.contains("{")) { + operation.path = operation.path.replace("{", ":").replace("}", ""); + } + + if (operation.returnType != null) { + if (operation.returnType.startsWith("List")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("List<".length(), end).trim(); + operation.returnContainer = "List"; + } + } else if (operation.returnType.startsWith("Map")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); + operation.returnContainer = "Map"; + } + } else if (operation.returnType.startsWith("Set")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Set<".length(), end).trim(); + operation.returnContainer = "Set"; + } + } + } + } + } + + return objs; + } + + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java new file mode 100644 index 00000000000..f9c9cad1380 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyEapServerCodegen.java @@ -0,0 +1,231 @@ +package io.swagger.codegen.languages; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.BooleanUtils; + +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenModel; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenProperty; +import io.swagger.codegen.CodegenResponse; +import io.swagger.codegen.SupportingFile; +import io.swagger.codegen.languages.features.BeanValidationFeatures; +import io.swagger.codegen.languages.features.JbossFeature; +import io.swagger.codegen.languages.features.SwaggerFeatures; +import io.swagger.models.Operation; + +public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen + implements JbossFeature, BeanValidationFeatures, SwaggerFeatures { + + protected boolean useBeanValidation = true; + protected boolean generateJbossDeploymentDescriptor = true; + protected boolean useSwaggerFeature = false; + + public JavaResteasyEapServerCodegen() { + + super(); + + artifactId = "swagger-jaxrs-resteasy-eap-server"; + + outputFolder = "generated-code/JavaJaxRS-Resteasy-eap"; + apiTemplateFiles.put("apiServiceImpl.mustache", ".java"); + apiTestTemplateFiles.clear(); // TODO: add test template + + // clear model and api doc template as AbstractJavaJAXRSServerCodegen + // does not support auto-generated markdown doc at the moment + //TODO: add doc templates + modelDocTemplateFiles.remove("model_doc.mustache"); + apiDocTemplateFiles.remove("api_doc.mustache"); + + dateLibrary = "legacy";// TODO: change to joda + + embeddedTemplateDir = templateDir = "JavaJaxRS" + File.separator + "resteasy" + File.separator + "eap"; + + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + cliOptions.add(CliOption.newBoolean(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, "Generate Jboss Deployment Descriptor")); + cliOptions.add(CliOption.newBoolean(USE_SWAGGER_FEATURE, "Use dynamic Swagger generator")); + + } + + @Override + public String getName() { + return "jaxrs-resteasy-eap"; + } + + @Override + public String getHelp() { + return "Generates a Java JAXRS-Resteasy Server application."; + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR)) { + boolean generateJbossDeploymentDescriptorProp = convertPropertyToBooleanAndWriteBack(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR); + this.setGenerateJbossDeploymentDescriptor(generateJbossDeploymentDescriptorProp); + } + + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + if (useBeanValidation) { + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + } + + if (additionalProperties.containsKey(USE_SWAGGER_FEATURE)) { + this.setUseSwaggerFeature(convertPropertyToBoolean(USE_SWAGGER_FEATURE)); + } + + if (useSwaggerFeature) { + writePropertyBack(USE_SWAGGER_FEATURE, useSwaggerFeature); + } + + writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); + writeOptional(outputFolder, new SupportingFile("gradle.mustache", "", "build.gradle")); + writeOptional(outputFolder, new SupportingFile("settingsGradle.mustache", "", "settings.gradle")); + writeOptional(outputFolder, new SupportingFile("README.mustache", "", "README.md")); + writeOptional(outputFolder, new SupportingFile("web.mustache", ("src/main/webapp/WEB-INF"), "web.xml")); + + supportingFiles.add(new SupportingFile("JacksonConfig.mustache", (projectFolder + File.separator + "java" + '/' + invokerPackage).replace(".", "/"), "JacksonConfig.java")); + + if (generateJbossDeploymentDescriptor) { + writeOptional(outputFolder, new SupportingFile("jboss-web.mustache", ("src/main/webapp/WEB-INF"), "jboss-web.xml")); + } + + writeOptional(outputFolder, new SupportingFile("RestApplication.mustache", (projectFolder + File.separator + "java" + '/' + invokerPackage).replace(".", "/"), "RestApplication.java")); + + } + + @Override + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { + String basePath = resourcePath; + if (basePath.startsWith("/")) { + basePath = basePath.substring(1); + } + int pos = basePath.indexOf("/"); + if (pos > 0) { + basePath = basePath.substring(0, pos); + } + + if (basePath == "") { + basePath = "default"; + } else { + if (co.path.startsWith("/" + basePath)) { + co.path = co.path.substring(("/" + basePath).length()); + } + co.subresourceOperation = !co.path.isEmpty(); + } + List opList = operations.get(basePath); + if (opList == null) { + opList = new ArrayList(); + operations.put(basePath, opList); + } + opList.add(co); + co.baseName = basePath; + } + + @Override + public Map postProcessOperations(Map objs) { + + Map operations = (Map) objs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation operation : ops) { + if (operation.hasConsumes == Boolean.TRUE) { + Map firstType = operation.consumes.get(0); + if (firstType != null) { + if ("multipart/form-data".equals(firstType.get("mediaType"))) { + operation.isMultipart = Boolean.TRUE; + } + } + } + List responses = operation.responses; + if (responses != null) { + for (CodegenResponse resp : responses) { + if ("0".equals(resp.code)) { + resp.code = "200"; + } + } + } + if (operation.returnType == null) { + operation.returnType = "Void"; + } else if (operation.returnType.startsWith("List")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("List<".length(), end).trim(); + operation.returnContainer = "List"; + } + } else if (operation.returnType.startsWith("Map")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); + operation.returnContainer = "Map"; + } + } else if (operation.returnType.startsWith("Set")) { + String rt = operation.returnType; + int end = rt.lastIndexOf(">"); + if (end > 0) { + operation.returnType = rt.substring("Set<".length(), end).trim(); + operation.returnContainer = "Set"; + } + } + } + } + return objs; + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + // Add imports for Jackson + if (!BooleanUtils.toBoolean(model.isEnum)) { + model.imports.add("JsonProperty"); + + if (BooleanUtils.toBoolean(model.hasEnums)) { + model.imports.add("JsonValue"); + } + } + } + + @Override + public Map postProcessModelsEnum(Map objs) { + objs = super.postProcessModelsEnum(objs); + + // Add imports for Jackson + List> imports = (List>) objs.get("imports"); + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + // for enum model + if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { + cm.imports.add(importMapping.get("JsonValue")); + Map item = new HashMap(); + item.put("import", importMapping.get("JsonValue")); + imports.add(item); + } + } + + return objs; + } + + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } + + public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor) { + this.generateJbossDeploymentDescriptor = generateJbossDeploymentDescriptor; + } + + public void setUseSwaggerFeature(boolean useSwaggerFeature) { + this.useSwaggerFeature = useSwaggerFeature; + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 8b68dcdbd16..04f557cef83 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -202,7 +202,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo Boolean.valueOf(additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP).toString())); } - if (additionalProperties.containsKey(PROJECT_NAME)) { setProjectName(((String) additionalProperties.get(PROJECT_NAME))); } @@ -228,19 +227,19 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); } if (additionalProperties.containsKey(USE_PROMISES)) { - setUsePromises(Boolean.parseBoolean((String)additionalProperties.get(USE_PROMISES))); + setUsePromises(convertPropertyToBooleanAndWriteBack(USE_PROMISES)); } if (additionalProperties.containsKey(USE_INHERITANCE)) { - setUseInheritance(Boolean.parseBoolean((String)additionalProperties.get(USE_INHERITANCE))); + setUseInheritance(convertPropertyToBooleanAndWriteBack(USE_INHERITANCE)); } else { supportsInheritance = true; supportsMixins = true; } if (additionalProperties.containsKey(EMIT_MODEL_METHODS)) { - setEmitModelMethods(Boolean.parseBoolean((String)additionalProperties.get(EMIT_MODEL_METHODS))); + setEmitModelMethods(convertPropertyToBooleanAndWriteBack(EMIT_MODEL_METHODS)); } if (additionalProperties.containsKey(EMIT_JS_DOC)) { - setEmitJSDoc(Boolean.parseBoolean((String)additionalProperties.get(EMIT_JS_DOC))); + setEmitJSDoc(convertPropertyToBooleanAndWriteBack(EMIT_JS_DOC)); } } @@ -710,7 +709,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo CodegenParameter lastRequired = null; CodegenParameter lastOptional = null; for (CodegenParameter p : op.allParams) { - if (p.required != null && p.required) { + if (p.required) { lastRequired = p; } else { lastOptional = p; @@ -778,12 +777,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo + (StringUtils.isEmpty(modelPackage) ? "" : (modelPackage + "/")) + dataType; } - /* - private String getJSDocTypeWithBraces(CodegenModel cm, CodegenProperty cp) { - return "{" + getJSDocType(cm, cp) + "}"; - } - */ - private String getJSDocType(CodegenModel cm, CodegenProperty cp) { if (Boolean.TRUE.equals(cp.isContainer)) { if (cp.containerType.equals("array")) @@ -805,12 +798,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.datatype : cp.baseType); } - /* - private String getJSDocTypeWithBraces(CodegenParameter cp) { - return "{" + getJSDocType(cp) + "}"; - } - */ - private String getJSDocType(CodegenParameter cp) { String dataType = trimBrackets(cp.dataType); if (isModelledType(cp)) @@ -828,13 +815,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.dataType : cp.baseType); } - /* - private String getJSDocTypeWithBraces(CodegenOperation co) { - String jsDocType = getJSDocType(co); - return jsDocType == null ? null : "{" + jsDocType + "}"; - } - */ - private String getJSDocType(CodegenOperation co) { String returnType = trimBrackets(co.returnType); if (returnType != null) { @@ -866,7 +846,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo List argList = new ArrayList(); boolean hasOptionalParams = false; for (CodegenParameter p : operation.allParams) { - if (p.required != null && p.required) { + if (p.required) { argList.add(p.paramName); } else { hasOptionalParams = true; @@ -950,15 +930,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type); } -/* - @Override - public String findCommonPrefixOfVars(List vars) { - String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()])); - // exclude trailing characters that should be part of a valid variable - // e.g. ["status-on", "status-off"] => "status-" (not "status-o") - return prefix.replaceAll("[a-zA-Z0-9]+\\z", ""); - } -*/ private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { // This generator uses inline classes to define enums, which breaks when diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index b7983823bbd..150446a2967 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -17,6 +17,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; @@ -519,7 +520,10 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig if (p instanceof StringProperty) { StringProperty dp = (StringProperty) p; if (dp.getDefault() != null) { - return "'" + dp.getDefault() + "'"; + if (Pattern.compile("\r\n|\r|\n").matcher(dp.getDefault()).find()) + return "'''" + dp.getDefault() + "'''"; + else + return "'" + dp.getDefault() + "'"; } } else if (p instanceof BooleanProperty) { BooleanProperty dp = (BooleanProperty) p; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java index 4dca4806180..cab74966da1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java @@ -272,7 +272,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig { CodegenParameter lastRequired = null; CodegenParameter lastOptional = null; for (CodegenParameter p : op.allParams) { - if (p.required != null && p.required) { + if (p.required) { lastRequired = p; } else { lastOptional = p; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java index 9fe6eb2b34a..088d4bc5b03 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java @@ -3,6 +3,7 @@ package io.swagger.codegen.languages; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenType; +import io.swagger.codegen.CodegenOperation; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.SupportingFile; import io.swagger.models.properties.ArrayProperty; @@ -13,6 +14,10 @@ import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; public class SilexServerCodegen extends DefaultCodegen implements CodegenConfig { protected String invokerPackage; @@ -213,4 +218,28 @@ public class SilexServerCodegen extends DefaultCodegen implements CodegenConfig public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } + + @Override + public Map postProcessOperations(Map objs) { + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + String path = new String(op.path); + String[] items = path.split("/", -1); + String opsPath = ""; + int pathParamIndex = 0; + + for (int i = 0; i < items.length; ++i) { + if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {} + // camelize path variable + items[i] = "{" + camelize(items[i].substring(1, items[i].length()-1), true) + "}"; + } + } + + op.path = StringUtils.join(items, "/"); + } + + return objs; + } + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java index 2a69c2cf4f7..c8b41383ada 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java @@ -23,6 +23,7 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation public static final String USE_TAGS = "useTags"; public static final String SPRING_MVC_LIBRARY = "spring-mvc"; public static final String SPRING_CLOUD_LIBRARY = "spring-cloud"; + public static final String IMPLICIT_HEADERS = "implicitHeaders"; protected String title = "swagger-petstore"; protected String configPackage = "io.swagger.configuration"; @@ -34,7 +35,8 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation protected boolean async = false; protected String responseWrapper = ""; protected boolean useTags = false; - protected boolean useBeanValidation = true; + protected boolean useBeanValidation = true; + protected boolean implicitHeaders = false; public SpringCodegen() { super(); @@ -63,6 +65,7 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation cliOptions.add(new CliOption(RESPONSE_WRAPPER, "wrap the responses in given type (Future,Callable,CompletableFuture,ListenableFuture,DeferredResult,HystrixCommand,RxObservable,RxSingle or fully qualified type)")); cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); + cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Use of @ApiImplicitParams for headers.")); supportedLibraries.put(DEFAULT_LIBRARY, "Spring-boot Server application using the SpringFox integration."); supportedLibraries.put(SPRING_MVC_LIBRARY, "Spring-MVC Server application using the SpringFox integration."); @@ -162,6 +165,11 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation writePropertyBack(USE_BEANVALIDATION, useBeanValidation); } + + if (additionalProperties.containsKey(IMPLICIT_HEADERS)) { + this.setImplicitHeaders(Boolean.valueOf(additionalProperties.get(IMPLICIT_HEADERS).toString())); + } + supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); @@ -410,12 +418,36 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation operation.returnContainer = "Set"; } } + + if(implicitHeaders){ + removeHeadersFromAllParams(operation.allParams); + } } } return objs; } + /** + * This method removes header parameters from the list of parameters and also + * corrects last allParams hasMore state. + * @param allParams list of all parameters + */ + private void removeHeadersFromAllParams(List allParams) { + if(allParams.isEmpty()){ + return; + } + final ArrayList copy = new ArrayList<>(allParams); + allParams.clear(); + + for(CodegenParameter p : copy){ + if(!p.isHeaderParam){ + allParams.add(p); + } + } + allParams.get(allParams.size()-1).hasMore =false; + } + @Override public Map postProcessSupportingFileData(Map objs) { if(library.equals(SPRING_CLOUD_LIBRARY)) { @@ -468,6 +500,10 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation this.useTags = useTags; } + public void setImplicitHeaders(boolean implicitHeaders) { + this.implicitHeaders = implicitHeaders; + } + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java index 06c23075e8e..dba87bf44cb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java @@ -1,15 +1,24 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.*; +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; +import io.swagger.codegen.CodegenResponse; +import io.swagger.codegen.CodegenType; +import io.swagger.codegen.DefaultCodegen; +import io.swagger.codegen.SupportingFile; +import io.swagger.models.Info; import io.swagger.models.Model; import io.swagger.models.Operation; import io.swagger.models.Swagger; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; -import io.swagger.models.Info; import org.apache.commons.lang3.StringUtils; + import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -113,6 +122,11 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi List operationList = (List) operations.get("operation"); for (CodegenOperation op : operationList) { op.httpMethod = op.httpMethod.toLowerCase(); + for (CodegenResponse response : op.responses){ + if ("0".equals(response.code)){ + response.code = "default"; + } + } } return objs; } @@ -158,7 +172,7 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi CodegenParameter lastRequired = null; CodegenParameter lastOptional = null; for (CodegenParameter p : op.allParams) { - if (p.required != null && p.required) { + if (p.required) { lastRequired = p; } else { lastOptional = p; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java index 2fe4cd7b665..1a69811723e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtmlGenerator.java @@ -4,6 +4,7 @@ import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenResponse; import io.swagger.codegen.CodegenType; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.SupportingFile; @@ -41,7 +42,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC)); - + additionalProperties.put("appName", "Swagger Sample"); additionalProperties.put("appDescription", "A sample swagger server"); additionalProperties.put("infoUrl", "https://helloreverb.com"); @@ -96,12 +97,17 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig return super.getTypeDeclaration(p); } - @Override +@Override public Map postProcessOperations(Map objs) { Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); for (CodegenOperation op : operationList) { op.httpMethod = op.httpMethod.toLowerCase(); + for (CodegenResponse response : op.responses) { + if ("0".equals(response.code)) { + response.code = "default"; + } + } } return objs; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java index 6282f72d8b7..23935e4c557 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java @@ -52,4 +52,16 @@ public class SwaggerGenerator extends DefaultCodegen implements CodegenConfig { LOGGER.error(e.getMessage(), e); } } + + @Override + public String escapeQuotationMark(String input) { + // just return the original string + return input; + } + + @Override + public String escapeUnsafeCharacters(String input) { + // just return the original string + return input; + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java index 9faa3041968..ad89a02e269 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java @@ -61,4 +61,17 @@ public class SwaggerYamlGenerator extends DefaultCodegen implements CodegenConfi LOGGER.error(e.getMessage(), e); } } + + @Override + public String escapeQuotationMark(String input) { + // just return the original string + return input; + } + + @Override + public String escapeUnsafeCharacters(String input) { + // just return the original string + return input; + } + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java index 79024765e1e..9e53ab4bf5f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java @@ -184,7 +184,7 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { // Setup unwrapRequired option, which makes all the properties with "required" non-optional if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { - setUnwrapRequired(Boolean.parseBoolean(String.valueOf(additionalProperties.get(UNWRAP_REQUIRED)))); + setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); } additionalProperties.put(UNWRAP_REQUIRED, unwrapRequired); @@ -207,9 +207,8 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { // Setup swiftUseApiNamespace option, which makes all the API classes inner-class of {{projectName}}API if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { - swiftUseApiNamespace = Boolean.parseBoolean(String.valueOf(additionalProperties.get(SWIFT_USE_API_NAMESPACE))); + setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); } - additionalProperties.put(SWIFT_USE_API_NAMESPACE, swiftUseApiNamespace); if (!additionalProperties.containsKey(POD_AUTHORS)) { additionalProperties.put(POD_AUTHORS, DEFAULT_POD_AUTHORS); @@ -496,6 +495,10 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { this.responseAs = responseAs; } + public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { + this.swiftUseApiNamespace = swiftUseApiNamespace; + } + @Override public String toEnumValue(String value, String datatype) { return String.valueOf(value); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java index 05e9e1a2d50..bb80b7b3ba0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java @@ -184,9 +184,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { // Setup unwrapRequired option, which makes all the properties with "required" non-optional if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { - setUnwrapRequired(Boolean.parseBoolean(String.valueOf(additionalProperties.get(UNWRAP_REQUIRED)))); + setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); } - additionalProperties.put(UNWRAP_REQUIRED, unwrapRequired); // Setup unwrapRequired option, which makes all the properties with "required" non-optional if (additionalProperties.containsKey(RESPONSE_AS)) { @@ -207,9 +206,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { // Setup swiftUseApiNamespace option, which makes all the API classes inner-class of {{projectName}}API if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { - swiftUseApiNamespace = Boolean.parseBoolean(String.valueOf(additionalProperties.get(SWIFT_USE_API_NAMESPACE))); + setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); } - additionalProperties.put(SWIFT_USE_API_NAMESPACE, swiftUseApiNamespace); if (!additionalProperties.containsKey(POD_AUTHORS)) { additionalProperties.put(POD_AUTHORS, DEFAULT_POD_AUTHORS); @@ -531,6 +529,10 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { this.responseAs = responseAs; } + public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { + this.swiftUseApiNamespace = swiftUseApiNamespace; + } + @Override public String toEnumValue(String value, String datatype) { if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java index 6818c29059d..238b1daa950 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/BeanValidationFeatures.java @@ -4,7 +4,7 @@ public interface BeanValidationFeatures { // Language supports generating BeanValidation-Annotations public static final String USE_BEANVALIDATION = "useBeanValidation"; - + public void setUseBeanValidation(boolean useBeanValidation); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java index 78e4f3decc9..20e641b603c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/CXFServerFeatures.java @@ -5,8 +5,7 @@ package io.swagger.codegen.languages.features; * */ public interface CXFServerFeatures - extends CXFFeatures, SwaggerFeatures, SpringFeatures, JbossFeature, BeanValidationExtendedFeatures, - SwaggerUIFeatures + extends CXFFeatures, SwaggerFeatures, SpringFeatures, JbossFeature, BeanValidationExtendedFeatures, SwaggerUIFeatures { public static final String USE_WADL_FEATURE = "useWadlFeature"; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java index 3f30fb075f3..b1638d63f8c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/PerformBeanValidationFeatures.java @@ -4,7 +4,7 @@ public interface PerformBeanValidationFeatures { // Language supports performing BeanValidation public static final String PERFORM_BEANVALIDATION = "performBeanValidation"; - + public void setPerformBeanValidation(boolean performBeanValidation); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java index 0a3fad4202a..58b09ddb5d2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SpringFeatures.java @@ -14,5 +14,5 @@ public interface SpringFeatures extends BeanValidationFeatures { public void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig); - + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java index f60b2391e03..3f10e4c0a9d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/SwaggerFeatures.java @@ -1,6 +1,6 @@ package io.swagger.codegen.languages.features; -public interface SwaggerFeatures extends CXFFeatures { +public interface SwaggerFeatures { public static final String USE_SWAGGER_FEATURE = "useSwaggerFeature"; diff --git a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache index c952718b6ec..9f82181d45e 100644 --- a/modules/swagger-codegen/src/main/resources/Groovy/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache @@ -18,7 +18,7 @@ class {{classname}} { {{#operation}} def {{operationId}} ({{#allParams}} {{{dataType}}} {{paramName}},{{/allParams}} Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "{{path}}" // query params @@ -35,13 +35,15 @@ class {{classname}} { {{/allParams}} {{#queryParams}}if (!"null".equals(String.valueOf({{paramName}}))) - queryParams.put("{{paramName}}", String.valueOf({{paramName}})) + queryParams.put("{{baseName}}", String.valueOf({{paramName}})) {{/queryParams}} {{#headerParams}} - headerParams.put("{{paramName}}", {{paramName}}) + headerParams.put("{{baseName}}", {{paramName}}) {{/headerParams}} + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "{{httpMethod}}", "{{returnContainer}}", {{#returnBaseType}}{{{returnBaseType}}}.class {{/returnBaseType}}{{^returnBaseType}}null {{/returnBaseType}}) diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index 8f5fb42cd7b..06ccf2c558e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -22,6 +22,7 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.GenericType; import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.GZIPContentEncodingFilter; import com.sun.jersey.api.client.filter.LoggingFilter; import com.sun.jersey.api.client.WebResource.Builder; @@ -124,6 +125,7 @@ public class ApiClient { DefaultClientConfig conf = new DefaultClientConfig(); conf.getSingletons().add(jsonProvider); Client client = Client.create(conf); + client.addFilter(new GZIPContentEncodingFilter({{#useGzipFeature}}true{{/useGzipFeature}}{{^useGzipFeature}}false{{/useGzipFeature}})); if (debugging) { client.addFilter(new LoggingFilter()); } diff --git a/modules/swagger-codegen/src/main/resources/Java/README.mustache b/modules/swagger-codegen/src/main/resources/Java/README.mustache index 17d2a93d43c..fff0bf0973c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/README.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/README.mustache @@ -130,7 +130,7 @@ Class | Method | HTTP request | Description {{/isBasic}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} -- **Authorizatoin URL**: {{authorizationUrl}} +- **Authorization URL**: {{authorizationUrl}} - **Scopes**: {{^scopes}}N/A{{/scopes}} {{#scopes}} - {{scope}}: {{description}} {{/scopes}} diff --git a/modules/swagger-codegen/src/main/resources/Java/api.mustache b/modules/swagger-codegen/src/main/resources/Java/api.mustache index 5bf40a593f0..6903f4dec7c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/api.mustache @@ -62,7 +62,7 @@ public class {{classname}} { } {{/required}}{{/allParams}} // create path and map variables - String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}} + String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params diff --git a/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache index cca08f4b2c4..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}}/* @Min({{minimum}}) */{{/minimum}}{{#maximum}}/* @Max({{maximum}}) */{{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache index 0b0ea0ff93d..d0dbba06c78 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -51,17 +51,27 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { {{#hasAuthMethods}} + for(String authName : authNames) { + {{#hasAuthMethods}} RequestInterceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}} - auth = new HttpBasicAuth();{{/isBasic}}{{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}}{{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");{{/isOAuth}} + {{#authMethods}}if ("{{name}}".equals(authName)) { + {{#isBasic}} + auth = new HttpBasicAuth(); + {{/isBasic}} + {{#isApiKey}} + auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"); + {{/isApiKey}} + {{#isOAuth}} + auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}"); + {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth);{{/hasAuthMethods}}{{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");{{/hasAuthMethods}} + addAuthorization(authName, auth); + {{/hasAuthMethods}} + {{^hasAuthMethods}} + throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); + {{/hasAuthMethods}} } } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache index a9e2779b66a..f6bd6ade605 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache @@ -251,7 +251,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 8.17.0 2.0.2 2.7.5 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache index 531e56e6d4c..63df83ee24b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/api.mustache @@ -59,7 +59,7 @@ public class {{classname}} { } {{/required}}{{/allParams}} // create path and map variables - String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}} + String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache index cb3ba02a8a5..50f510e7c48 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -273,7 +273,7 @@ - 1.5.9 + 1.5.12 2.22.2 {{#supportJava6}} 2.5 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 9926c95ae1f..061bdefbd35 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -80,7 +80,17 @@ public class ApiClient { {{/useGzipFeature}} verifyingSsl = true; - json = new JSON(); + + json = new JSON(this); + + /* + * Use RFC3339 format for date and datetime. + * See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 + */ + this.dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + // Always use UTC as the default time zone when dealing with date (without time). + this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + initDatetimeFormat(); // Set default User-Agent. setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}"); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/GzipRequestInterceptor.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/GzipRequestInterceptor.mustache new file mode 100644 index 00000000000..23224cf5d5b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/GzipRequestInterceptor.mustache @@ -0,0 +1,70 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 0cd19c24efa..49f9ea0a6a6 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -63,13 +63,20 @@ public class {{classname}} { } {{#operation}} - /* Build call for {{operationId}} */ - private com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for {{operationId}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; // create path and map variables - String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; {{javaUtilPrefix}}List {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList();{{#queryParams}} if ({{paramName}} != null) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 40689882c2e..5dcaa5196b5 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -237,7 +237,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.7.5 2.6.2 {{#joda}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache index 30de5917a34..7c45e926bcf 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/ApiClient.mustache @@ -52,17 +52,26 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { {{#hasAuthMethods}} + for(String authName : authNames) { + {{#hasAuthMethods}} Interceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}} - auth = new HttpBasicAuth();{{/isBasic}}{{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}}{{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");{{/isOAuth}} + {{#authMethods}}if ("{{name}}".equals(authName)) { + {{#isBasic}} + auth = new HttpBasicAuth(); + {{/isBasic}} + {{#isApiKey}} + auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}} + {{#isOAuth}} + auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}"); + {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth);{{/hasAuthMethods}}{{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");{{/hasAuthMethods}} + addAuthorization(authName, auth); + {{/hasAuthMethods}} + {{^hasAuthMethods}} + throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); + {{/hasAuthMethods}} } } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache index 427cc514416..05c0e7dbe3a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -212,7 +212,7 @@ - 1.5.9 + 1.5.12 1.9.0 2.7.5 2.9.3 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index 5cde53da890..437e87f5a84 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -19,6 +19,9 @@ import retrofit2.Retrofit; {{#useRxJava}} import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; {{/useRxJava}} +{{#useRxJava2}} +import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +{{/useRxJava2}} import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; import {{invokerPackage}}.auth.HttpBasicAuth; @@ -134,7 +137,9 @@ public class ApiClient { .baseUrl(baseUrl) {{#useRxJava}} .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) - {{/useRxJava}} + {{/useRxJava}}{{#useRxJava2}} + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + {{/useRxJava2}} .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache index b72af4f1703..1ce3dc62502 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -3,7 +3,8 @@ package {{package}}; import {{invokerPackage}}.CollectionFormats.*; {{#useRxJava}}import rx.Observable;{{/useRxJava}} -{{^useRxJava}}import retrofit2.Call;{{/useRxJava}} +{{#useRxJava2}}import io.reactivex.Observable;{{/useRxJava2}} +{{#doNotUseRx}}import retrofit2.Call;{{/doNotUseRx}} import retrofit2.http.*; import okhttp3.RequestBody; @@ -46,7 +47,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{path}}") - {{^usePlay24WS}}{{#useRxJava}}Observable{{/useRxJava}}{{^useRxJava}}Call{{/useRxJava}}{{/usePlay24WS}}{{#usePlay24WS}}F.Promise{{#usePlay24WS}}>{{/usePlay24WS}} {{operationId}}({{^allParams}});{{/allParams}} + {{^usePlay24WS}}{{^doNotUseRx}}Observable{{/doNotUseRx}}{{#doNotUseRx}}Call{{/doNotUseRx}}{{/usePlay24WS}}{{#usePlay24WS}}F.Promise{{#usePlay24WS}}>{{/usePlay24WS}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}} );{{/hasMore}}{{/allParams}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index efdeff790b4..19aa454d888 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -101,6 +101,9 @@ ext { {{#useRxJava}} rx_java_version = "1.1.3" {{/useRxJava}} + {{#useRxJava2}} + rx_java_version = "2.0.5" + {{/useRxJava2}} {{#joda}} jodatime_version = "2.9.3" {{/joda}} @@ -117,6 +120,10 @@ dependencies { compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" compile "io.reactivex:rxjava:$rx_java_version" {{/useRxJava}} + {{#useRxJava2}} + compile "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0" + compile "io.reactivex.rxjava2:rxjava:$rx_java_version" + {{/useRxJava2}} compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" {{#joda}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index 688a5178a4e..d284ed2d473 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -16,6 +16,10 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "adapter-rxjava" % "2.0.2" % "compile", "io.reactivex" % "rxjava" % "1.1.3" % "compile", {{/useRxJava}} + {{#useRxJava2}} + "com.jakewharton.retrofit" % "retrofit2-rxjava2-adapter" % "1.0.0" % "compile", + "io.reactivex.rxjava2" % "rxjava" % "2.0.5" % "compile", + {{/useRxJava2}} "io.swagger" % "swagger-annotations" % "1.5.8" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", {{#joda}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index bc96393ef7d..966ed942f01 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -220,6 +220,18 @@ ${retrofit-version} {{/useRxJava}} + {{#useRxJava2}} + + io.reactivex.rxjava2 + rxjava + ${rxjava-version} + + + com.jakewharton.retrofit + retrofit2-rxjava2-adapter + 1.0.0 + + {{/useRxJava2}} {{#usePlay24WS}} @@ -268,7 +280,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 {{#usePlay24WS}} 2.7.5 @@ -276,6 +288,9 @@ {{#useRxJava}} 1.1.6 {{/useRxJava}} + {{#useRxJava2}} + 2.0.5 + {{/useRxJava2}} {{#joda}} 2.9.3 {{/joda}} diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache index 49110fc1ad9..a47b6faa85b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}") \ No newline at end of file +{{^hideGenerationTimestamp}}@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache index 56869755b79..d5d57bc6910 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache @@ -47,7 +47,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -79,7 +79,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache index 4d7bc8c2647..1cd3be1a531 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache @@ -119,7 +119,7 @@ 1.0.0 - 1.0.8 + 1.0.11 9.2.9.v20150224 1.0.1 4.8.2 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache index 3bc0dfe132b..3721c1e80ca 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@Multipart(value = "{{paramName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{paramName}}"{{^required}}, required = false{{/required}}) InputStream {{paramName}}InputStream, @Multipart(value = "{{paramName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) InputStream {{paramName}}InputStream, @Multipart(value = "{{baseName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 93f920d4d12..04a5b76ea45 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -37,7 +37,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -69,7 +69,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache index b15a8797154..c4b66f04d32 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; {{#useBeanValidation}} import javax.validation.constraints.*; @@ -38,6 +40,8 @@ public interface {{classname}} { @Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }) {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{/vendorExtensions.x-java-is-response-void}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache index 919e7d38206..947f4301bfb 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache @@ -103,7 +103,7 @@ public class {{classname}}Test { {{#allParams}} {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} - //{{^vendorExtensions.x-java-is-response-void}}{{>returnTypes}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + //{{^vendorExtensions.x-java-is-response-void}}{{>returnTypes}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{^vendorExtensions.x-java-is-response-void}}//assertNotNull(response);{{/vendorExtensions.x-java-is-response-void}} // TODO: test validations diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationPathParams.mustache new file mode 100644 index 00000000000..051bd53c0a5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache index f4988929e52..70bbe6409fd 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@Multipart(value = "{{paramName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{paramName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @Multipart(value = "{{baseName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache index ba153467a65..9e8455d5ac7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 09c8fc1fecc..c071a0d9c80 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -94,7 +94,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache index 6e0736b368a..4ddb4c6e331 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -166,7 +166,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 5c976dc4f10..ec2559bd6db 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -160,6 +160,18 @@ ${cxf-version} compile + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + compile + {{#generateSpringApplication}} @@ -217,7 +229,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.10 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 @@ -233,6 +245,7 @@ 1.3.3.RELEASE {{/generateSpringBootApplication}} 3.1.8 + 2.8.4 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache index 9a7ff6ea6cf..c57c57cd391 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache @@ -1,3 +1,3 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} - @FormDataParam("{{paramName}}") InputStream {{paramName}}InputStream, - @FormDataParam("{{paramName}}") FormDataContentDisposition {{paramName}}Detail{{/isFile}}{{/isFormParam}} +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} + @FormDataParam("{{baseName}}") InputStream {{paramName}}InputStream, + @FormDataParam("{{baseName}}") FormDataContentDisposition {{paramName}}Detail{{/isFile}}{{/isFormParam}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache index 62d45ea9fef..bc59f3bf873 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache @@ -1,2 +1,2 @@ -{{#isFormParam}}{{#notFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}}@FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}}@FormDataParam("{{baseName}}") InputStream inputStream, + @FormDataParam("{{baseName}}") FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache index 26b934f2722..4ac349ef1f0 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache @@ -138,6 +138,16 @@ ${jersey-version} test + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + org.testng testng @@ -181,9 +191,10 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 1.19.1 + 2.8.7 1.7.21 4.12 2.5 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index d5ff9b0055a..a28823d5858 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -133,7 +133,17 @@ jersey-media-multipart ${jersey2-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + com.brsanthu migbase64 @@ -178,9 +188,10 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 + 2.8.7 {{#supportJava6}} 2.5 3.5 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache new file mode 100644 index 00000000000..4b0f3d1efee --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache @@ -0,0 +1,39 @@ +package io.swagger.api; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.joda.JodaModule; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class JacksonConfig implements ContextResolver { + + private static final Logger LOG = LoggerFactory.getLogger(JacksonConfig.class); + + private ObjectMapper objectMapper; + + public JacksonConfig() throws Exception { + this.objectMapper = new ObjectMapper(); + +{{#java8}} + this.objectMapper.registerModule(new JavaTimeModule()); +{{/java8}} +{{#joda}} + this.objectMapper.registerModule(new JodaModule()); +{{/joda}} + + // sample to convert any DateTime to readable timestamps + //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); + } + + public ObjectMapper getContext(Class objectType) { + return objectMapper; + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/README.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/README.mustache new file mode 100644 index 00000000000..a0396fc3611 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/README.mustache @@ -0,0 +1,19 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. + +You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. + +You can then view the swagger listing here: + +``` +http://localhost:{{serverPort}}{{contextPath}}/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache new file mode 100644 index 00000000000..a59c92e02f4 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache @@ -0,0 +1,55 @@ +package {{invokerPackage}}; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import java.util.Set; +import java.util.HashSet; +{{#useSwaggerFeature}} +import io.swagger.jaxrs.config.BeanConfig; +{{/useSwaggerFeature}} + +{{#apiInfo}} +{{#apis}} +import {{invokerPackage}}.impl.{{classname}}ServiceImpl; +{{/apis}} +{{/apiInfo}} + +@ApplicationPath("/") +public class RestApplication extends Application { + +{{#useSwaggerFeature}} + public RestApplication() { + super(); + // Customize the dynamic contract + BeanConfig beanConfig = new BeanConfig(); + beanConfig.setTitle("{{appName}}"); + beanConfig.setVersion("{{version}}"); + beanConfig.setSchemes(new String[] { "{{scheme}}" }); + beanConfig.setHost("{{host}}"); + beanConfig.setBasePath("{{basePathWithoutHost}}"); + beanConfig.setResourcePackage("{{invokerPackage}}"); + beanConfig.setScan(true); + + } +{{/useSwaggerFeature}} + + public Set> getClasses() { + Set> resources = new HashSet>(); +{{#apiInfo}} +{{#apis}} + resources.add({{classname}}ServiceImpl.class); +{{/apis}} +{{/apiInfo}} + +{{#useSwaggerFeature}} + resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); + resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); +{{/useSwaggerFeature}} + return resources; + } + + + + +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache new file mode 100644 index 00000000000..d9b9bd7de0b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache @@ -0,0 +1,50 @@ +package {{package}}; + +import {{modelPackage}}.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; +{{/isMultipart}}{{/operation}}{{/operations}} +@Path("/{{baseName}}") +{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} +{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} +@io.swagger.annotations.Api(description = "the {{baseName}} API") +{{>generatedAnnotation}} +{{#operations}} +public interface {{classname}} { + +{{#operation}} + @{{httpMethod}} + {{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}} + {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} + {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, + {{/hasMore}}{{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}} + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) + @io.swagger.annotations.ApiResponses(value = { {{#responses}} + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, + {{/hasMore}}{{/responses}} }) + public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext); +{{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache new file mode 100644 index 00000000000..54167964d5a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache @@ -0,0 +1,28 @@ +package {{package}}.impl; + +import {{package}}.*; +import {{modelPackage}}.*; +{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; +{{/isMultipart}}{{/operation}}{{/operations}} + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}}ServiceImpl implements {{classname}} { + {{#operation}} + public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{^isMultipart}}{{>serviceFormParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + {{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidation.mustache new file mode 100644 index 00000000000..079eab89d1a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidation.mustache @@ -0,0 +1,53 @@ +{{#required}} + @NotNull +{{/required}} +{{#pattern}} + @Pattern(regexp="{{pattern}}") +{{/pattern}} +{{#minLength}} +{{#maxLength}} + @Size(min={{minLength}},max={{maxLength}}) +{{/maxLength}} +{{/minLength}} +{{#minLength}} +{{^maxLength}} + @Size(min={{minLength}}) +{{/maxLength}} +{{/minLength}} +{{^minLength}} +{{#maxLength}} + @Size(max={{maxLength}}) + {{/maxLength}} + {{/minLength}} +{{#minItems}} +{{#maxItems}} + @Size(min={{minItems}},max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{#minItems}} +{{^maxItems}} + @Size(min={{minItems}}) +{{/maxItems}} +{{/minItems}} +{{^minItems}} +{{#maxItems}} + @Size(max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{! check for integer / number=decimal type}} +{{#isInteger}} +{{#minimum}} + @Min({{minimum}}) +{{/minimum}} +{{#maximum}} + @Max({{maximum}}) +{{/maximum}} +{{/isInteger}} +{{^isInteger}} +{{#minimum}} + @DecimalMin("{{minimum}}") +{{/minimum}} +{{#maximum}} + @DecimalMax("{{maximum}}") +{{/maximum}} +{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationPathParams.mustache new file mode 100644 index 00000000000..e3060fa6c6a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..52440b12218 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache new file mode 100644 index 00000000000..2b28441d3d0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache new file mode 100644 index 00000000000..a9f78081ce5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache @@ -0,0 +1,24 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + + {{/-last}}{{#-last}}; + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + private {{datatype}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{datatype}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache new file mode 100644 index 00000000000..7aea7b92f22 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache @@ -0,0 +1,3 @@ +public enum {{classname}} { + {{#allowableValues}}{{.}}{{^-last}}, {{/-last}}{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache new file mode 100644 index 00000000000..04f6ed275c8 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/generatedAnnotation.mustache new file mode 100644 index 00000000000..a47b6faa85b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/generatedAnnotation.mustache @@ -0,0 +1 @@ +{{^hideGenerationTimestamp}}@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache new file mode 100644 index 00000000000..ae34de08166 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache @@ -0,0 +1,32 @@ +apply plugin: 'war' + +project.version = "{{artifactVersion}}" +project.group = "{{groupId}}" + +repositories { + mavenCentral() +} + +dependencies { + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'javax.annotation:javax.annotation-api:1.2' + providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' +{{#joda}} + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' + compile 'joda-time:joda-time:2.7' +{{/joda}} + testCompile 'junit:junit:4.12', + 'org.hamcrest:hamcrest-core:1.3' +} + +sourceSets { + main { + java { + srcDir 'src/gen/java' + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache new file mode 100644 index 00000000000..1360d796826 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/jboss-web.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/jboss-web.mustache new file mode 100644 index 00000000000..788fc867d92 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/jboss-web.mustache @@ -0,0 +1,3 @@ + + {{contextPath}} + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/model.mustache new file mode 100644 index 00000000000..2ff294581f5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/model.mustache @@ -0,0 +1,22 @@ +package {{package}}; + +import java.util.Objects; +import java.util.ArrayList; +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pathParams.mustache new file mode 100644 index 00000000000..0cd6809df54 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache new file mode 100644 index 00000000000..827917bd88e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache @@ -0,0 +1,70 @@ +import io.swagger.annotations.*; + +{{#description}}@ApiModel(description="{{{description}}}"){{/description}} +{{>generatedAnnotation}} +public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { + {{#vars}}{{#isEnum}} + +{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} + +{{>enumClass}}{{/items}}{{/items.isEnum}} + private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}} + + {{#vars}} + /**{{#description}} + * {{{description}}}{{/description}}{{#minimum}} + * minimum: {{minimum}}{{/minimum}}{{#maximum}} + * maximum: {{maximum}}{{/maximum}} + **/ + {{#vendorExtensions.extraAnnotation}}{{{vendorExtensions.extraAnnotation}}}{{/vendorExtensions.extraAnnotation}} + @ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @JsonProperty("{{baseName}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + + {{/vars}} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + {{classname}} {{classVarName}} = ({{classname}}) o;{{#hasVars}} + return {{#vars}}Objects.equals({{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + {{/hasMore}}{{^hasMore}};{{/hasMore}}{{/vars}}{{/hasVars}}{{^hasVars}} + return true;{{/hasVars}} + } + + @Override + public int hashCode() { + return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache new file mode 100644 index 00000000000..7b7107f197a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -0,0 +1,184 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + war + {{artifactId}} + {{artifactVersion}} + + src/main/java + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + + src/gen/java + + + + + + + + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.jboss.resteasy + resteasy-jaxrs + ${resteasy-version} + provided + + + org.jboss.resteasy + jaxrs-api + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-validator-provider-11 + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy-version} + provided + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.4.1 + + + joda-time + joda-time + 2.7 + + + io.swagger + swagger-jaxrs + ${swagger-core-version} + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + +{{#useBeanValidation}} + + + javax.validation + validation-api + 1.1.0.Final + provided + +{{/useBeanValidation}} +{{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.1.1 + +{{/joda}} +{{#java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.6.3 + +{{/java8}} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.5.12 + 9.2.9.v20150224 + 3.0.11.Final + 1.6.3 + 4.8.1 + 2.5 + + diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache new file mode 100644 index 00000000000..5a9a4398a03 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceBodyParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceBodyParams.mustache new file mode 100644 index 00000000000..c7d1abfe527 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceBodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceFormParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceFormParams.mustache new file mode 100644 index 00000000000..e44ab167e8f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceFormParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceHeaderParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceHeaderParams.mustache new file mode 100644 index 00000000000..bd03573d196 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceHeaderParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}{{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/servicePathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/servicePathParams.mustache new file mode 100644 index 00000000000..6829cf8c7a6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/servicePathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceQueryParams.mustache new file mode 100644 index 00000000000..ff79730471d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/serviceQueryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/settingsGradle.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/settingsGradle.mustache new file mode 100644 index 00000000000..b8fd6c4c41f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/settingsGradle.mustache @@ -0,0 +1 @@ +rootProject.name = "{{artifactId}}" \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache new file mode 100644 index 00000000000..df744af490e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache @@ -0,0 +1,9 @@ + + + + resteasy.providers + io.swagger.api.JacksonConfig + + diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache index 09c149b8ade..04f6ed275c8 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache index 4c84bc6e6a0..612767afd14 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache @@ -29,7 +29,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -61,7 +61,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache index c6d1011af1f..ac1215cff2d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -164,7 +164,7 @@ - 1.5.9 + 1.5.12 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache index e88e3022aa7..931d1abff8b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache @@ -1,2 +1,2 @@ -{{#isFormParam}}{{#notFile}}@FormParam(value = "{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @FormParam(value = "{{paramName}}") InputStream {{paramName}}InputStream, - @FormParam(value = "{{paramName}}") Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@FormParam(value = "{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @FormParam(value = "{{baseName}}") InputStream {{paramName}}InputStream, + @FormParam(value = "{{baseName}}") Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache index 51090c995e1..4d43b69319c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -33,7 +33,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/LICENSE.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/LICENSE.mustache new file mode 100644 index 00000000000..4baedcb95f3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/LICENSE.mustache @@ -0,0 +1,8 @@ +This software is licensed under the Apache 2 license, quoted below. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with +the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/README.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/README.mustache new file mode 100644 index 00000000000..2fce02950d2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/README.mustache @@ -0,0 +1,4 @@ +This is your new Play application +================================= + +This file will be packaged with your application when using `activator dist`. \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache new file mode 100644 index 00000000000..60534355ae3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache @@ -0,0 +1,15 @@ +package controllers; + +import javax.inject.*; +import play.mvc.*; + +public class ApiDocController extends Controller { + + @Inject + private ApiDocController() { + } + + public Result api() { + return redirect(String.format("/assets/lib/swagger-ui/index.html?/url=%s/api-docs", "")); + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/application.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/application.mustache new file mode 100644 index 00000000000..d6d9e9fa92b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/application.mustache @@ -0,0 +1,361 @@ +springfox.documentation.swagger.v2.path=/api-docs +server.contextPath={{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}} +server.port={{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}9000{{/serverPort}} +spring.jackson.date-format={{basePackage}}.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false + +# This is the main configuration file for the application. +# https://www.playframework.com/documentation/latest/ConfigFile +# ~~~~~ +# Play uses HOCON as its configuration file format. HOCON has a number +# of advantages over other config formats, but there are two things that +# can be used when modifying settings. +# +# You can include other configuration files in this main application.conf file: +#include "extra-config.conf" +# +# You can declare variables and substitute for them: +#mykey = ${some.value} +# +# And if an environment variable exists when there is no other subsitution, then +# HOCON will fall back to substituting environment variable: +#mykey = ${JAVA_HOME} + +## Akka +# https://www.playframework.com/documentation/latest/ScalaAkka#Configuration +# https://www.playframework.com/documentation/latest/JavaAkka#Configuration +# ~~~~~ +# Play uses Akka internally and exposes Akka Streams and actors in Websockets and +# other streaming HTTP responses. +akka { +# "akka.log-config-on-start" is extraordinarly useful because it log the complete +# configuration at INFO level, including defaults and overrides, so it s worth +# putting at the very top. +# +# Put the following in your conf/logback.xml file: +# +# +# +# And then uncomment this line to debug the configuration. +# +#log-config-on-start = true +} + +api.version="1.0" + +## Secret key +# http://www.playframework.com/documentation/latest/ApplicationSecret +# ~~~~~ +# The secret key is used to sign Play's session cookie. +# This must be changed for production, but we don't recommend you change it in this file. +play.crypto.secret = "changeme" + +## Modules +# https://www.playframework.com/documentation/latest/Modules +# ~~~~~ +# Control which modules are loaded when Play starts. Note that modules are +# the replacement for "GlobalSettings", which are deprecated in 2.5.x. +# Please see https://www.playframework.com/documentation/latest/GlobalSettings +# for more information. +# +# You can also extend Play functionality by using one of the publically available +# Play modules: https://playframework.com/documentation/latest/ModuleDirectory +play.modules { +# By default, Play will load any class called Module that is defined +# in the root package (the "app" directory), or you can define them +# explicitly below. +# If there are any built-in modules that you want to disable, you can list them here. +enabled += "play.modules.swagger.SwaggerModule" + +# If there are any built-in modules that you want to disable, you can list them here. +#disabled += "" +} + +## IDE +# https://www.playframework.com/documentation/latest/IDE +# ~~~~~ +# Depending on your IDE, you can add a hyperlink for errors that will jump you +# directly to the code location in the IDE in dev mode. The following line makes +# use of the IntelliJ IDEA REST interface: +#play.editor="http://localhost:63342/api/file/?file=%s&line=%s" + +## Internationalisation +# https://www.playframework.com/documentation/latest/JavaI18N +# https://www.playframework.com/documentation/latest/ScalaI18N +# ~~~~~ +# Play comes with its own i18n settings, which allow the user's preferred language +# to map through to internal messages, or allow the language to be stored in a cookie. +play.i18n { +# The application languages +langs = [ "en" ] + +# Whether the language cookie should be secure or not +#langCookieSecure = true + +# Whether the HTTP only attribute of the cookie should be set to true +#langCookieHttpOnly = true +} + +## Play HTTP settings +# ~~~~~ +play.http { +## Router +# https://www.playframework.com/documentation/latest/JavaRouting +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~~ +# Define the Router object to use for this application. +# This router will be looked up first when the application is starting up, +# so make sure this is the entry point. +# Furthermore, it's assumed your route file is named properly. +# So for an application router like `my.application.Router`, +# you may need to define a router file `conf/my.application.routes`. +# Default to Routes in the root package (aka "apps" folder) (and conf/routes) +#router = my.application.Router + +## Action Creator +# https://www.playframework.com/documentation/latest/JavaActionCreator +# ~~~~~ +#actionCreator = null + +## ErrorHandler +# https://www.playframework.com/documentation/latest/JavaRouting +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~~ +# If null, will attempt to load a class called ErrorHandler in the root package, +#errorHandler = null + +## Filters +# https://www.playframework.com/documentation/latest/ScalaHttpFilters +# https://www.playframework.com/documentation/latest/JavaHttpFilters +# ~~~~~ +# Filters run code on every request. They can be used to perform +# common logic for all your actions, e.g. adding common headers. +# Defaults to "Filters" in the root package (aka "apps" folder) +# Alternatively you can explicitly register a class here. +#filters = my.application.Filters + +## Session & Flash +# https://www.playframework.com/documentation/latest/JavaSessionFlash +# https://www.playframework.com/documentation/latest/ScalaSessionFlash +# ~~~~~ +session { +# Sets the cookie to be sent only over HTTPS. +#secure = true + +# Sets the cookie to be accessed only by the server. +#httpOnly = true + +# Sets the max-age field of the cookie to 5 minutes. +# NOTE: this only sets when the browser will discard the cookie. Play will consider any +# cookie value with a valid signature to be a valid session forever. To implement a server side session timeout, +# you need to put a timestamp in the session and check it at regular intervals to possibly expire it. +#maxAge = 300 + +# Sets the domain on the session cookie. +#domain = "example.com" +} + +flash { +# Sets the cookie to be sent only over HTTPS. +#secure = true + +# Sets the cookie to be accessed only by the server. +#httpOnly = true +} +} + +## Netty Provider +# https://www.playframework.com/documentation/latest/SettingsNetty +# ~~~~~ +play.server.netty { +# Whether the Netty wire should be logged +#log.wire = true + +# If you run Play on Linux, you can use Netty's native socket transport +# for higher performance with less garbage. +#transport = "native" +} + +## WS (HTTP Client) +# https://www.playframework.com/documentation/latest/ScalaWS#Configuring-WS +# ~~~~~ +# The HTTP client primarily used for REST APIs. The default client can be +# configured directly, but you can also create different client instances +# with customized settings. You must enable this by adding to build.sbt: +# +# libraryDependencies += ws // or javaWs if using java +# +play.ws { +# Sets HTTP requests not to follow 302 requests +#followRedirects = false + +# Sets the maximum number of open HTTP connections for the client. +#ahc.maxConnectionsTotal = 50 + +## WS SSL +# https://www.playframework.com/documentation/latest/WsSSL +# ~~~~~ +ssl { +# Configuring HTTPS with Play WS does not require programming. You can +# set up both trustManager and keyManager for mutual authentication, and +# turn on JSSE debugging in development with a reload. +#debug.handshake = true +#trustManager = { +# stores = [ +# { type = "JKS", path = "exampletrust.jks" } +# ] +#} +} +} + +## Cache +# https://www.playframework.com/documentation/latest/JavaCache +# https://www.playframework.com/documentation/latest/ScalaCache +# ~~~~~ +# Play comes with an integrated cache API that can reduce the operational +# overhead of repeated requests. You must enable this by adding to build.sbt: +# +# libraryDependencies += cache +# +play.cache { +# If you want to bind several caches, you can bind the individually +#bindCaches = ["db-cache", "user-cache", "session-cache"] +} + +## Filters +# https://www.playframework.com/documentation/latest/Filters +# ~~~~~ +# There are a number of built-in filters that can be enabled and configured +# to give Play greater security. You must enable this by adding to build.sbt: +# +# libraryDependencies += filters +# +play.filters { +## CORS filter configuration +# https://www.playframework.com/documentation/latest/CorsFilter +# ~~~~~ +# CORS is a protocol that allows web applications to make requests from the browser +# across different domains. +# NOTE: You MUST apply the CORS configuration before the CSRF filter, as CSRF has +# dependencies on CORS settings. +cors { +# Filter paths by a whitelist of path prefixes +#pathPrefixes = ["/some/path", ...] + +# The allowed origins. If null, all origins are allowed. +#allowedOrigins = ["http://www.example.com"] + +# The allowed HTTP methods. If null, all methods are allowed +#allowedHttpMethods = ["GET", "POST"] +} + +## CSRF Filter +# https://www.playframework.com/documentation/latest/ScalaCsrf#Applying-a-global-CSRF-filter +# https://www.playframework.com/documentation/latest/JavaCsrf#Applying-a-global-CSRF-filter +# ~~~~~ +# Play supports multiple methods for verifying that a request is not a CSRF request. +# The primary mechanism is a CSRF token. This token gets placed either in the query string +# or body of every form submitted, and also gets placed in the users session. +# Play then verifies that both tokens are present and match. +csrf { +# Sets the cookie to be sent only over HTTPS +#cookie.secure = true + +# Defaults to CSRFErrorHandler in the root package. +#errorHandler = MyCSRFErrorHandler +} + +## Security headers filter configuration +# https://www.playframework.com/documentation/latest/SecurityHeaders +# ~~~~~ +# Defines security headers that prevent XSS attacks. +# If enabled, then all options are set to the below configuration by default: +headers { +# The X-Frame-Options header. If null, the header is not set. +#frameOptions = "DENY" + +# The X-XSS-Protection header. If null, the header is not set. +#xssProtection = "1; mode=block" + +# The X-Content-Type-Options header. If null, the header is not set. +#contentTypeOptions = "nosniff" + +# The X-Permitted-Cross-Domain-Policies header. If null, the header is not set. +#permittedCrossDomainPolicies = "master-only" + +# The Content-Security-Policy header. If null, the header is not set. +#contentSecurityPolicy = "default-src 'self'" +} + +## Allowed hosts filter configuration +# https://www.playframework.com/documentation/latest/AllowedHostsFilter +# ~~~~~ +# Play provides a filter that lets you configure which hosts can access your application. +# This is useful to prevent cache poisoning attacks. +hosts { +# Allow requests to example.com, its subdomains, and localhost:9000. +#allowed = [".example.com", "localhost:9000"] +} +} + +## Evolutions +# https://www.playframework.com/documentation/latest/Evolutions +# ~~~~~ +# Evolutions allows database scripts to be automatically run on startup in dev mode +# for database migrations. You must enable this by adding to build.sbt: +# +# libraryDependencies += evolutions +# +play.evolutions { +# You can disable evolutions for a specific datasource if necessary +#db.default.enabled = false +} + +## Database Connection Pool +# https://www.playframework.com/documentation/latest/SettingsJDBC +# ~~~~~ +# Play doesn't require a JDBC database to run, but you can easily enable one. +# +# libraryDependencies += jdbc +# +play.db { +# The combination of these two settings results in "db.default" as the +# default JDBC pool: +#config = "db" +#default = "default" + +# Play uses HikariCP as the default connection pool. You can override +# settings by changing the prototype: +prototype { +# Sets a fixed JDBC connection pool size of 50 +#hikaricp.minimumIdle = 50 +#hikaricp.maximumPoolSize = 50 +} +} + +## JDBC Datasource +# https://www.playframework.com/documentation/latest/JavaDatabase +# https://www.playframework.com/documentation/latest/ScalaDatabase +# ~~~~~ +# Once JDBC datasource is set up, you can work with several different +# database options: +# +# Slick (Scala preferred option): https://www.playframework.com/documentation/latest/PlaySlick +# JPA (Java preferred option): https://playframework.com/documentation/latest/JavaJPA +# EBean: https://playframework.com/documentation/latest/JavaEbean +# Anorm: https://www.playframework.com/documentation/latest/ScalaAnorm +# +db { +# You can declare as many datasources as you want. +# By convention, the default datasource is named `default` + +# https://www.playframework.com/documentation/latest/Developing-with-the-H2-Database +#default.driver = org.h2.Driver +#default.url = "jdbc:h2:mem:play" +#default.username = sa +#default.password = "" + +# You can turn on SQL logging for any datasource +# https://www.playframework.com/documentation/latest/Highlights25#Logging-SQL-statements +#default.logSql=true +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidation.mustache new file mode 100644 index 00000000000..079eab89d1a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidation.mustache @@ -0,0 +1,53 @@ +{{#required}} + @NotNull +{{/required}} +{{#pattern}} + @Pattern(regexp="{{pattern}}") +{{/pattern}} +{{#minLength}} +{{#maxLength}} + @Size(min={{minLength}},max={{maxLength}}) +{{/maxLength}} +{{/minLength}} +{{#minLength}} +{{^maxLength}} + @Size(min={{minLength}}) +{{/maxLength}} +{{/minLength}} +{{^minLength}} +{{#maxLength}} + @Size(max={{maxLength}}) + {{/maxLength}} + {{/minLength}} +{{#minItems}} +{{#maxItems}} + @Size(min={{minItems}},max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{#minItems}} +{{^maxItems}} + @Size(min={{minItems}}) +{{/maxItems}} +{{/minItems}} +{{^minItems}} +{{#maxItems}} + @Size(max={{maxItems}}) +{{/maxItems}} +{{/minItems}} +{{! check for integer / number=decimal type}} +{{#isInteger}} +{{#minimum}} + @Min({{minimum}}) +{{/minimum}} +{{#maximum}} + @Max({{maximum}}) +{{/maximum}} +{{/isInteger}} +{{^isInteger}} +{{#minimum}} + @DecimalMin("{{minimum}}") +{{/minimum}} +{{#maximum}} + @DecimalMax("{{maximum}}") +{{/maximum}} +{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationPathParams.mustache new file mode 100644 index 00000000000..e3060fa6c6a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..52440b12218 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/bodyParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/bodyParamsNoDoc.mustache new file mode 100644 index 00000000000..c7d1abfe527 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/bodyParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/build.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/build.mustache new file mode 100644 index 00000000000..3c7ba4b08ea --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/build.mustache @@ -0,0 +1,17 @@ +name := """{{artifactId}}""" + +version := "1.0-SNAPSHOT" + +lazy val root = (project in file(".")).enablePlugins(PlayJava) + +scalaVersion := "2.11.7" + +libraryDependencies ++= Seq( +javaJdbc, +cache, +javaWs, +"io.swagger" %% "swagger-play2" % "1.5.3", +"org.webjars" % "swagger-ui" % "2.2.8"{{#useBeanValidation}}, +"javax.validation" % "validation-api" % "1.1.0.Final" +{{/useBeanValidation}} +) diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/buildproperties.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/buildproperties.mustache new file mode 100644 index 00000000000..59e7c05b62f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/buildproperties.mustache @@ -0,0 +1 @@ +sbt.version=0.13.11 \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache new file mode 100644 index 00000000000..21631412a2b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache @@ -0,0 +1 @@ +{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isString}}(String){{/isString}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache new file mode 100644 index 00000000000..2a36cdff8ab --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache @@ -0,0 +1 @@ +{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}}{{#isString}}{{/isString}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache new file mode 100644 index 00000000000..c5c3143cb94 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache @@ -0,0 +1,44 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ + public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#gson}} + {{#allowableValues}} + {{#enumVars}} + @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/gson}} + {{^gson}} + {{#allowableValues}} + {{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/gson}} + + private {{{datatype}}} value; + + {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{datatype}}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache new file mode 100644 index 00000000000..76c2cbf5a76 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache @@ -0,0 +1,42 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/jackson}} + +/** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ +public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#gson}} + {{#allowableValues}}{{#enumVars}} + @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/gson}} + {{^gson}} + {{#allowableValues}}{{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/gson}} + + private {{{dataType}}} value; + + {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/formParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/formParamsNoDoc.mustache new file mode 100644 index 00000000000..866a5e96df5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/formParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}Http.MultipartFormData.FilePart {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/generatedAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/generatedAnnotation.mustache new file mode 100644 index 00000000000..ad17a426e96 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/generatedAnnotation.mustache @@ -0,0 +1,3 @@ +{{^hideGenerationTimestamp}} +@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}") +{{/hideGenerationTimestamp}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/headerParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/headerParamsNoDoc.mustache new file mode 100644 index 00000000000..bd03573d196 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/headerParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}{{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/logback.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/logback.mustache new file mode 100644 index 00000000000..01f301ab73a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/logback.mustache @@ -0,0 +1,41 @@ + + + + + + + ${application.home:-.}/logs/application.log + + %date [%level] from %logger in %thread - %message%n%xException + + + + + + %coloredLevel %logger{15} - %message%n%xException{10} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache new file mode 100644 index 00000000000..4b37d4c35d7 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache @@ -0,0 +1,22 @@ +package {{package}}; + +import java.util.Objects; +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#useBeanValidation}} +import javax.validation.constraints.*; +import com.fasterxml.jackson.annotation.*; +{{/useBeanValidation}} +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApi.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApi.mustache new file mode 100644 index 00000000000..e19bbf893cb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApi.mustache @@ -0,0 +1,24 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}}ControllerImp { +{{#operation}} + {{>returnTypes}} {{operationId}}({{#allParams}}{{>pathParamsNoDoc}}{{>queryParamsNoDoc}}{{>bodyParamsNoDoc}}{{>formParamsNoDoc}}{{>headerParamsNoDoc}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { + //Do your magic!!! + {{#returnType}}return new {{>returnTypesNoVoidNoAbstract}}();{{/returnType}} + } + +{{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache new file mode 100644 index 00000000000..bd76a507cae --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache @@ -0,0 +1,162 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import io.swagger.annotations.*; +import play.mvc.Controller; +import play.mvc.Result; +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.inject.Inject; +import java.io.IOException; +import swagger.SwaggerUtils; +import javafx.util.Pair; +import com.fasterxml.jackson.core.type.TypeReference; + +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} + +{{>generatedAnnotation}} +@Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API") +{{#operations}} +public class {{classname}}Controller extends Controller { + + private {{classname}}ControllerImp imp; + private ObjectMapper mapper; + + @Inject + private {{classname}}Controller({{classname}}ControllerImp imp) { + this.imp = imp; + mapper = new ObjectMapper(); + } + +{{#operation}} + + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}"{{#returnType}}, response = {{{returnType}}}.class{{/returnType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, + {{/hasMore}}{{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}} + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#returnType}}, response = {{{returnType}}}.class{{/returnType}}){{#hasMore}}, {{/hasMore}}{{/responses}} }) + {{#hasParams}} + @ApiImplicitParams({ + {{#allParams}}{{^isPathParam}}@ApiImplicitParam(name = "{{baseName}}", value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}, dataType = "{{{dataTypeForImplicitParam}}}", paramType = "{{>paramType}}"){{#hasMore}}, + {{/hasMore}}{{/isPathParam}}{{/allParams}} + }) + {{/hasParams}} + public Result {{operationId}}({{#pathParams}}{{>pathParams}}{{#hasMore}},{{/hasMore}}{{/pathParams}}) {{#bodyParams}}throws IOException{{/bodyParams}} { + {{#bodyParams}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + {{/collectionFormat}} + {{^collectionFormat}} + JsonNode node{{paramName}} = request().body().asJson(); + {{{dataType}}} {{paramName}}; + {{^required}} + if (node{{paramName}} != null) { + {{paramName}} = mapper.readValue(node{{paramName}}.toString(), {{#isMapContainer}}new TypeReference>(){}{{/isMapContainer}}{{#isListContainer}}new TypeReference>(){}{{/isListContainer}}{{^isListContainer}}{{^isMapContainer}}{{{dataType}}}.class{{/isMapContainer}}{{/isListContainer}});{{/required}} + {{#required}}{{paramName}} = mapper.readValue(node{{paramName}}.toString(), {{{dataType}}}.class);{{/required}} + {{^required}} + } else { + {{paramName}} = null; + }{{/required}} + {{/collectionFormat}} + {{/bodyParams}} + {{#queryParams}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + //WIP when both bugs will be fixed + //List {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", request().getQueryString("{{baseName}}")); + {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + //for (Pair pair : {{paramName}}Pair) { + // {{paramName}}.add({{>conversionBegin}}pair.getValue(){{>conversionEnd}}); + //} + {{/collectionFormat}} + {{^collectionFormat}} + String value{{paramName}} = request().getQueryString("{{paramName}}"); + {{{dataType}}} {{paramName}}; + {{^required}} + if (value{{paramName}} != null) { + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{^required}} + } else { + {{paramName}} = {{>paramDefaultValue}}; + }{{/required}} + {{/collectionFormat}} + {{/queryParams}} + {{#formParams}} + {{^notFile}} + Http.MultipartFormData.FilePart {{paramName}} = request().body().asMultipartFormData().getFile("{{baseName}}"); + {{#required}}if (({{paramName}} == null || ((File) {{paramName}}.getFile()).length() == 0)) { + throw new RuntimeException("File cannot be empty"); + } + {{/required}} + {{/notFile}} + {{#notFile}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + //WIP when both bugs will be fixed + //List {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}"))[0]); + {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + //for (Pair pair : {{paramName}}Pair) { + // {{paramName}}.add({{>conversionBegin}}pair.getValue(){{>conversionEnd}}); + //} + {{/collectionFormat}} + {{^collectionFormat}} + String value{{paramName}} = ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}"))[0]; + {{{dataType}}} {{paramName}}; + {{^required}} + if (value{{paramName}} != null) { + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{^required}} + } else { + {{paramName}} = {{>paramDefaultValue}}; + }{{/required}} + {{/collectionFormat}} + {{/notFile}} + {{/formParams}} + {{#headerParams}} + {{#collectionFormat}} + //TODO: Maybe implement this in the future if we can support collection in the body params: see bug in swagger-play: https://github.com/swagger-api/swagger-play/issues/130 + //TODO: Tt seems it is not detected that it's a list based on the collectionFormat field? + //WIP when both bugs will be fixed + //List {{paramName}}Pair = SwaggerUtils.parameterToPairs("{{collectionFormat}}", "{{paramName}}", request().getHeader("{{baseName}}")); + //{{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + //for (Pair pair : {{paramName}}Pair) { + // {{paramName}}.add({{>conversionBegin}}pair.getValue(){{>conversionEnd}}); + //} + {{/collectionFormat}} + {{^collectionFormat}} + String value{{paramName}} = request().getHeader("{{baseName}}"); + {{{dataType}}} {{paramName}}; + {{^required}} + if (value{{paramName}} != null) { + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} + {{^required}} + } else { + {{paramName}} = {{>paramDefaultValue}}; + }{{/required}} + {{/collectionFormat}} + {{/headerParams}} + {{#returnType}}{{>returnTypesNoVoid}} obj = {{/returnType}}imp.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}JsonNode result = mapper.valueToTree(obj); + return ok(result);{{/returnType}} + {{^returnType}}return ok();{{/returnType}} + } +{{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/notFoundException.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/notFoundException.mustache new file mode 100644 index 00000000000..1bd5e207d7b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/notFoundException.mustache @@ -0,0 +1,10 @@ +package {{apiPackage}}; + +{{>generatedAnnotation}} +public class NotFoundException extends ApiException { + private int code; + public NotFoundException (int code, String msg) { + super(code, msg); + this.code = code; + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache new file mode 100644 index 00000000000..a24853098c0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache @@ -0,0 +1 @@ +{{#isInteger}}0{{/isInteger}}{{#isDouble}}0.0{{/isDouble}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0{{/isFloat}}{{#isString}}""{{/isString}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramType.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramType.mustache new file mode 100644 index 00000000000..4871bc3ada2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramType.mustache @@ -0,0 +1 @@ +{{#isPathParam}}path{{/isPathParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isFormParam}}form{{/isFormParam}}{{#isBodyParam}}body{{/isBodyParam}}{{#isHeaderParam}}header{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParams.mustache new file mode 100644 index 00000000000..190ebbb3fe2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}} {{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParamsNoDoc.mustache new file mode 100644 index 00000000000..4dce26e1cea --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pathParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/plugins.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/plugins.mustache new file mode 100644 index 00000000000..ca73a99c721 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/plugins.mustache @@ -0,0 +1,2 @@ +// The Play plugin +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10") diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache new file mode 100644 index 00000000000..d1422e2b1fc --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache @@ -0,0 +1,118 @@ +/** + * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + */{{#description}} +@ApiModel(description = "{{{description}}}"){{/description}} +{{>generatedAnnotation}} +public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>enumClass}} + {{/isContainer}} + {{/isEnum}} + {{#items.isEnum}} + {{#items}} + {{^isContainer}} +{{>enumClass}} + {{/isContainer}} + {{/items}} + {{/items.isEnum}} + {{#jackson}} + @JsonProperty("{{baseName}}") + {{/jackson}} + {{#gson}} + @SerializedName("{{baseName}}") + {{/gson}} + private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}}; + + {{/vars}} + {{#vars}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isListContainer}} + + public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.add({{name}}Item); + return this; + } + {{/isListContainer}} + {{#isMapContainer}} + + public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMapContainer}} + + /** + {{#description}} + * {{{description}}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{minimum}} + {{/minimum}} + {{#maximum}} + * maximum: {{maximum}} + {{/maximum}} + * @return {{name}} + **/ + {{#vendorExtensions.extraAnnotation}} + {{{vendorExtensions.extraAnnotation}}} + {{/vendorExtensions.extraAnnotation}} + @ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + + {{/vars}} + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + {{/hasMore}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return true;{{/hasVars}} + } + + @Override + public int hashCode() { + return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/build.properties b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/build.properties new file mode 100644 index 00000000000..a8c2f849be3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.12.0 diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/plugins.sbt b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/plugins.sbt new file mode 100644 index 00000000000..713b7f3e993 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/project/plugins.sbt @@ -0,0 +1,9 @@ +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.4") + +libraryDependencies <+= sbtVersion(v => v match { + case "0.11.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.0-0.2.8" + case "0.11.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.1-0.2.10" + case "0.11.2" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11" + case "0.11.3" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.3-0.2.11.1" + case x if (x.startsWith("0.12")) => "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1" +}) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/queryParamsNoDoc.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/queryParamsNoDoc.mustache new file mode 100644 index 00000000000..e3fd6c6ce76 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/queryParamsNoDoc.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypes.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypes.mustache new file mode 100644 index 00000000000..dbc2e613707 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypes.mustache @@ -0,0 +1 @@ +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}}{{^returnType}}void{{/returnType}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache new file mode 100644 index 00000000000..aba24782e7e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache @@ -0,0 +1 @@ +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache new file mode 100644 index 00000000000..39f2c32c4d1 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache @@ -0,0 +1 @@ +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}HashMap{{/isMapContainer}}{{#isListContainer}}ArrayList<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache new file mode 100644 index 00000000000..2ed34dbcd1d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache @@ -0,0 +1,27 @@ +# Routes +# This file defines all application routes (Higher priority routes first) +# ~~~~ + +GET /api controllers.ApiDocController.api + +{{#apiInfo}} +{{#apis}} + +#Functions for {{{baseName}}} API +{{#operations}} +{{#operation}} +{{httpMethod}} {{path}} controllers.{{classname}}Controller.{{operationId}}({{#pathParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) + +GET /api-docs controllers.ApiHelpController.getResources +{{#apiInfo}} +{{#apis}} +GET /api-docs.json/{{{baseName}}} controllers.ApiHelpController.getResource(path = "/{{{baseName}}}") +{{/apis}} +{{/apiInfo}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache new file mode 100644 index 00000000000..99f8d84b739 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache @@ -0,0 +1,108 @@ +package swagger; + +import javafx.util.Pair; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +public class SwaggerUtils { + + /** + * Format to {@code Pair} objects. + * + * @param collectionFormat collection format (e.g. csv, tsv) + * @param name Name + * @param value Value + * @return A list of Pair objects + */ + public static List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv + + // create the params based on the collection format + if (collectionFormat.equals("multi")) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if (collectionFormat.equals("csv")) { + delimiter = ","; + } else if (collectionFormat.equals("ssv")) { + delimiter = " "; + } else if (collectionFormat.equals("tsv")) { + delimiter = "\t"; + } else if (collectionFormat.equals("pipes")) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public static String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDatetime((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection)param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Format the given Date object into string (Datetime format). + * + * @param date Date object + * @return Formatted datetime in string representation + */ + public static String formatDatetime(Date date) { + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache new file mode 100644 index 00000000000..b3083e788d9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache @@ -0,0 +1,7 @@ +{{#jackson}} +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator}}", visible = true ) +@JsonSubTypes({ + {{#children}} + @JsonSubTypes.Type(value = {{name}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), + {{/children}} +}){{/jackson}} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index 5df0cdee1b4..327e5c03f78 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -39,14 +39,16 @@ public interface {{classname}} { }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} }) + {{#implicitHeaders}}@ApiImplicitParams({ + {{#headerParams}}{{>implicitHeader}}{{/headerParams}} + }){{/implicitHeaders}} @RequestMapping(value = "{{{path}}}",{{#singleContentTypes}} produces = "{{{vendorExtensions.x-accepts}}}", consumes = "{{{vendorExtensions.x-contentType}}}",{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}} produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}} consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}} method = RequestMethod.{{httpMethod}}) - {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, - {{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} { + {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} { // do some magic! return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}}; }{{/jdk8}} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache index d4ab09b71fe..608c22d212a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache @@ -33,7 +33,7 @@ public class {{classname}}Controller implements {{classname}} { private final {{classname}}Delegate delegate; @org.springframework.beans.factory.annotation.Autowired - {{classname}}Controller({{classname}}Delegate delegate) { + public {{classname}}Controller({{classname}}Delegate delegate) { this.delegate = delegate; }{{/isDelegate}} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache index 079eab89d1a..c8c6946fef6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidation.mustache @@ -1,53 +1,4 @@ {{#required}} @NotNull {{/required}} -{{#pattern}} - @Pattern(regexp="{{pattern}}") -{{/pattern}} -{{#minLength}} -{{#maxLength}} - @Size(min={{minLength}},max={{maxLength}}) -{{/maxLength}} -{{/minLength}} -{{#minLength}} -{{^maxLength}} - @Size(min={{minLength}}) -{{/maxLength}} -{{/minLength}} -{{^minLength}} -{{#maxLength}} - @Size(max={{maxLength}}) - {{/maxLength}} - {{/minLength}} -{{#minItems}} -{{#maxItems}} - @Size(min={{minItems}},max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{#minItems}} -{{^maxItems}} - @Size(min={{minItems}}) -{{/maxItems}} -{{/minItems}} -{{^minItems}} -{{#maxItems}} - @Size(max={{maxItems}}) -{{/maxItems}} -{{/minItems}} -{{! check for integer / number=decimal type}} -{{#isInteger}} -{{#minimum}} - @Min({{minimum}}) -{{/minimum}} -{{#maximum}} - @Max({{maximum}}) -{{/maximum}} -{{/isInteger}} -{{^isInteger}} -{{#minimum}} - @DecimalMin("{{minimum}}") -{{/minimum}} -{{#maximum}} - @DecimalMax("{{maximum}}") -{{/maximum}} -{{/isInteger}} \ No newline at end of file +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache new file mode 100644 index 00000000000..dc7a8392216 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache index e3060fa6c6a..051bd53c0a5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationPathParams.mustache @@ -1 +1 @@ -{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache index 52440b12218..f8eef8f94c7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache index 74c2d566d40..3bdb6f13743 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestPart(value="{{paramName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestPart("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestPart(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestPart("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/implicitHeader.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/implicitHeader.mustache new file mode 100644 index 00000000000..64d7af20808 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/implicitHeader.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required=true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{#hasMore}},{{/hasMore}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache index e7547a3ba19..bd2cb8bb640 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value="{{paramName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestParam("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestParam("{{baseName}}") MultipartFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index 362fa5099d6..2aa9f4e809c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -9,7 +9,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 org.springframework.boot diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache index aab5fd8ef42..d577abfb25a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}} {{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{paramName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}} {{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache index 792c265aacb..7db51c9b0d2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value = "{{paramName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index ff8ace4e74b..0b31777bb21 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -2,18 +2,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['superagent'], factory); + define(['superagent', 'querystring'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent')); + module.exports = factory(require('superagent'), require('querystring')); } else { // Browser globals (root is window) if (!root.{{moduleName}}) { root.{{moduleName}} = {}; } - root.{{moduleName}}.ApiClient = factory(root.superagent); + root.{{moduleName}}.ApiClient = factory(root.superagent, root.querystring); } -}(this, function(superagent) { +}(this, function(superagent, querystring) { 'use strict'; {{#emitJSDoc}} /** @@ -75,6 +75,22 @@ * @default true */ this.cache = true; + +{{#emitJSDoc}} /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ +{{/emitJSDoc}} this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + }; {{#emitJSDoc}} /** @@ -403,7 +419,7 @@ } if (contentType === 'application/x-www-form-urlencoded') { - request.send(this.normalizeParams(formParams)); + request.send(querystring.stringify(this.normalizeParams(formParams))); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { @@ -425,6 +441,16 @@ request.accept(accept); } + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + {{#usePromises}} return new Promise(function(resolve, reject) { request.end(function(error, response) { if (error) { @@ -432,7 +458,10 @@ } else { try { var data = _this.deserialize(response, returnType); - resolve(data); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } + resolve({data, response}); } catch (err) { reject(err); } @@ -445,6 +474,9 @@ if (!error) { try { data = _this.deserialize(response, returnType); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } } catch (err) { error = err; } @@ -472,9 +504,12 @@ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on data will be converted to this type. - * @returns An instance of the specified type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. */ {{/emitJSDoc}} exports.convertToType = function(data, type) { + if (data === null || data === undefined) + return data + switch (type) { case 'Boolean': return Boolean(data); diff --git a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache index f8bf9f1eea9..0de415ad049 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache @@ -50,14 +50,14 @@ * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> - * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with an object containing data of type {@link <&vendorExtensions.x-jsdoc-type>} and HTTP response<^returnType>, with an object containing HTTP response */ - this. = function() {<#hasOptionalParams> + this.<#usePromises>WithHttpInfo = function() {<#hasOptionalParams> opts = opts || {}; var postBody = <#bodyParam><#required><^required>opts['']<^bodyParam>null; <#allParams><#required> // verify the required parameter '' is set - if ( == undefined || == null) { + if ( === undefined || === null) { throw new Error("Missing the required parameter '' when calling "); } @@ -92,6 +92,26 @@ authNames, contentTypes, accepts, returnType<^usePromises>, callback ); } +<#usePromises> + <#emitJSDoc> + + /**<#summary> + * <#notes> + * <#allParams><#required> + * @param {<&vendorExtensions.x-jsdoc-type>} <#hasOptionalParams> + * @param {Object} opts Optional parameters<#allParams><^required> + * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> + * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> + * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> + * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>} + */ + this. = function() { + return this.WithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + }; return exports; diff --git a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index 876409b50b4..91d363e0965 100644 --- a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig +++ b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig @@ -17,6 +17,7 @@ io.swagger.codegen.languages.JavaJerseyServerCodegen io.swagger.codegen.languages.JavaCXFClientCodegen io.swagger.codegen.languages.JavaCXFServerCodegen io.swagger.codegen.languages.JavaResteasyServerCodegen +io.swagger.codegen.languages.JavaResteasyEapServerCodegen io.swagger.codegen.languages.JavaJAXRSSpecServerCodegen io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen io.swagger.codegen.languages.JavaInflectorServerCodegen @@ -40,6 +41,7 @@ io.swagger.codegen.languages.SinatraServerCodegen io.swagger.codegen.languages.Rails5ServerCodegen io.swagger.codegen.languages.SlimFrameworkServerCodegen io.swagger.codegen.languages.SpringCodegen +io.swagger.codegen.languages.JavaPlayFrameworkCodegen io.swagger.codegen.languages.StaticDocCodegen io.swagger.codegen.languages.StaticHtmlGenerator io.swagger.codegen.languages.StaticHtml2Generator diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache index 249266065db..0a8a7225031 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache @@ -1,3 +1,3 @@ -{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} - @FormDataParam("{{paramName}}") InputStream {{paramName}}InputStream, - @FormDataParam("{{paramName}}") FileInfo {{paramName}}Detail{{/isFile}}{{/isFormParam}} +{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} + @FormDataParam("{{baseName}}") InputStream {{paramName}}InputStream, + @FormDataParam("{{baseName}}") FileInfo {{paramName}}Detail{{/isFile}}{{/isFormParam}} diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache index 7839f9c1ec2..beab949c29d 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache @@ -81,7 +81,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache index ea666198674..8c8c377ee7f 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache @@ -217,7 +217,7 @@ 2.3.9 1.2 2.2 - 1.5.9 + 1.5.12 1.0.0 4.8.1 diff --git a/modules/swagger-codegen/src/main/resources/android/README.mustache b/modules/swagger-codegen/src/main/resources/android/README.mustache index 4834927cd51..b51ea005757 100644 --- a/modules/swagger-codegen/src/main/resources/android/README.mustache +++ b/modules/swagger-codegen/src/main/resources/android/README.mustache @@ -107,7 +107,7 @@ Class | Method | HTTP request | Description {{/isBasic}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} -- **Authorizatoin URL**: {{authorizationUrl}} +- **Authorization URL**: {{authorizationUrl}} - **Scopes**: {{^scopes}}N/A{{/scopes}} {{#scopes}} - {{scope}}: {{description}} {{/scopes}} diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache index 288408ab26c..cbcbc96e3b1 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache @@ -66,7 +66,7 @@ public class {{classname}} { {{/allParams}} // create path and map variables - String path = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; + String path = "{{path}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params List queryParams = new ArrayList(); diff --git a/modules/swagger-codegen/src/main/resources/android/pom.mustache b/modules/swagger-codegen/src/main/resources/android/pom.mustache index e073253123d..758e9d62d07 100644 --- a/modules/swagger-codegen/src/main/resources/android/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/pom.mustache @@ -145,7 +145,7 @@ - 1.5.9 + 1.5.12 2.3.1 4.8.1 1.0.0 diff --git a/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache b/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache index 9af7d224f6f..b59e5a3665a 100644 --- a/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/Dockerfile.mustache @@ -6,7 +6,7 @@ RUN apt-get install -y bash-completion zsh curl cowsay git vim bsdmainutils ADD {{scriptName}} /usr/bin/{{scriptName}} ADD _{{scriptName}} /usr/local/share/zsh/site-functions/_{{scriptName}} ADD {{scriptName}}.bash-completion /etc/bash-completion.d/{{scriptName}} - +RUN chmod 755 /usr/bin/{{scriptName}} # # Install oh-my-zsh diff --git a/modules/swagger-codegen/src/main/resources/bash/README.md b/modules/swagger-codegen/src/main/resources/bash/README.md index da35f04ae67..88fd2dfbee6 100644 --- a/modules/swagger-codegen/src/main/resources/bash/README.md +++ b/modules/swagger-codegen/src/main/resources/bash/README.md @@ -28,7 +28,7 @@ $ git clone https://github.com/swagger-api/swagger-codegen Build the codegen: ```shell -$ mvn assembly:assembly -DdescriptorId=jar-with-dependencies +$ mvn package ``` Define custom codegen properties in a Json file, e.g.: @@ -47,14 +47,15 @@ Define custom codegen properties in a Json file, e.g.: Generate the client: ```shell -$ java -cp target/bash-swagger-codegen-1.0.0.jar io.swagger.codegen.SwaggerCodegen generate -l bash -i http://petstore.swagger.io/v2/swagger.json -o output -c resources/example-config.json +$ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l bash -o generated/bash/petstore -c modules/swagger-codegen/src/test/resources/2_0/bash-config.json -$ chmod +x output/petstore-cli +$ chmod +x generated/bash/petstore/petstore-cli ``` Enjoy: ```shell -$ output/petstore-cli -h +$ cd generated/bash/petstore +$ ./petstore-cli -h Swagger Petstore command line client (API version 1.0.0) diff --git a/modules/swagger-codegen/src/main/resources/bash/client.mustache b/modules/swagger-codegen/src/main/resources/bash/client.mustache index e1e3aad1cfd..5c567de2cb1 100644 --- a/modules/swagger-codegen/src/main/resources/bash/client.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/client.mustache @@ -292,7 +292,7 @@ body_parameters_to_json() { if [[ $count -lt $body_parameter_count-1 ]]; then body_json+=", " fi - count+=1 + ((count+=1)) done body_json+="}'" @@ -362,7 +362,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "multi" ]]; then local vcount=0 @@ -372,7 +372,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "csv" ]]; then path_template+="${qparam}=" @@ -383,7 +383,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="," fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "ssv" ]]; then path_template+="${qparam}=" @@ -393,7 +393,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+=" " fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "tsv" ]]; then path_template+="${qparam}=" @@ -403,7 +403,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="\t" fi - vcount+=1 + ((vcount+=1)) done else echo -e "" @@ -416,7 +416,7 @@ validate_request_parameters() { if [[ $count -lt $query_parameter_count-1 ]]; then path_template+="&" fi - count+=1 + ((count+=1)) done } @@ -484,7 +484,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'mutli' collections i.e. param=value1¶m=value2&... @@ -497,7 +497,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'csv' collections i.e. param=value1,value2,... @@ -511,7 +511,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="," fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'ssv' collections i.e. param="value1 value2 ..." @@ -525,7 +525,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+=" " fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'tsv' collections i.e. param="value1\tvalue2\t..." @@ -539,7 +539,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="\t" fi - vcount+=1 + ((vcount+=1)) done fi @@ -551,8 +551,7 @@ build_request_path() { query_request_part+="&" fi - count+=1 - + ((count+=1)) done diff --git a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache index 30724132edb..28f4861b9b6 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache @@ -344,7 +344,7 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling {{operationId}}: unsupported response type")); } return result; diff --git a/modules/swagger-codegen/src/main/resources/csharp/README.mustache b/modules/swagger-codegen/src/main/resources/csharp/README.mustache index 8c08c0e8667..066a7e93577 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/README.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/README.mustache @@ -31,7 +31,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later -The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index c3d73306149..b7e1afc4b5b 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -234,9 +234,6 @@ namespace {{packageName}}.{{apiPackage}} if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); {{#pathParams}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} @@ -368,9 +365,6 @@ namespace {{packageName}}.{{apiPackage}} if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); {{#pathParams}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} diff --git a/modules/swagger-codegen/src/main/resources/dart/api.mustache b/modules/swagger-codegen/src/main/resources/dart/api.mustache index aaa9d5db1f4..f3c80aecc5b 100644 --- a/modules/swagger-codegen/src/main/resources/dart/api.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/api.mustache @@ -25,7 +25,7 @@ class {{classname}} { {{/allParams}} // create path and map variables - String path = "{{path}}".replaceAll("{format}","json"){{#pathParams}}.replaceAll("{" + "{{paramName}}" + "}", {{{paramName}}}.toString()){{/pathParams}}; + String path = "{{path}}".replaceAll("{format}","json"){{#pathParams}}.replaceAll("{" + "{{baseName}}" + "}", {{{paramName}}}.toString()){{/pathParams}}; // query params List queryParams = []; diff --git a/modules/swagger-codegen/src/main/resources/flash/api.mustache b/modules/swagger-codegen/src/main/resources/flash/api.mustache index b1312a339d4..439eaed1629 100644 --- a/modules/swagger-codegen/src/main/resources/flash/api.mustache +++ b/modules/swagger-codegen/src/main/resources/flash/api.mustache @@ -36,7 +36,7 @@ public class {{classname}} extends SwaggerApi { */ public function {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): String { // create path and map variables - var path: String = "{{path}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{paramName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; + var path: String = "{{path}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{baseName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; // query params var queryParams: Dictionary = new Dictionary(); @@ -50,10 +50,10 @@ public class {{classname}} extends SwaggerApi { {{/allParams}} {{#queryParams}}if("null" != String({{paramName}})) - queryParams["{{paramName}}"] = toPathValue({{paramName}}); + queryParams["{{baseName}}"] = toPathValue({{paramName}}); {{/queryParams}} - {{#headerParams}}headerParams["{{paramName}}"] = toPathValue({{paramName}}); + {{#headerParams}}headerParams["{{baseName}}"] = toPathValue({{paramName}}); {{/headerParams}} var token:AsyncToken = getApiInvoker().invokeAPI(path, "{{httpMethod}}", queryParams, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, headerParams); diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache index f8471d67b95..e01093b6780 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/README.mustache @@ -7,6 +7,15 @@ is an example of building a swagger-enabled Flask server. This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. +## Requirements +{{#supportPython2}} +Python 2.7+ +{{/supportPython2}} +{{^supportPython2}} +Python 3.5.2+ +{{/supportPython2}} + +## Usage To run the server, please execute the following from the root directory: ``` diff --git a/modules/swagger-codegen/src/main/resources/go/README.mustache b/modules/swagger-codegen/src/main/resources/go/README.mustache index 0cfe5bfcae3..190beb68810 100644 --- a/modules/swagger-codegen/src/main/resources/go/README.mustache +++ b/modules/swagger-codegen/src/main/resources/go/README.mustache @@ -51,7 +51,7 @@ Class | Method | HTTP request | Description {{/isBasic}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{{flow}}} -- **Authorizatoin URL**: {{{authorizationUrl}}} +- **Authorization URL**: {{{authorizationUrl}}} - **Scopes**: {{^scopes}}N/A{{/scopes}} {{#scopes}} - **{{{scope}}}**: {{{description}}} {{/scopes}} diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache index 6d5dfaccb2d..c723c483d32 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache @@ -148,7 +148,6 @@ {{/apis}} {{/apiInfo}} -

Models

[ Jump to Methods ] @@ -156,7 +155,7 @@
    {{#models}} {{#model}} -
  1. {{name}}
  2. +
  3. {{name}}{{#title}} - {{title}}{{/title}}
  4. {{/model}} {{/models}}
@@ -164,8 +163,8 @@ {{#models}} {{#model}}
-

{{name}} - {{title}} Up

-
{{unescapedDescription}}
+

{{name}}{{#title}} - {{title}}{{/title}} Up

+ {{#unescapedDescription}}
{{unescapedDescription}}
{{/unescapedDescription}}
{{#vars}}
{{name}} {{^required}}(optional){{/required}}
{{^isPrimitiveType}}{{datatype}}{{/isPrimitiveType}} {{unescapedDescription}} {{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{#isEnum}} diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache index 01f9f2eb720..fc0f5f38204 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache @@ -336,24 +336,30 @@ {{#responses}}

Status: {{code}} - {{message}}

- {{#schema}} - -
-
-
- -
- +
{{#examples}} -
-
{{example}}
-
+
+
{{example}}
+
{{/examples}} -
- {{/schema}} + {{/schema}} + {{#hasHeaders}} +
+ + + + + + + + {{#headers}} + + + + + + + {{/headers}} +
NameTypeFormatDescription
{{#name}}{{name}}{{/name}}{{#datatype}}{{datatype}}{{/datatype}}{{#dataFormat}}{{dataFormat}}{{/dataFormat}}{{#description}}{{description}}{{/description}}
+
+ {{/hasHeaders}} +
+ {{/responses}}
diff --git a/modules/swagger-codegen/src/main/resources/nodejs-google-cloud-functions/index.mustache b/modules/swagger-codegen/src/main/resources/nodejs-google-cloud-functions/index.mustache deleted file mode 100644 index b406ff7f140..00000000000 --- a/modules/swagger-codegen/src/main/resources/nodejs-google-cloud-functions/index.mustache +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var swaggerTools = require('swagger-tools'); -var jsyaml = require('js-yaml'); -var fs = require('fs'); - -// swaggerRouter configuration -var options = { - controllers: './controllers', - useStubs: false -}; - -// The Swagger document (require it, build it programmatically, fetch it from a URL, ...) -var spec = fs.readFileSync('./api/swagger.yaml', 'utf8'); -var swaggerDoc = jsyaml.safeLoad(spec); - -function toPromise(f, req, res) { - return new Promise(function(resolve, reject) { - f(req, res, function(err) { - if (err) { - reject(err); - } else { - resolve(); - } - }); - }); -} - -exports.{{exportedName}} = function(req, res) { - swaggerTools.initializeMiddleware(swaggerDoc, function(middleware) { - var metadata = middleware.swaggerMetadata(); - var validator = middleware.swaggerValidator(); - var router = middleware.swaggerRouter(options); - req.url = swaggerDoc.basePath + req.url; - toPromise(metadata, req, res).then(function() { - return toPromise(validator, req, res); - }).then(function() { - return toPromise(router, req, res); - }).catch(function(err) { - console.error(err); - res.status(res.statusCode || 400).send(err); - }); - }); -}; diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache index 7e56be1491b..97b1b0ad993 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache @@ -75,8 +75,8 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; - SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; - _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, + {{classPrefix}}JSONRequestSerializer * swgjsonRequestSerializer = [{{classPrefix}}JSONRequestSerializer serializer]; + _requestSerializerForContentType = @{k{{classPrefix}}ApplicationJSONType : swgjsonRequestSerializer, @"application/x-www-form-urlencoded": afhttpRequestSerializer, @"multipart/form-data": afhttpRequestSerializer }; @@ -89,7 +89,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) #pragma mark - Task Methods - (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { {{classPrefix}}DebugLogResponse(response, responseObject,request,error); if(!error) { @@ -104,7 +104,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - + return task; } @@ -135,7 +135,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) completionBlock(file, nil); }]; - + return task; } @@ -157,7 +157,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; - __weak id sanitizer = self.sanitizer; + __weak id<{{classPrefix}}Sanitizer> sanitizer = self.sanitizer; // sanitize parameters pathParams = [sanitizer sanitizeForSerialization:pathParams]; @@ -222,7 +222,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) [self postProcessRequest:request]; - + NSURLSessionTask *task = nil; if ([self.downloadTaskResponseTypes containsObject:responseType]) { @@ -241,9 +241,9 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) completionBlock(response, error); }]; } - + [task resume]; - + return task; } @@ -330,7 +330,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response) NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - + id<{{classPrefix}}Configuration> config = self.configuration; for (NSString *auth in authSettings) { NSDictionary *authSetting = config.authSettings[auth]; diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache index f85b9c58f83..c18131cd699 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache @@ -75,7 +75,7 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; * @param url The base url * @param configuration The configuration implementation */ -- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id<{{classPrefix}}Configuration>)configuration; /** * Performs request diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index 80a047b80b2..6f5ce7267fa 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -79,9 +79,6 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; {{/allParams}} NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"{{path}}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; {{#pathParams}} if ({{paramName}} != nil) { diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache index b7f2dd039ca..d7b17fb9d8a 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache @@ -79,7 +79,6 @@ sub {{operationId}} { {{/allParams}} # parse inputs my $_resource_path = '{{path}}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = '{{httpMethod}}'; my $query_params = {}; diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index 917fa75bf57..e8115d2238c 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -58,9 +58,9 @@ class ApiException extends Exception * @param string $message Error message * @param int $code HTTP status code * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP body of the server response either as Json or string + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, array $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -80,7 +80,7 @@ class ApiException extends Exception /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as Json or string + * @return mixed HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index 9550de6d193..2014eab8a99 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -49,10 +49,16 @@ class ObjectSerializer return $data; } elseif (is_object($data)) { $values = []; - foreach (array_keys($data::swaggerTypes()) as $property) { + foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; - if ($data->$getter() !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); + $value = $data->$getter(); + if (method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value); } } return (object)$values; @@ -259,6 +265,12 @@ class ObjectSerializer } return $deserialized; + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; } else { // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index bfbb6fca373..2c0e2acb7f0 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -211,9 +211,6 @@ use \{{invokerPackage}}\ObjectSerializer; ); } {{/pathParams}} - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - {{#formParams}} // form params if (${{paramName}} !== null) { diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index d409c625cda..bc3548a5019 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -29,7 +29,7 @@ namespace {{invokerPackage}}; */ class Configuration { - private static $defaultConfiguration = null; + private static $defaultConfiguration; /** * Associate array to store API key(s) @@ -99,7 +99,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}"; + protected $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}'; /** * Debug switch (default set to false) @@ -181,7 +181,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $key API key or token * - * @return Configuration + * @return $this */ public function setApiKey($apiKeyIdentifier, $key) { @@ -207,7 +207,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $prefix API key prefix, e.g. Bearer * - * @return Configuration + * @return $this */ public function setApiKeyPrefix($apiKeyIdentifier, $prefix) { @@ -232,7 +232,7 @@ class Configuration * * @param string $accessToken Token for OAuth * - * @return Configuration + * @return $this */ public function setAccessToken($accessToken) { @@ -255,7 +255,7 @@ class Configuration * * @param string $username Username for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setUsername($username) { @@ -278,7 +278,7 @@ class Configuration * * @param string $password Password for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setPassword($password) { @@ -302,7 +302,8 @@ class Configuration * @param string $headerName header name (e.g. Token) * @param string $headerValue header value (e.g. 1z8wp3) * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function addDefaultHeader($headerName, $headerValue) { @@ -329,11 +330,12 @@ class Configuration * * @param string $headerName the header to delete * - * @return Configuration + * @return $this */ public function deleteDefaultHeader($headerName) { unset($this->defaultHeaders[$headerName]); + return $this; } /** @@ -341,7 +343,7 @@ class Configuration * * @param string $host Host * - * @return Configuration + * @return $this */ public function setHost($host) { @@ -364,7 +366,8 @@ class Configuration * * @param string $userAgent the user agent of the api client * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setUserAgent($userAgent) { @@ -391,7 +394,8 @@ class Configuration * * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlTimeout($seconds) { @@ -418,7 +422,8 @@ class Configuration * * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlConnectTimeout($seconds) { @@ -446,7 +451,7 @@ class Configuration * * @param string $proxyHost HTTP Proxy URL * - * @return ApiClient + * @return $this */ public function setCurlProxyHost($proxyHost) { @@ -469,7 +474,7 @@ class Configuration * * @param integer $proxyPort HTTP Proxy Port * - * @return ApiClient + * @return $this */ public function setCurlProxyPort($proxyPort) { @@ -492,7 +497,7 @@ class Configuration * * @param integer $proxyType HTTP Proxy Type * - * @return ApiClient + * @return $this */ public function setCurlProxyType($proxyType) { @@ -515,7 +520,7 @@ class Configuration * * @param string $proxyUser HTTP Proxy User * - * @return ApiClient + * @return $this */ public function setCurlProxyUser($proxyUser) { @@ -538,7 +543,7 @@ class Configuration * * @param string $proxyPassword HTTP Proxy Password * - * @return ApiClient + * @return $this */ public function setCurlProxyPassword($proxyPassword) { @@ -561,7 +566,7 @@ class Configuration * * @param bool $debug Debug flag * - * @return Configuration + * @return $this */ public function setDebug($debug) { @@ -584,7 +589,7 @@ class Configuration * * @param string $debugFile Debug file * - * @return Configuration + * @return $this */ public function setDebugFile($debugFile) { @@ -607,7 +612,7 @@ class Configuration * * @param string $tempFolderPath Temp folder path * - * @return Configuration + * @return $this */ public function setTempFolderPath($tempFolderPath) { @@ -630,7 +635,7 @@ class Configuration * * @param boolean $sslVerification True if the certificate should be validated, false otherwise * - * @return Configuration + * @return $this */ public function setSSLVerification($sslVerification) { @@ -683,7 +688,7 @@ class Configuration { $report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . phpversion() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: {{version}}' . PHP_EOL; {{#artifactVersion}} $report .= ' SDK Package Version: {{artifactVersion}}' . PHP_EOL; diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 9c4eab93107..2c1fc33e82e 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -20,8 +20,10 @@ */ namespace {{modelPackage}}; +{{^isEnum}} use \ArrayAccess; +{{/isEnum}} /** * {{classname}} Class Doc Comment diff --git a/modules/swagger-codegen/src/main/resources/php/model_enum.mustache b/modules/swagger-codegen/src/main/resources/php/model_enum.mustache index c9250081b82..c34cfb3faac 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_enum.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_enum.mustache @@ -1,18 +1,18 @@ class {{classname}} { + /** + * Possible values of this enum + */ {{#allowableValues}}{{#enumVars}}const {{{name}}} = {{{value}}}; {{/enumVars}}{{/allowableValues}} - - {{#vars}}{{#isEnum}} /** * Gets allowable values of the enum * @return string[] */ - public function {{getter}}AllowableValues() + public static function getAllowableEnumValues() { return [ - {{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}} + {{#allowableValues}}{{#enumVars}}self::{{{name}}},{{^-last}} {{/-last}}{{/enumVars}}{{/allowableValues}} ]; } - {{/isEnum}}{{/vars}} -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 0088f2bcec7..a8a0563b295 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -161,7 +161,6 @@ class {{classname}}(object): {{/allParams}} collection_formats = {} - resource_path = '{{path}}'.replace('{format}', 'json') path_params = {} {{#pathParams}} if '{{paramName}}' in params: @@ -211,7 +210,7 @@ class {{classname}}(object): # Authentication setting auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] - return self.api_client.call_api(resource_path, '{{httpMethod}}', + return self.api_client.call_api('{{path}}', '{{httpMethod}}', path_params, query_params, header_params, diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 5ddc4ab7bca..b3961009f16 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -80,6 +80,9 @@ class Configuration(object): # client key file self.key_file = None + # Proxy URL + self.proxy = None + @property def logger_file(self): """ diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index 910d3001edf..6c2c21d3055 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -76,15 +76,30 @@ class RESTClientObject(object): # key file key_file = Configuration().key_file + # proxy + proxy = Configuration().proxy + # https pool manager - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=cert_file, - key_file=key_file - ) + if proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file, + proxy_url=proxy + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file + ) + def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None): diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache index 9bbf6ab0e09..0c1e37aeff8 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache @@ -5,6 +5,7 @@ #include #include #include +#include namespace Swagger { diff --git a/modules/swagger-codegen/src/main/resources/ruby/api.mustache b/modules/swagger-codegen/src/main/resources/ruby/api.mustache index faf2562fde9..fc9d2905635 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api.mustache @@ -108,7 +108,7 @@ module {{moduleName}} {{/hasValidation}} {{/allParams}} # resource path - local_var_path = "{{{path}}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}}.to_s){{/pathParams}} + local_var_path = "{{{path}}}"{{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}}.to_s){{/pathParams}} # query parameters query_params = {} diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache index 7fa611e3744..cf03f368075 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache @@ -129,7 +129,7 @@ module {{moduleName}} # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? + (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. diff --git a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache index 29b3f5ba96f..e1e420d7c6d 100644 --- a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache @@ -13,6 +13,7 @@ import com.sun.jersey.multipart.file.FileDataBodyPart import java.io.File import java.net.URLEncoder +import java.util.UUID import javax.ws.rs.core.MediaType import scala.collection.JavaConverters._ @@ -55,6 +56,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def escape(value: Long): String = value.toString def escape(value: Double): String = value.toString def escape(value: Float): String = value.toString + def escape(value: UUID): String = value.toString def deserialize(json: String, containerType: String, cls: Class[_]) = { if (cls == classOf[String]) { diff --git a/modules/swagger-codegen/src/main/resources/scala/model.mustache b/modules/swagger-codegen/src/main/resources/scala/model.mustache index b6920ae9fd4..12b635bfb3e 100644 --- a/modules/swagger-codegen/src/main/resources/scala/model.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/model.mustache @@ -12,8 +12,9 @@ case class {{classname}} ( {{#description}} /* {{{description}}} */ {{/description}} - {{name}}: {{{datatype}}}{{#hasMore}},{{/hasMore}} + {{{name}}}: {{^required}}Option[{{/required}}{{datatype}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}} {{/vars}} ) + {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index e6d80631460..742693511d1 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -210,7 +210,7 @@ 1.2 2.2 1.19 - 1.5.9 + 1.5.12 1.0.5 1.0.0 2.4.2 diff --git a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt index 9dc3cff3596..00575312d85 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt +++ b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt @@ -23,12 +23,23 @@ scalaVersion := "2.11.2" scalacOptions += "-language:postfixOps" libraryDependencies ++= Seq( - "com.github.finagle" %% "finch-core" % "0.9.2-SNAPSHOT" changing(), - "com.github.finagle" %% "finch-argonaut" % "0.9.2-SNAPSHOT" changing(), - "io.argonaut" %% "argonaut" % "6.1", - "com.github.finagle" %% "finch-test" % "0.9.2-SNAPSHOT" % "test,it" changing(), - "org.scalacheck" %% "scalacheck" % "1.12.5" % "test,it", - "org.scalatest" %% "scalatest" % "2.2.5" % "test,it" + "org.scalatest" %% "scalatest" % "2.2.1" % "test", + "org.scalatra" %% "scalatra" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-scalate" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-json" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-swagger" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-swagger-ext" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-slf4j" % "2.3.0.RC3", + "org.json4s" %% "json4s-jackson" % "3.2.10", + "org.json4s" %% "json4s-ext" % "3.2.10", + "commons-codec" % "commons-codec" % "1.7", + "net.databinder.dispatch" %% "dispatch-core" % "0.11.2", + //"net.databinder.dispatch" %% "json4s-jackson" % "0.11.2", + "net.databinder.dispatch" %% "dispatch-json4s-jackson" % "0.11.2", + "com.typesafe.akka" %% "akka-actor" % "2.3.6", + "org.eclipse.jetty" % "jetty-server" % "9.2.3.v20140905" % "container;compile;test", + "org.eclipse.jetty" % "jetty-webapp" % "9.2.3.v20140905" % "container;compile;test", + "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;compile;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")) ) resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" @@ -37,9 +48,6 @@ resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/reposi resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/" -resolvers += "TM" at "http://maven.twttr.com" - - ivyXML := diff --git a/modules/swagger-codegen/src/main/resources/silex/index.mustache b/modules/swagger-codegen/src/main/resources/silex/index.mustache index 0ace4d41fda..41bef9c7c03 100644 --- a/modules/swagger-codegen/src/main/resources/silex/index.mustache +++ b/modules/swagger-codegen/src/main/resources/silex/index.mustache @@ -8,19 +8,23 @@ use Silex\Application; $app = new Silex\Application(); {{#apiInfo}} - {{#apis}} - {{#operations}} - {{#operation}} +{{#apis}} +{{#operations}} +{{#operation}} -$app->{{httpMethod}}('{{basePathWithoutHost}}{{path}}', function(Application $app, Request $request{{#pathParams}}, ${{paramName}}{{/pathParams}}) { - {{#queryParams}}${{paramName}} = $request->get('{{paramName}}');{{newline}} {{/queryParams}} - {{#formParams}}${{paramName}} = $request->get('{{paramName}}');{{newline}} {{/formParams}} - return new Response('How about implementing {{nickname}} as a {{httpMethod}} method ?'); +$app->{{httpMethod}}('{{basePathWithoutHost}}{{path}}', function(Application $app, Request $request{{#pathParams}}, ${{baseName}}{{/pathParams}}) { + {{#queryParams}} + ${{paramName}} = $request->get('{{paramName}}'); + {{/queryParams}} + {{#formParams}} + ${{paramName}} = $request->get('{{paramName}}'); + {{/formParams}} + return new Response('How about implementing {{operationId}} as a {{httpMethod}} method ?'); }); - {{/operation}} - {{/operations}} - {{/apis}} +{{/operation}} +{{/operations}} +{{/apis}} {{/apiInfo}} $app->run(); diff --git a/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache b/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache index 801647631e4..66e95afde41 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): diff --git a/modules/swagger-codegen/src/main/resources/swift3/api.mustache b/modules/swagger-codegen/src/main/resources/swift3/api.mustache index 8ef1739f687..fe81acd5286 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/api.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/api.mustache @@ -105,7 +105,7 @@ open class {{classname}}: APIBase { */ open class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{path}}"{{#pathParams}} - path = path.replacingOccurrences(of: "{{=<% %>=}}{<%paramName%>}<%={{ }}=%>", with: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .literal, range: nil){{/pathParams}} + path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .literal, range: nil){{/pathParams}} let URLString = {{projectName}}API.basePath + path {{#bodyParam}} let parameters = {{paramName}}{{^required}}?{{/required}}.encodeToJSON() as? [String:AnyObject] diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache index a80fb8e022d..1dd5134e4d0 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache @@ -99,7 +99,8 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable { - const path = this.basePath + `{{path}}`; + const path = this.basePath + '{{path}}'{{#pathParams}} + .replace('${' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -127,11 +128,17 @@ export class {{classname}} { {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { - if({{paramName}} instanceof Date) { - queryParameters.set('{{baseName}}', {{paramName}}.d.toISOString()); - } else { - queryParameters.set('{{baseName}}', {{paramName}}); - } + {{#isDateTime}} + queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); + {{/isDateTime}} + {{^isDateTime}} + {{#isDate}} + queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); + {{/isDate}} + {{^isDate}} + queryParameters.set('{{baseName}}', {{paramName}}); + {{/isDate}} + {{/isDateTime}} } {{/isListContainer}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore b/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore index 35e2fb2b02e..149b5765472 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache b/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache index e63ecfe2f47..69dce348fe3 100644 --- a/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache @@ -32,7 +32,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -64,7 +64,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index a661ba4ea42..b5079ead853 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -58,9 +58,9 @@ public class CodegenTest { final CodegenParameter file = op.formParams.get(1); Assert.assertTrue(file.isFormParam); Assert.assertEquals(file.dataType, "File"); - Assert.assertNull(file.required); + Assert.assertFalse(file.required); Assert.assertTrue(file.isFile); - Assert.assertNull(file.hasMore); + Assert.assertFalse(file.hasMore); } @Test(description = "read formParam values from a 2.0 spec") @@ -87,7 +87,7 @@ public class CodegenTest { Assert.assertTrue(idParam.isPathParam); Assert.assertEquals(idParam.dataType, "String"); Assert.assertTrue(idParam.required); - Assert.assertNull(idParam.hasMore); + Assert.assertFalse(idParam.hasMore); Assert.assertEquals(op.allParams.size(), 3); Assert.assertEquals(op.formParams.size(), 2); @@ -96,15 +96,15 @@ public class CodegenTest { Assert.assertTrue(nameParam.isFormParam); Assert.assertTrue(nameParam.notFile); Assert.assertEquals(nameParam.dataType, "String"); - Assert.assertNull(nameParam.required); + Assert.assertFalse(nameParam.required); Assert.assertTrue(nameParam.hasMore); final CodegenParameter statusParam = op.formParams.get(1); Assert.assertTrue(statusParam.isFormParam); Assert.assertTrue(statusParam.notFile); Assert.assertEquals(statusParam.dataType, "String"); - Assert.assertNull(statusParam.required); - Assert.assertNull(statusParam.hasMore); + Assert.assertFalse(statusParam.required); + Assert.assertFalse(statusParam.hasMore); } @Test(description = "handle enum array in query parameter test") diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java index 4f355723a7f..dec0d8ddd4a 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/bash/BashTest.java @@ -1,30 +1,14 @@ package io.swagger.codegen.bash; -import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenOperation; -import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.languages.BashClientCodegen; -import io.swagger.models.ArrayModel; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; import io.swagger.models.Operation; import io.swagger.models.Swagger; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.DateTimeProperty; -import io.swagger.models.properties.LongProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import io.swagger.parser.SwaggerParser; - import org.testng.Assert; import org.testng.annotations.Test; -import org.testng.annotations.ITestAnnotation; - -import com.google.common.collect.Sets; -import java.util.Map; @SuppressWarnings("static-method") public class BashTest { @@ -48,7 +32,7 @@ public class BashTest { swagger); Assert.assertTrue( - op.vendorExtensions.containsKey("x-bash-codegen-sample")); + op.vendorExtensions.containsKey("x-code-samples")); Assert.assertEquals( op.vendorExtensions.get("x-bash-codegen-description"), diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java index edffc835de8..5f5a3e644a3 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java @@ -15,6 +15,7 @@ import mockit.Injectable; import mockit.Mocked; import mockit.StrictExpectations; import mockit.Tested; +import org.apache.commons.lang3.SerializationUtils; import org.testng.annotations.Test; import java.nio.file.Paths; @@ -299,6 +300,13 @@ public class CodegenConfiguratorTest { assertEquals(configurator.getIgnoreFileOverride(), "/path/to/override/.swagger-codegen-ignore"); } + @Test + public void testCodegenConfiguratorIsSerializable() { + final CodegenConfigurator configurator = CodegenConfigurator.fromFile("src/test/resources/sampleConfig.json"); + // Simply ensure that the object can be serialized + SerializationUtils.serialize(configurator); + } + @SuppressWarnings("unused") private ClientOptInput setupAndRunGenericTest(CodegenConfigurator configurator) { diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javaPlayFramework/JavaPlayFrameworkOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javaPlayFramework/JavaPlayFrameworkOptionsTest.java new file mode 100644 index 00000000000..a6873db28ad --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javaPlayFramework/JavaPlayFrameworkOptionsTest.java @@ -0,0 +1,68 @@ +package io.swagger.codegen.javaPlayFramework; + +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.java.JavaClientOptionsTest; +import io.swagger.codegen.languages.JavaPlayFrameworkCodegen; +import io.swagger.codegen.options.JavaPlayFrameworkOptionsProvider; +import mockit.Expectations; +import mockit.Tested; + +public class JavaPlayFrameworkOptionsTest extends JavaClientOptionsTest { + + @Tested + private JavaPlayFrameworkCodegen clientCodegen; + + public JavaPlayFrameworkOptionsTest() { + super(new JavaPlayFrameworkOptionsProvider()); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @SuppressWarnings("unused") + @Override + protected void setExpectations() { + new Expectations(clientCodegen) {{ + clientCodegen.setModelPackage(JavaPlayFrameworkOptionsProvider.MODEL_PACKAGE_VALUE); + times = 1; + clientCodegen.setApiPackage(JavaPlayFrameworkOptionsProvider.API_PACKAGE_VALUE); + times = 1; + clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.SORT_PARAMS_VALUE)); + times = 1; + clientCodegen.setInvokerPackage(JavaPlayFrameworkOptionsProvider.INVOKER_PACKAGE_VALUE); + times = 1; + clientCodegen.setGroupId(JavaPlayFrameworkOptionsProvider.GROUP_ID_VALUE); + times = 1; + clientCodegen.setArtifactId(JavaPlayFrameworkOptionsProvider.ARTIFACT_ID_VALUE); + times = 1; + clientCodegen.setArtifactVersion(JavaPlayFrameworkOptionsProvider.ARTIFACT_VERSION_VALUE); + times = 1; + clientCodegen.setSourceFolder(JavaPlayFrameworkOptionsProvider.SOURCE_FOLDER_VALUE); + times = 1; + clientCodegen.setLocalVariablePrefix(JavaPlayFrameworkOptionsProvider.LOCAL_PREFIX_VALUE); + times = 1; + clientCodegen.setSerializableModel(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.SERIALIZABLE_MODEL_VALUE)); + times = 1; + clientCodegen.setFullJavaUtil(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.FULL_JAVA_UTIL_VALUE)); + times = 1; + clientCodegen.setTitle(JavaPlayFrameworkOptionsProvider.TITLE); + times = 1; + clientCodegen.setConfigPackage(JavaPlayFrameworkOptionsProvider.CONFIG_PACKAGE_VALUE); + times = 1; + clientCodegen.setBasePackage(JavaPlayFrameworkOptionsProvider.BASE_PACKAGE_VALUE); + times = 1; + clientCodegen.setControllerOnly(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.CONTROLLER_ONLY)); + times = 1; + clientCodegen.setSingleContentTypes(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.SINGLE_CONTENT_TYPES)); + times = 1; + clientCodegen.setResponseWrapper(JavaPlayFrameworkOptionsProvider.RESPONSE_WRAPPER); + times = 1; + clientCodegen.setUseTags(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.USE_TAGS)); + times = 1; + clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaPlayFrameworkOptionsProvider.USE_BEANVALIDATION)); + times = 1; + }}; + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JavaResteasyEapServerOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JavaResteasyEapServerOptionsTest.java new file mode 100644 index 00000000000..009076bc2e7 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JavaResteasyEapServerOptionsTest.java @@ -0,0 +1,77 @@ +package io.swagger.codegen.jaxrs; + +import io.swagger.codegen.AbstractOptionsTest; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.languages.JavaResteasyEapServerCodegen; +import io.swagger.codegen.options.JavaResteasyEapServerOptionsProvider; +import io.swagger.codegen.options.OptionsProvider; +import mockit.Expectations; +import mockit.Tested; + +public class JavaResteasyEapServerOptionsTest extends AbstractOptionsTest { + + @Tested + private JavaResteasyEapServerCodegen clientCodegen; + + public JavaResteasyEapServerOptionsTest() { + super(new JavaResteasyEapServerOptionsProvider()); + } + + protected JavaResteasyEapServerOptionsTest(OptionsProvider optionsProvider) { + super(optionsProvider); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @Override + protected void setExpectations() { + new Expectations(clientCodegen) { + { + clientCodegen.setModelPackage(JavaResteasyEapServerOptionsProvider.MODEL_PACKAGE_VALUE); + times = 1; + clientCodegen.setApiPackage(JavaResteasyEapServerOptionsProvider.API_PACKAGE_VALUE); + times = 1; + clientCodegen.setSortParamsByRequiredFlag( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.SORT_PARAMS_VALUE)); + times = 1; + clientCodegen.setInvokerPackage(JavaResteasyEapServerOptionsProvider.INVOKER_PACKAGE_VALUE); + times = 1; + clientCodegen.setGroupId(JavaResteasyEapServerOptionsProvider.GROUP_ID_VALUE); + times = 1; + clientCodegen.setArtifactId(JavaResteasyEapServerOptionsProvider.ARTIFACT_ID_VALUE); + times = 1; + clientCodegen.setArtifactVersion(JavaResteasyEapServerOptionsProvider.ARTIFACT_VERSION_VALUE); + times = 1; + clientCodegen.setSourceFolder(JavaResteasyEapServerOptionsProvider.SOURCE_FOLDER_VALUE); + times = 1; + clientCodegen.setLocalVariablePrefix(JavaResteasyEapServerOptionsProvider.LOCAL_PREFIX_VALUE); + times = 1; + clientCodegen.setSerializableModel( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.SERIALIZABLE_MODEL_VALUE)); + times = 1; + clientCodegen + .setFullJavaUtil(Boolean.valueOf(JavaResteasyEapServerOptionsProvider.FULL_JAVA_UTIL_VALUE)); + times = 1; + clientCodegen.setSerializeBigDecimalAsString(true); + times = 1; + + clientCodegen.setGenerateJbossDeploymentDescriptor( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR)); + times = 1; + + // no invocation as it is already defined as true in JavaResteasyEapServerCodegen + // clientCodegen + // .setUseBeanValidation(Boolean.valueOf(JavaResteasyEapServerOptionsProvider.USE_BEANVALIDATION)); + // times = 1; + clientCodegen + .setUseSwaggerFeature( + Boolean.valueOf(JavaResteasyEapServerOptionsProvider.USE_SWAGGER_FEATURE)); + times = 1; + + } + }; + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java index 1fb1b86604d..3a4ddc208f8 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java @@ -17,11 +17,13 @@ public class JavaClientOptionsProvider extends JavaOptionsProvider { Map options = new HashMap(super.createOptions()); options.put(CodegenConstants.LIBRARY, DEFAULT_LIBRARY_VALUE); options.put(JavaClientCodegen.USE_RX_JAVA, "false"); + options.put(JavaClientCodegen.USE_RX_JAVA2, "false"); options.put(JavaClientCodegen.USE_PLAY24_WS, "false"); options.put(JavaClientCodegen.PARCELABLE_MODEL, "false"); options.put(JavaClientCodegen.SUPPORT_JAVA6, "false"); options.put(JavaClientCodegen.USE_BEANVALIDATION, "false"); options.put(JavaClientCodegen.PERFORM_BEANVALIDATION, PERFORM_BEANVALIDATION); + options.put(JavaClientCodegen.USE_GZIP_FEATURE, "false"); return options; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaPlayFrameworkOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaPlayFrameworkOptionsProvider.java new file mode 100644 index 00000000000..b0971b2e475 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaPlayFrameworkOptionsProvider.java @@ -0,0 +1,42 @@ +package io.swagger.codegen.options; + +import io.swagger.codegen.languages.JavaPlayFrameworkCodegen; + +import java.util.HashMap; +import java.util.Map; + +public class JavaPlayFrameworkOptionsProvider extends JavaOptionsProvider { + public static final String TITLE = "swagger"; + public static final String CONFIG_PACKAGE_VALUE = "configPackage"; + public static final String BASE_PACKAGE_VALUE = "basePackage"; + public static final String CONTROLLER_ONLY = "true"; + public static final String SINGLE_CONTENT_TYPES = "true"; + public static final String RESPONSE_WRAPPER = "Callable"; + public static final String USE_TAGS = "useTags"; + public static final String USE_BEANVALIDATION = "true"; + + @Override + public String getLanguage() { + return "javaPlayFramework"; + } + + @Override + public Map createOptions() { + Map options = new HashMap(super.createOptions()); + options.put(JavaPlayFrameworkCodegen.TITLE, TITLE); + options.put(JavaPlayFrameworkCodegen.CONFIG_PACKAGE, CONFIG_PACKAGE_VALUE); + options.put(JavaPlayFrameworkCodegen.BASE_PACKAGE, BASE_PACKAGE_VALUE); + options.put(JavaPlayFrameworkCodegen.CONTROLLER_ONLY, CONTROLLER_ONLY); + options.put(JavaPlayFrameworkCodegen.SINGLE_CONTENT_TYPES, SINGLE_CONTENT_TYPES); + options.put(JavaPlayFrameworkCodegen.RESPONSE_WRAPPER, RESPONSE_WRAPPER); + options.put(JavaPlayFrameworkCodegen.USE_TAGS, USE_TAGS); + options.put(JavaPlayFrameworkCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION); + + return options; + } + + @Override + public boolean isServer() { + return true; + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaResteasyEapServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaResteasyEapServerOptionsProvider.java new file mode 100644 index 00000000000..7e9bffb33c4 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaResteasyEapServerOptionsProvider.java @@ -0,0 +1,50 @@ +package io.swagger.codegen.options; + +import java.util.Map; + +import com.google.common.collect.ImmutableMap; + +import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.languages.JavaCXFServerCodegen; +import io.swagger.codegen.languages.JavaResteasyEapServerCodegen; +import io.swagger.codegen.languages.JavaResteasyServerCodegen; + +public class JavaResteasyEapServerOptionsProvider extends JavaOptionsProvider { + + public static final String GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR = "true"; + + public static final String IMPL_FOLDER_VALUE = "src/main/java"; + + public static final String USE_BEANVALIDATION = "true"; + + public static final String USE_SWAGGER_FEATURE = "true"; + + @Override + public boolean isServer() { + return true; + } + + @Override + public String getLanguage() { + return "jaxrs-resteasy-eap"; + } + + @Override + public Map createOptions() { + + Map parentOptions = super.createOptions(); + + ImmutableMap.Builder builder = new ImmutableMap.Builder() + .putAll(parentOptions); + + builder.put(CodegenConstants.IMPL_FOLDER, IMPL_FOLDER_VALUE); + builder.put("title", "Test title"); + + builder.put(JavaCXFServerCodegen.GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR); + builder.put(JavaResteasyServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION); + builder.put(JavaResteasyEapServerCodegen.USE_SWAGGER_FEATURE, USE_SWAGGER_FEATURE); + + return builder.build(); + + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java index 3bad178c416..6387d49f144 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java @@ -19,6 +19,7 @@ public class SpringOptionsProvider extends JavaOptionsProvider { public static final String RESPONSE_WRAPPER = "Callable"; public static final String USE_TAGS = "useTags"; public static final String USE_BEANVALIDATION = "false"; + public static final String IMPLICIT_HEADERS = "false"; @Override public String getLanguage() { @@ -40,6 +41,7 @@ public class SpringOptionsProvider extends JavaOptionsProvider { options.put(SpringCodegen.RESPONSE_WRAPPER, RESPONSE_WRAPPER); options.put(SpringCodegen.USE_TAGS, USE_TAGS); options.put(SpringCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION); + options.put(SpringCodegen.IMPLICIT_HEADERS, IMPLICIT_HEADERS); return options; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java index f16caa83127..96dd2883aaa 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java @@ -73,7 +73,8 @@ public class SpringOptionsTest extends JavaClientOptionsTest { times = 1; clientCodegen.setUseBeanValidation(Boolean.valueOf(SpringOptionsProvider.USE_BEANVALIDATION)); times = 1; - + clientCodegen.setImplicitHeaders(Boolean.valueOf(SpringOptionsProvider.IMPLICIT_HEADERS)); + times = 1; }}; } } diff --git a/modules/swagger-codegen/src/test/resources/2_0/responseCodeTest.yaml b/modules/swagger-codegen/src/test/resources/2_0/responseCodeTest.yaml new file mode 100644 index 00000000000..73e20403b5b --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/responseCodeTest.yaml @@ -0,0 +1,17 @@ +swagger: '2.0' +info: + description: 'Test for response code default' + version: 1.0.0 + title: Response code test +basePath: / +paths: + /test: + get: + summary: Test + produces: + - application/json + responses: + 200: + description: successful operation + default: + description: Internal server error \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml b/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml new file mode 100644 index 00000000000..7c868bdabac --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml @@ -0,0 +1,41 @@ +swagger: '2.0' +info: + description: 'Test for displaying response headers' + version: 1.0.0 + title: Response header test + license: + name: Apache 2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +basePath: / +schemes: + - http +paths: + /test: + get: + summary: Test + description: Test + produces: + - application/json + responses: + '200': + description: successful operation + schema: + type: array + items: + type: string + headers: + X-STATUS: + type: "integer" + description: "Output status of the operation" + '500': + description: "Internal server error" + headers: + X-MSG-ID: + type: "string" + format: ".*" + description: "I am the error description" + X-ERROR-ID: + type: "integer" + description: "I am the error code" + '400': + description: Invalid ID supplied \ No newline at end of file diff --git a/modules/swagger-generator/src/main/webapp/index.html b/modules/swagger-generator/src/main/webapp/index.html index b3c14aacd05..694a55049b9 100644 --- a/modules/swagger-generator/src/main/webapp/index.html +++ b/modules/swagger-generator/src/main/webapp/index.html @@ -13,12 +13,12 @@ - + - + diff --git a/samples/client/petstore-security-test/go/README.md b/samples/client/petstore-security-test/go/README.md index 965b0aca530..c35db5c71ca 100644 --- a/samples/client/petstore-security-test/go/README.md +++ b/samples/client/petstore-security-test/go/README.md @@ -43,7 +43,7 @@ Class | Method | HTTP request | Description - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - **write:pets**: modify pets in your account */ ' " =end \r\n \n \r - **read:pets**: read your pets */ ' " =end \r\n \n \r diff --git a/samples/client/petstore-security-test/java/okhttp-gson/README.md b/samples/client/petstore-security-test/java/okhttp-gson/README.md index ad16d5e8641..63efd69e9b8 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/README.md +++ b/samples/client/petstore-security-test/java/okhttp-gson/README.md @@ -110,7 +110,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account */ ' " =end - read:pets: read your pets */ ' " =end diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 076c4c09a10..6a443dd2a9f 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -1032,6 +1032,13 @@ public class ApiClient { if (returnType == null || response.code() == 204) { // returning null if the returnType is not defined, // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } return null; } else { return deserialize(response, returnType); diff --git a/samples/client/petstore-security-test/objc/README.md b/samples/client/petstore-security-test/objc/README.md index 3365aba9056..c56b13119e4 100644 --- a/samples/client/petstore-security-test/objc/README.md +++ b/samples/client/petstore-security-test/objc/README.md @@ -1,13 +1,12 @@ # SwaggerClient -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- This ObjC package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -- API version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r +- API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r - Package version: -- Build date: 2016-07-12T17:06:42.405+08:00 -- Build package: class io.swagger.codegen.languages.ObjcClientCodegen +- Build package: io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -40,7 +39,7 @@ Import the following: ```objc #import -#import +#import // load models #import // load API classes for accessing endpoints @@ -50,7 +49,7 @@ Import the following: ## Recommendation -It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issue. +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. ## Getting Started @@ -59,11 +58,11 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -NSString* *testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +NSString* *testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) SWGFakeApi *apiInstance = [[SWGFakeApi alloc] init]; -// To test code injection *_/ ' \" =end \\r\\n \\n \\r +// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r [apiInstance testCodeInjectEndRnNRWithTestCodeInjectEndRnNR:testCodeInjectEndRnNR completionHandler: ^(NSError* error) { if (error) { @@ -75,11 +74,11 @@ SWGFakeApi *apiInstance = [[SWGFakeApi alloc] init]; ## Documentation for API Endpoints -All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r* +All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SWGFakeApi* | [**testCodeInjectEndRnNR**](docs/SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r +*SWGFakeApi* | [**testCodeInjectEndRnNR**](docs/SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r ## Documentation For Models @@ -93,7 +92,7 @@ Class | Method | HTTP request | Description ## api_key - **Type**: API key -- **API key parameter name**: api_key */ ' " =end \r\n \n \r +- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r - **Location**: HTTP header ## petstore_auth @@ -102,12 +101,12 @@ Class | Method | HTTP request | Description - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - - **write:pets**: modify pets in your account */ ' " =end \r\n \n \r - - **read:pets**: read your pets */ ' " =end \r\n \n \r + - **write:pets**: modify pets in your account *_/ ' \" =end -- \\r\\n \\n \\r + - **read:pets**: read your pets *_/ ' \" =end -- \\r\\n \\n \\r ## Author -apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r diff --git a/samples/client/petstore-security-test/objc/SwaggerClient.podspec b/samples/client/petstore-security-test/objc/SwaggerClient.podspec index b3ef54ca1de..1cdaaf79222 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient.podspec +++ b/samples/client/petstore-security-test/objc/SwaggerClient.podspec @@ -11,9 +11,9 @@ Pod::Spec.new do |s| s.name = "SwaggerClient" s.version = "1.0.0" - s.summary = "Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r" + s.summary = "Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r" s.description = <<-DESC - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- DESC s.platform = :ios, '7.0' @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.framework = 'SystemConfiguration' s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.license = "Apache License, Version 2.0" + s.license = "Proprietary" s.source = { :git => "https://github.com/swagger-api/swagger-codegen.git", :tag => "#{s.version}" } s.author = { "Swagger" => "apiteam@swagger.io" } @@ -32,6 +32,6 @@ Pod::Spec.new do |s| s.dependency 'AFNetworking', '~> 3' s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.5' + s.dependency 'ISO8601', '~> 0.6' end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h index 50daf69d833..bea37df4acb 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h @@ -2,46 +2,35 @@ #import "SWGApi.h" /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGFakeApi: NSObject extern NSString* kSWGFakeApiErrorDomain; extern NSInteger kSWGFakeApiMissingParamErrorCode; -+(instancetype) sharedAPI; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; -/// To test code injection *_/ ' \" =end \\r\\n \\n \\r +/// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r /// /// -/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) /// -/// code:400 message:"To test code injection *_/ ' \" =end \\r\\n \\n \\r" +/// code:400 message:"To test code injection *_/ ' \" =end -- \\r\\n \\n \\r" /// /// @return --(NSNumber*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR +-(NSURLSessionTask*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m index 33c15278886..e0a90fbcdb7 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.m @@ -1,10 +1,11 @@ #import "SWGFakeApi.h" #import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" @interface SWGFakeApi () -@property (nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; @end @@ -18,64 +19,43 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; #pragma mark - Initialize methods - (instancetype) init { - self = [super init]; - if (self) { - SWGConfiguration *config = [SWGConfiguration sharedConfig]; - if (config.apiClient == nil) { - config.apiClient = [[SWGApiClient alloc] init]; - } - _apiClient = config.apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; - } - return self; + return [self initWithApiClient:[SWGApiClient sharedClient]]; } -- (id) initWithApiClient:(SWGApiClient *)apiClient { + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { _apiClient = apiClient; - _defaultHeaders = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; } return self; } #pragma mark - -+ (instancetype)sharedAPI { - static SWGFakeApi *sharedAPI; - static dispatch_once_t once; - dispatch_once(&once, ^{ - sharedAPI = [[self alloc] init]; - }); - return sharedAPI; -} - -(NSString*) defaultHeaderForKey:(NSString*)key { - return self.defaultHeaders[key]; -} - --(void) addHeader:(NSString*)value forKey:(NSString*)key { - [self setDefaultHeaderValue:value forKey:key]; + return self.mutableDefaultHeaders[key]; } -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.defaultHeaders setValue:value forKey:key]; + [self.mutableDefaultHeaders setValue:value forKey:key]; } --(NSUInteger) requestQueueSize { - return [SWGApiClient requestQueueSize]; +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; } #pragma mark - Api Methods /// -/// To test code injection *_/ ' \" =end \\r\\n \\n \\r +/// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r /// -/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +/// @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) /// /// @returns void /// --(NSNumber*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR +-(NSURLSessionTask*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/fake"]; @@ -88,9 +68,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"*/ ' =end - - "]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"*_/ ' =end -- "]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -99,9 +77,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"*/ ' =end - - "]]; + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"*_/ ' =end -- "]]; // Authentication setting NSArray *authSettings = @[]; @@ -110,7 +86,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; if (testCodeInjectEndRnNR) { - formParams[@"test code inject */ ' " =end \r\n \n \r"] = testCodeInjectEndRnNR; + formParams[@"test code inject */ ' " =end -- \r\n \n \r"] = testCodeInjectEndRnNR; } return [self.apiClient requestWithPath: resourcePath @@ -129,8 +105,7 @@ NSInteger kSWGFakeApiMissingParamErrorCode = 234513; if(handler) { handler(error); } - } - ]; + }]; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index e91fb24ebcf..0cf26e056c7 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -1,31 +1,19 @@ #import -#import #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface JSONValueTransformer (ISO8601) @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m index cec8bdeea27..b544a1dae58 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -1,3 +1,4 @@ +#import #import "JSONValueTransformer+ISO8601.h" @implementation JSONValueTransformer (ISO8601) diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h index 754b95d7b44..5082262a432 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApi.h @@ -1,42 +1,29 @@ #import -#import "SWGObject.h" -#import "SWGApiClient.h" + +@class SWGApiClient; /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @protocol SWGApi -@property(nonatomic, assign) SWGApiClient *apiClient; +@property(readonly, nonatomic, strong) SWGApiClient *apiClient; --(id) initWithApiClient:(SWGApiClient *)apiClient; - --(void) addHeader:(NSString*)value forKey:(NSString*)key DEPRECATED_MSG_ATTRIBUTE("setDefaultHeaderValue:forKey:"); +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; -(NSString*) defaultHeaderForKey:(NSString*)key; --(NSUInteger) requestQueueSize; +-(NSDictionary *)defaultHeaders; @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h index 3421219f37d..f4c35e17a52 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h @@ -1,43 +1,20 @@ -#import -#import #import -#import "SWGJSONResponseSerializer.h" -#import "SWGJSONRequestSerializer.h" -#import "SWGQueryParamCollection.h" #import "SWGConfiguration.h" #import "SWGResponseDeserializer.h" #import "SWGSanitizer.h" -#import "SWGLogger.h" /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ -#import "SWGReturn.h" - - - -@class SWGConfiguration; /** * A key for `NSError` user info dictionaries. @@ -46,117 +23,49 @@ */ extern NSString *const SWGResponseObjectErrorKey; + @interface SWGApiClient : AFHTTPSessionManager -@property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy; -@property(nonatomic, assign) NSTimeInterval timeoutInterval; -@property(nonatomic, readonly) NSOperationQueue* queue; +@property (nonatomic, strong, readonly) id configuration; -/// In order to ensure the HTTPResponseHeaders are correct, it is recommended to initialize one SWGApiClient instance per thread. -@property(nonatomic, readonly) NSDictionary* HTTPResponseHeaders; +@property(nonatomic, assign) NSTimeInterval timeoutInterval; @property(nonatomic, strong) id responseDeserializer; @property(nonatomic, strong) id sanitizer; -/** - * Clears Cache - */ -+(void)clearCache; + +@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; /** - * Turns on cache - * - * @param enabled If the cached is enable, must be `YES` or `NO` + * Gets client singleton instance */ -+(void)setCacheEnabled:(BOOL) enabled; ++ (instancetype) sharedClient; -/** - * Gets the request queue size - * - * @return The size of `queuedRequests` static variable. - */ -+(NSUInteger)requestQueueSize; - -/** - * Sets the client unreachable - * - * @param state off line state, must be `YES` or `NO` - */ -+(void) setOfflineState:(BOOL) state; - -/** - * Gets if the client is unreachable - * - * @return The client offline state - */ -+(BOOL) getOfflineState; - -/** - * Sets the client reachability, this may be overridden by the reachability manager if reachability changes - * - * @param The client reachability. - */ -+(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; - -/** - * Gets the client reachability - * - * @return The client reachability. - */ -+(AFNetworkReachabilityStatus) getReachabilityStatus; - -/** - * Gets the next request id - * - * @return The next executed request id. - */ -+(NSNumber*) nextRequestId; - -/** - * Generates request id and add it to the queue - * - * @return The next executed request id. - */ -+(NSNumber*) queueRequest; - -/** - * Removes request id from the queue - * - * @param requestId The request which will be removed. - */ -+(void) cancelRequest:(NSNumber*)requestId; - -/** - * Customizes the behavior when the reachability changed - * - * @param changeBlock The block will be executed when the reachability changed. - */ -+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock; - -/** - * Sets the api client reachability strategy - */ -- (void)configureCacheReachibility; - -/** - * Sets header for request - * - * @param value The header value - * @param forKey The header key - */ --(void)setHeaderValue:(NSString*) value - forKey:(NSString*) forKey; /** * Updates header parameters and query parameters for authentication * - * @param headers The header parameter will be updated, passed by pointer to pointer. + * @param headers The header parameter will be udpated, passed by pointer to pointer. * @param querys The query parameters will be updated, passed by pointer to pointer. * @param authSettings The authentication names NSArray. */ -- (void) updateHeaderParams:(NSDictionary **)headers - queryParams:(NSDictionary **)querys - WithAuthSettings:(NSArray *)authSettings; +- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + +/** +* Initializes the session manager with a configuration and url +* +* @param url The base url +* @param configuration The configuration implementation +*/ +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; /** * Performs request @@ -172,35 +81,20 @@ extern NSString *const SWGResponseObjectErrorKey; * @param responseContentType Response content-type. * @param completionBlock The block will be executed when the request completed. * - * @return The request id. + * @return The created session task. */ --(NSNumber*) requestWithPath:(NSString*) path - method:(NSString*) method - pathParams:(NSDictionary *) pathParams - queryParams:(NSDictionary*) queryParams - formParams:(NSDictionary *) formParams - files:(NSDictionary *) files - body:(id) body - headerParams:(NSDictionary*) headerParams - authSettings:(NSArray *) authSettings - requestContentType:(NSString*) requestContentType - responseContentType:(NSString*) responseContentType - responseType:(NSString *) responseType - completionBlock:(void (^)(id, NSError *))completionBlock; - -/** - * Custom security policy - * - * @return AFSecurityPolicy - */ -- (AFSecurityPolicy *) customSecurityPolicy; - -/** - * SWGConfiguration return sharedConfig - * - * @return SWGConfiguration - */ -- (SWGConfiguration*) configuration; - +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m index f004200b2eb..4b1d014d2bc 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.m @@ -1,14 +1,13 @@ + +#import "SWGLogger.h" #import "SWGApiClient.h" +#import "SWGJSONRequestSerializer.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; -static NSUInteger requestId = 0; -static bool offlineState = false; -static NSMutableSet * queuedRequests = nil; -static bool cacheEnabled = false; -static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable; -static void (^reachabilityChangeBlock)(int); - +static NSString * const kSWGContentDispositionKey = @"Content-Disposition"; static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { if(![response isKindOfClass:[NSHTTPURLResponse class]]) { @@ -19,179 +18,80 @@ static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSDictionary * headers = SWG__headerFieldsForResponse(response); - if(!headers[@"Content-Disposition"]) { + if(!headers[kSWGContentDispositionKey]) { return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; } NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; - NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern - options:NSRegularExpressionCaseInsensitive - error:nil]; - NSString *contentDispositionHeader = headers[@"Content-Disposition"]; - NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader - options:0 - range:NSMakeRange(0, [contentDispositionHeader length])]; + NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; + NSString *contentDispositionHeader = headers[kSWGContentDispositionKey]; + NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; } @interface SWGApiClient () -@property (nonatomic, strong) NSDictionary* HTTPResponseHeaders; +@property (nonatomic, strong, readwrite) id configuration; + +@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; @end @implementation SWGApiClient +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static SWGApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + - (instancetype)init { - NSString *baseUrl = [[SWGConfiguration sharedConfig] host]; - return [self initWithBaseURL:[NSURL URLWithString:baseUrl]]; + return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; } - (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url configuration:[SWGDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithConfiguration:(id)configuration { + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { self = [super initWithBaseURL:url]; if (self) { - self.timeoutInterval = 60; - self.requestSerializer = [AFJSONRequestSerializer serializer]; - self.responseSerializer = [AFJSONResponseSerializer serializer]; - self.securityPolicy = [self customSecurityPolicy]; - self.responseDeserializer = [[SWGResponseDeserializer alloc] init]; - self.sanitizer = [[SWGSanitizer alloc] init]; - // configure reachability - [self configureCacheReachibility]; + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[SWGResponseDeserializer alloc] init]; + _sanitizer = [[SWGSanitizer alloc] init]; + + _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; + + AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; + SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; + _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, + @"application/x-www-form-urlencoded": afhttpRequestSerializer, + @"multipart/form-data": afhttpRequestSerializer + }; + self.securityPolicy = [self createSecurityPolicy]; + self.responseSerializer = [AFHTTPResponseSerializer serializer]; } return self; } -+ (void)initialize { - if (self == [SWGApiClient class]) { - queuedRequests = [[NSMutableSet alloc] init]; - // initialize URL cache - [self configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024]; - } -} +#pragma mark - Task Methods -#pragma mark - Setter Methods +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { -+ (void) setOfflineState:(BOOL) state { - offlineState = state; -} - -+ (void) setCacheEnabled:(BOOL)enabled { - cacheEnabled = enabled; -} - -+(void) setReachabilityStatus:(AFNetworkReachabilityStatus)status { - reachabilityStatus = status; -} - -- (void)setHeaderValue:(NSString*) value forKey:(NSString*) forKey { - [self.requestSerializer setValue:value forHTTPHeaderField:forKey]; -} - -- (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { - [super setRequestSerializer:requestSerializer]; - requestSerializer.timeoutInterval = self.timeoutInterval; -} - -#pragma mark - Cache Methods - -+(void)clearCache { - [[NSURLCache sharedURLCache] removeAllCachedResponses]; -} - -+(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize - diskSize: (unsigned long) diskSize { - NSAssert(memorySize > 0, @"invalid in-memory cache size"); - NSAssert(diskSize >= 0, @"invalid disk cache size"); - - NSURLCache *cache = - [[NSURLCache alloc] - initWithMemoryCapacity:memorySize - diskCapacity:diskSize - diskPath:@"swagger_url_cache"]; - - [NSURLCache setSharedURLCache:cache]; -} - -#pragma mark - Request Methods - -+(NSUInteger)requestQueueSize { - return [queuedRequests count]; -} - -+(NSNumber*) nextRequestId { - @synchronized(self) { - return @(++requestId); - } -} - -+(NSNumber*) queueRequest { - NSNumber* requestId = [[self class] nextRequestId]; - SWGDebugLog(@"added %@ to request queue", requestId); - [queuedRequests addObject:requestId]; - return requestId; -} - -+(void) cancelRequest:(NSNumber*)requestId { - [queuedRequests removeObject:requestId]; -} - --(Boolean) executeRequestWithId:(NSNumber*) requestId { - NSSet* matchingItems = [queuedRequests objectsPassingTest:^BOOL(id obj, BOOL *stop) { - return [obj intValue] == [requestId intValue]; - }]; - - if (matchingItems.count == 1) { - SWGDebugLog(@"removed request id %@", requestId); - [queuedRequests removeObject:requestId]; - return YES; - } else { - return NO; - } -} - -#pragma mark - Reachability Methods - -+(AFNetworkReachabilityStatus) getReachabilityStatus { - return reachabilityStatus; -} - -+(BOOL) getOfflineState { - return offlineState; -} - -+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock { - reachabilityChangeBlock = changeBlock; -} - -- (void) configureCacheReachibility { - [self.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { - reachabilityStatus = status; - SWGDebugLog(@"reachability changed to %@",AFStringFromNetworkReachabilityStatus(status)); - [SWGApiClient setOfflineState:status == AFNetworkReachabilityStatusUnknown || status == AFNetworkReachabilityStatusNotReachable]; - - // call the reachability block, if configured - if (reachabilityChangeBlock != nil) { - reachabilityChangeBlock(status); - } - }]; - - [self.reachabilityManager startMonitoring]; -} - -#pragma mark - Operation Methods - -- (void) operationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { SWGDebugLogResponse(response, responseObject,request,error); - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); if(!error) { completionBlock(responseObject, nil); return; @@ -204,20 +104,17 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - [op resume]; + + return task; } -- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request - requestId: (NSNumber *) requestId - completionBlock: (void (^)(id, NSError *))completionBlock { - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask* op = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![strongSelf executeRequestWithId:requestId]) { - return; - } - strongSelf.HTTPResponseHeaders = SWG__headerFieldsForResponse(response); +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { SWGDebugLogResponse(response, responseObject,request,error); + if(error) { NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; if (responseObject) { @@ -225,9 +122,11 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { } NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); + return; } - NSString *directory = [self configuration].tempFolderPath ?: NSTemporaryDirectory(); - NSString * filename = SWG__fileNameForResponse(response); + + NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = SWG__fileNameForResponse(response); NSString *filepath = [directory stringByAppendingPathComponent:filename]; NSURL *file = [NSURL fileURLWithPath:filepath]; @@ -236,53 +135,37 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(file, nil); }]; - [op resume]; + + return task; } -#pragma mark - Perform Request Methods +#pragma mark - Perform Request Methods --(NSNumber*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock { - // setting request serializer - if ([requestContentType isEqualToString:@"application/json"]) { - self.requestSerializer = [SWGJSONRequestSerializer serializer]; - } - else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) { - self.requestSerializer = [AFHTTPRequestSerializer serializer]; - } - else if ([requestContentType isEqualToString:@"multipart/form-data"]) { - self.requestSerializer = [AFHTTPRequestSerializer serializer]; - } - else { - self.requestSerializer = [AFHTTPRequestSerializer serializer]; - NSAssert(NO, @"Unsupported request type %@", requestContentType); - } +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { - // setting response serializer - if ([responseContentType isEqualToString:@"application/json"]) { - self.responseSerializer = [SWGJSONResponseSerializer serializer]; - } else { - self.responseSerializer = [AFHTTPResponseSerializer serializer]; - } + AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; + + __weak id sanitizer = self.sanitizer; // sanitize parameters - pathParams = [self.sanitizer sanitizeForSerialization:pathParams]; - queryParams = [self.sanitizer sanitizeForSerialization:queryParams]; - headerParams = [self.sanitizer sanitizeForSerialization:headerParams]; - formParams = [self.sanitizer sanitizeForSerialization:formParams]; + pathParams = [sanitizer sanitizeForSerialization:pathParams]; + queryParams = [sanitizer sanitizeForSerialization:queryParams]; + headerParams = [sanitizer sanitizeForSerialization:headerParams]; + formParams = [sanitizer sanitizeForSerialization:formParams]; if(![body isKindOfClass:[NSData class]]) { - body = [self.sanitizer sanitizeForSerialization:body]; + body = [sanitizer sanitizeForSerialization:body]; } // auth setting @@ -295,22 +178,19 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; }]; - NSMutableURLRequest * request = nil; - NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; if ([pathWithQueryParams hasPrefix:@"/"]) { pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; } NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; + + NSError *requestCreateError = nil; + NSMutableURLRequest * request = nil; if (files.count > 0) { - __weak __typeof(self)weakSelf = self; - request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" - URLString:urlString - parameters:nil - constructingBodyWithBlock:^(id formData) { + request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSString *objString = [weakSelf.sanitizer parameterToString:obj]; + NSString *objString = [sanitizer parameterToString:obj]; NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; [formData appendPartWithFormData:data name:key]; }]; @@ -318,76 +198,73 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSURL *filePath = (NSURL *)obj; [formData appendPartWithFileURL:filePath name:key error:nil]; }]; - } error:nil]; + } error:&requestCreateError]; } else { if (formParams) { - request = [self.requestSerializer requestWithMethod:method - URLString:urlString - parameters:formParams - error:nil]; + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; } if (body) { - request = [self.requestSerializer requestWithMethod:method - URLString:urlString - parameters:body - error:nil]; + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; } } - - // request cache - BOOL hasHeaderParams = [headerParams count] > 0; - if (offlineState) { - SWGDebugLog(@"%@ cache forced", resourcePath); - [request setCachePolicy:NSURLRequestReturnCacheDataDontLoad]; - } - else if(!hasHeaderParams && [method isEqualToString:@"GET"] && cacheEnabled) { - SWGDebugLog(@"%@ cache enabled", resourcePath); - [request setCachePolicy:NSURLRequestUseProtocolCachePolicy]; - } - else { - SWGDebugLog(@"%@ cache disabled", resourcePath); - [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; + if(!request) { + completionBlock(nil, requestCreateError); + return nil; } - if (hasHeaderParams){ + if ([headerParams count] > 0){ for(NSString * key in [headerParams keyEnumerator]){ [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; } } - [self.requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; + [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; [self postProcessRequest:request]; - NSNumber* requestId = [SWGApiClient queueRequest]; - if ([responseType isEqualToString:@"NSURL*"] || [responseType isEqualToString:@"NSURL"]) { - [self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + + NSURLSessionTask *task = nil; + + if ([self.downloadTaskResponseTypes containsObject:responseType]) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { completionBlock(data, error); }]; - } - else { - [self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) { + } else { + __weak typeof(self) weakSelf = self; + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { NSError * serializationError; - id response = [self.responseDeserializer deserialize:data class:responseType error:&serializationError]; + id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; + if(!response && !error){ error = serializationError; } completionBlock(response, error); }]; } - return requestId; + + [task resume]; + + return task; +} + +-(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { + AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; + if(!serializer) { + NSAssert(NO, @"Unsupported request content type %@", requestContentType); + serializer = [AFHTTPRequestSerializer serializer]; + } + serializer.timeoutInterval = self.timeoutInterval; + return serializer; } //Added for easier override to modify request -(void)postProcessRequest:(NSMutableURLRequest *)request { - // Always disable cookies! - [request setHTTPShouldHandleCookies:NO]; + } #pragma mark - -- (NSString*) pathWithQueryParamsToString:(NSString*) path - queryParams:(NSDictionary*) queryParams { +- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { if(queryParams.count == 0) { return path; } @@ -445,9 +322,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { /** * Update header and query params based on authentication settings */ -- (void) updateHeaderParams:(NSDictionary *__autoreleasing *)headers - queryParams:(NSDictionary *__autoreleasing *)querys - WithAuthSettings:(NSArray *)authSettings { +- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)querys WithAuthSettings:(NSArray *)authSettings { if ([authSettings count] == 0) { return; @@ -456,9 +331,10 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - NSDictionary* configurationAuthSettings = [[self configuration] authSettings]; + id config = self.configuration; for (NSString *auth in authSettings) { - NSDictionary *authSetting = configurationAuthSettings[auth]; + NSDictionary *authSetting = config.authSettings[auth]; + if(!authSetting) { // auth setting is set only if the key is non-empty continue; } @@ -476,14 +352,14 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { *querys = [NSDictionary dictionaryWithDictionary:querysWithAuth]; } -- (AFSecurityPolicy *) customSecurityPolicy { +- (AFSecurityPolicy *) createSecurityPolicy { AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - SWGConfiguration *config = [self configuration]; + id config = self.configuration; if (config.sslCaCert) { NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:@[certData]]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; } if (config.verifySSL) { @@ -497,8 +373,4 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { return securityPolicy; } -- (SWGConfiguration*) configuration { - return [SWGConfiguration sharedConfig]; -} - @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h index b1bbd4bc7f6..a22ceb78391 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h @@ -1,182 +1,89 @@ #import -#import "SWGApiClient.h" -#import "SWGLogger.h" + +@class SWGLogger; /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ -@class SWGApiClient; -@interface SWGConfiguration : NSObject +static NSString * const kSWGAPIVersion = @"1.0.0"; + +@protocol SWGConfiguration /** - * Default api logger + * Api logger */ -@property (nonatomic, strong) SWGLogger * logger; +@property (readonly, nonatomic) SWGLogger *logger; /** - * Default api client + * Base url */ -@property (nonatomic) SWGApiClient *apiClient; - -/** - * Default base url - */ -@property (nonatomic) NSString *host; +@property (readonly, nonatomic) NSString *host; /** * Api key values for Api Key type Authentication - * - * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKey; +@property (readonly, nonatomic) NSDictionary *apiKey; /** * Api key prefix values to be prepend to the respective api key - * - * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. */ -@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; /** * Username for HTTP Basic Authentication */ - @property (nonatomic) NSString *username; +@property (readonly, nonatomic) NSString *username; /** * Password for HTTP Basic Authentication */ -@property (nonatomic) NSString *password; +@property (readonly, nonatomic) NSString *password; /** * Access token for OAuth */ -@property (nonatomic) NSString *accessToken; +@property (readonly, nonatomic) NSString *accessToken; /** * Temp folder for file download */ -@property (nonatomic) NSString *tempFolderPath; +@property (readonly, nonatomic) NSString *tempFolderPath; /** * Debug switch, default false */ -@property (nonatomic) BOOL debug; - -/** - * Gets configuration singleton instance - */ -+ (instancetype) sharedConfig; +@property (readonly, nonatomic) BOOL debug; /** * SSL/TLS verification * Set this to NO to skip verifying SSL certificate when calling API from https server */ -@property (nonatomic) BOOL verifySSL; +@property (readonly, nonatomic) BOOL verifySSL; /** * SSL/TLS verification * Set this to customize the certificate file to verify the peer */ -@property (nonatomic) NSString *sslCaCert; +@property (readonly, nonatomic) NSString *sslCaCert; /** - * Sets API key - * - * To remove a apiKey for an identifier, just set the apiKey to nil. - * - * @param apiKey API key or token. - * @param identifier API key identifier (authentication schema). - * + * Authentication Settings */ -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; - -/** - * Removes api key - * - * @param identifier API key identifier. - */ -- (void) removeApiKey:(NSString *)identifier; - -/** - * Sets the prefix for API key - * - * @param apiKeyPrefix API key prefix. - * @param identifier API key identifier. - */ -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; - -/** - * Removes api key prefix - * - * @param identifier API key identifier. - */ -- (void) removeApiKeyPrefix:(NSString *)identifier; - -/** - * Gets API key (with prefix if set) - */ -- (NSString *) getApiKeyWithPrefix:(NSString *) key; - -/** - * Gets Basic Auth token - */ -- (NSString *) getBasicAuthToken; - -/** - * Gets OAuth access token - */ -- (NSString *) getAccessToken; - -/** - * Gets Authentication Settings - */ -- (NSDictionary *) authSettings; +@property (readonly, nonatomic) NSDictionary *authSettings; /** * Default headers for all services */ @property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; -/** -* Removes header from defaultHeaders -* -* @param Header name. -*/ --(void) removeDefaultHeaderForKey:(NSString*)key; - -/** -* Sets the header for key -* -* @param value Value for header name -* @param key Header name -*/ --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; - -/** -* @param Header key name. -*/ --(NSString*) defaultHeaderForKey:(NSString*)key; - -@end +@end \ No newline at end of file diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h index dbfe377577e..1435ac50c25 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -2,28 +2,17 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGJSONRequestSerializer : AFJSONRequestSerializer @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h index ecf02f24322..f4ab3b37e4c 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.h @@ -1,29 +1,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + #ifndef SWGDebugLogResponse #define SWGDebugLogResponse(response, responseObject,request, error) [[SWGLogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; #endif diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m index 322ae9678d7..2a96e5ec54d 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGLogger.m @@ -17,8 +17,7 @@ #pragma mark - Log Methods -- (void)debugLog:(NSString *)method - message:(NSString *)format, ... { +- (void)debugLog:(NSString *)method message:(NSString *)format, ... { if (!self.isEnabled) { return; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h index 51443974b74..9d6d48886ef 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.h @@ -2,29 +2,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGObject : JSONModel @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m index 8085c404f7e..db970d34669 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGObject.m @@ -2,6 +2,35 @@ @implementation SWGObject +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + /** * Gets the string presentation of the object. * This method will be called when logging model object using `NSLog`. diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h index ec702737c97..06830d5aede 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.h @@ -1,29 +1,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @interface SWGQueryParamCollection : NSObject @property(nonatomic, readonly) NSArray* values; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m index 83303045185..9aa8a091762 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGQueryParamCollection.m @@ -5,11 +5,15 @@ @synthesize values = _values; @synthesize format = _format; -- (id) initWithValuesAndFormat: (NSArray*) values - format: (NSString*) format { - _values = values; - _format = format; +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + self = [super init]; + if (self) { + _values = values; + _format = format; + } + return self; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h index c9fa7e99f1d..68ea1b720f8 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.h @@ -1,29 +1,18 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + /** * A key for deserialization ErrorDomain */ @@ -50,7 +39,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; * Deserializes the given data to Objective-C object. * * @param data The data will be deserialized. - * @param class The type of objective-c object. + * @param className The type of objective-c object. * @param error The error */ - (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m index 6ac9f75e818..46d4b460fc7 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGResponseDeserializer.m @@ -16,6 +16,7 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; @property (nonatomic, strong) NSNumberFormatter* numberFormatter; @property (nonatomic, strong) NSArray *primitiveTypes; @property (nonatomic, strong) NSArray *basicReturnTypes; +@property (nonatomic, strong) NSArray *dataReturnTypes; @property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; @property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; @@ -33,7 +34,9 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; formatter.numberStyle = NSNumberFormatterDecimalStyle; _numberFormatter = formatter; _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; - _basicReturnTypes = @[@"NSObject", @"id", @"NSData"]; + _basicReturnTypes = @[@"NSObject", @"id"]; + _dataReturnTypes = @[@"NSData"]; + _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" options:NSRegularExpressionCaseInsensitive error:nil]; @@ -53,23 +56,36 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; #pragma mark - Deserialize methods - (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { - // return nil if data is nil or className is nil - if (!data || !className || [data isKindOfClass:[NSNull class]]) { + if (!data || !className) { return nil; } - // remove "*" from className, if ends with "*" if ([className hasSuffix:@"*"]) { className = [className substringToIndex:[className length] - 1]; } + if([self.dataReturnTypes containsObject:className]) { + return data; + } + id jsonData = nil; + if([data isKindOfClass:[NSData class]]) { + jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; + } else { + jsonData = data; + } + if(!jsonData) { + jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + } else if([jsonData isKindOfClass:[NSNull class]]) { + return nil; + } + // pure object if ([self.basicReturnTypes containsObject:className]) { - return data; + return jsonData; } // primitives if ([self.primitiveTypes containsObject:className]) { - return [self deserializePrimitiveValue:data class:className error:error]; + return [self deserializePrimitiveValue:jsonData class:className error:error]; } NSTextCheckingResult *match = nil; @@ -78,37 +94,37 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:data innerType:innerType error:error]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; } // list of primitives match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:data innerType:innerType error:error]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; } // map match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:data valueType:valueType error:error]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; } match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; if (match) { NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:data valueType:valueType error:error]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; } // model Class ModelClass = NSClassFromString(className); if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { - return [(JSONModel *) [ModelClass alloc] initWithDictionary:data error:error]; + return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; } if(error) { - *error = [self unknownResponseErrorWithExpectedType:className data:data]; + *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; } return nil; } @@ -172,7 +188,7 @@ NSInteger const SWGUnknownResponseObjectErrorCode = 143528; - (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { if ([className isEqualToString:@"NSString"]) { - return [NSString stringWithString:data]; + return [NSString stringWithFormat:@"%@",data]; } else if ([className isEqualToString:@"NSDate"]) { return [self deserializeDateValue:data error:error]; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h index f968b13c885..1ede89f6035 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h @@ -1,31 +1,22 @@ #import /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + extern NSString * SWGPercentEscapedStringFromString(NSString *string); +extern NSString * const kSWGApplicationJSONType; + @protocol SWGSanitizer /** diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m index a74f72afbe3..49ff6ed014a 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m @@ -3,6 +3,8 @@ #import "SWGQueryParamCollection.h" #import +NSString * const kSWGApplicationJSONType = @"application/json"; + NSString * SWGPercentEscapedStringFromString(NSString *string) { static NSString * const kSWGCharactersGeneralDelimitersToEncode = @":#[]@"; static NSString * const kSWGCharactersSubDelimitersToEncode = @"!$&'()*+,;="; @@ -43,8 +45,6 @@ NSString * SWGPercentEscapedStringFromString(NSString *string) { @implementation SWGSanitizer -static NSString * kApplicationJSONType = @"application/json"; - -(instancetype)init { self = [super init]; if ( !self ) { @@ -141,7 +141,7 @@ static NSString * kApplicationJSONType = @"application/json"; NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; for (NSString *string in accepts) { if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { - return kApplicationJSONType; + return kSWGApplicationJSONType; } [lowerAccepts addObject:[string lowercaseString]]; } @@ -153,12 +153,12 @@ static NSString * kApplicationJSONType = @"application/json"; */ - (NSString *) selectHeaderContentType:(NSArray *)contentTypes { if (contentTypes.count == 0) { - return kApplicationJSONType; + return kSWGApplicationJSONType; } NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; for (NSString *string in contentTypes) { if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ - return kApplicationJSONType; + return kSWGApplicationJSONType; } [lowerContentTypes addObject:[string lowercaseString]]; } diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h index d05ae2fc866..ee9a261859e 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h @@ -2,37 +2,26 @@ #import "SWGObject.h" /** -* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end +* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * -* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r -* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r +* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. */ + @protocol SWGReturn @end @interface SWGReturn : SWGObject -/* property description *_/ ' \" =end \\r\\n \\n \\r [optional] +/* property description *_/ ' \" =end -- \\r\\n \\n \\r [optional] */ @property(nonatomic) NSNumber* _return; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m index 90ad222590a..1858e6b9930 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"return": @"_return" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_return": @"return" }]; } /** diff --git a/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md b/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md index 76c62cd4fbf..aff9984217a 100644 --- a/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md +++ b/samples/client/petstore-security-test/objc/docs/SWGFakeApi.md @@ -1,28 +1,28 @@ # SWGFakeApi -All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r* +All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testCodeInjectEndRnNR**](SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r +[**testCodeInjectEndRnNR**](SWGFakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r # **testCodeInjectEndRnNR** ```objc --(NSNumber*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR +-(NSURLSessionTask*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR completionHandler: (void (^)(NSError* error)) handler; ``` -To test code injection *_/ ' \" =end \\r\\n \\n \\r +To test code injection *_/ ' \" =end -- \\r\\n \\n \\r ### Example ```objc -NSString* testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional) +NSString* testCodeInjectEndRnNR = @"testCodeInjectEndRnNR_example"; // To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) SWGFakeApi*apiInstance = [[SWGFakeApi alloc] init]; -// To test code injection *_/ ' \" =end \\r\\n \\n \\r +// To test code injection *_/ ' \" =end -- \\r\\n \\n \\r [apiInstance testCodeInjectEndRnNRWithTestCodeInjectEndRnNR:testCodeInjectEndRnNR completionHandler: ^(NSError* error) { if (error) { @@ -35,7 +35,7 @@ SWGFakeApi*apiInstance = [[SWGFakeApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **testCodeInjectEndRnNR** | **NSString***| To test code injection *_/ ' \" =end \\r\\n \\n \\r | [optional] + **testCodeInjectEndRnNR** | **NSString***| To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | [optional] ### Return type @@ -47,12 +47,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json, */ ' =end - - - - **Accept**: application/json, */ ' =end - - + - **Content-Type**: application/json, *_/ ' =end -- + - **Accept**: application/json, *_/ ' =end -- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore-security-test/objc/docs/SWGReturn.md b/samples/client/petstore-security-test/objc/docs/SWGReturn.md index fc4fc036c84..a604021dd6e 100644 --- a/samples/client/petstore-security-test/objc/docs/SWGReturn.md +++ b/samples/client/petstore-security-test/objc/docs/SWGReturn.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_return** | **NSNumber*** | property description *_/ ' \" =end \\r\\n \\n \\r | [optional] +**_return** | **NSNumber*** | property description *_/ ' \" =end -- \\r\\n \\n \\r | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php index 4c029f982ae..6bc8c02024d 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php @@ -65,12 +65,12 @@ class ApiException extends Exception /** * Constructor * - * @param string $message Error message - * @param int $code HTTP status code - * @param string $responseHeaders HTTP response header - * @param mixed $responseBody HTTP body of the server response either as Json or string + * @param string $message Error message + * @param int $code HTTP status code + * @param string[] $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -80,7 +80,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string HTTP response header + * @return string[] HTTP response headers */ public function getResponseHeaders() { @@ -90,7 +90,7 @@ class ApiException extends Exception /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as Json or string + * @return mixed HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/samples/client/petstore-security-test/python/petstore_api/api_client.py b/samples/client/petstore-security-test/python/petstore_api/api_client.py index f8b73bc1463..95265e49715 100644 --- a/samples/client/petstore-security-test/python/petstore_api/api_client.py +++ b/samples/client/petstore-security-test/python/petstore_api/api_client.py @@ -116,7 +116,7 @@ class ApiClient(object): collection_formats) for k, v in path_params: resource_path = resource_path.replace( - '{%s}' % k, quote(str(v), safe="")) + '{%s}' % k, quote(str(v), safe='')) # no safe chars, encode everything # query parameters if query_params: diff --git a/samples/client/petstore-security-test/python/petstore_api/configuration.py b/samples/client/petstore-security-test/python/petstore_api/configuration.py index 55b00220da5..99212e2f180 100644 --- a/samples/client/petstore-security-test/python/petstore_api/configuration.py +++ b/samples/client/petstore-security-test/python/petstore_api/configuration.py @@ -89,6 +89,9 @@ class Configuration(object): # client key file self.key_file = None + # Proxy URL + self.proxy = None + @property def logger_file(self): """ diff --git a/samples/client/petstore-security-test/python/petstore_api/rest.py b/samples/client/petstore-security-test/python/petstore_api/rest.py index 2c54f4ceae8..513bbb5aac7 100644 --- a/samples/client/petstore-security-test/python/petstore_api/rest.py +++ b/samples/client/petstore-security-test/python/petstore_api/rest.py @@ -85,10 +85,33 @@ class RESTClientObject(object): # key file key_file = Configuration().key_file + # proxy + proxy = Configuration().proxy + + # https pool manager + if proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file, + proxy_url=proxy + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file + ) + # https pool manager self.pool_manager = urllib3.PoolManager( num_pools=pools_size, - maxsize=maxsize, cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=cert_file, diff --git a/samples/client/petstore-security-test/python/requirements.txt b/samples/client/petstore-security-test/python/requirements.txt index f00e08fa339..bafdc07532f 100644 --- a/samples/client/petstore-security-test/python/requirements.txt +++ b/samples/client/petstore-security-test/python/requirements.txt @@ -1,5 +1,5 @@ certifi >= 14.05.14 -six == 1.8.0 +six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb b/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb index a871ed7979e..af7258be6ed 100644 --- a/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore-security-test/ruby/spec/api_client_spec.rb @@ -179,6 +179,7 @@ describe Petstore::ApiClient do expect(api_client.json_mime?('')).to eq false expect(api_client.json_mime?('application/json')).to eq true + expect(api_client.json_mime?('application/api.vnd+json')).to eq true expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true expect(api_client.json_mime?('APPLICATION/JSON')).to eq true diff --git a/samples/client/petstore-security-test/typescript-angular2/.gitignore b/samples/client/petstore-security-test/typescript-angular2/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore-security-test/typescript-angular2/.gitignore +++ b/samples/client/petstore-security-test/typescript-angular2/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts b/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts index 1cbd4d97048..390fddb18ee 100644 --- a/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts +++ b/samples/client/petstore-security-test/typescript-angular2/api/FakeApi.ts @@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab import 'rxjs/add/operator/map'; import * as models from '../model/models'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -40,21 +40,6 @@ export class FakeApi { } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * @@ -84,8 +69,6 @@ export class FakeApi { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let formParams = new URLSearchParams(); - - // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -97,13 +80,11 @@ export class FakeApi { 'application/json', '*_/ =end -- ' ]; - - + headers.set('Content-Type', 'application/x-www-form-urlencoded'); - if (test code inject * ' " =end rn n r !== undefined) { - formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); + formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); } let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -112,10 +93,10 @@ export class FakeApi { body: formParams.toString(), search: queryParameters }); - + // https://github.com/swagger-api/swagger-codegen/issues/4037 if (extraHttpRequestParams) { - requestOptions = this.extendObj(requestOptions, extraHttpRequestParams); + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } return this.http.request(path, requestOptions); diff --git a/samples/client/petstore-security-test/typescript-angular2/api/api.ts b/samples/client/petstore-security-test/typescript-angular2/api/api.ts index cb32320cbf5..f518944fad1 100644 --- a/samples/client/petstore-security-test/typescript-angular2/api/api.ts +++ b/samples/client/petstore-security-test/typescript-angular2/api/api.ts @@ -1 +1,2 @@ export * from './fake.service'; +export const APIS = [ FakeService, ]; diff --git a/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts b/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts index 9db5a13ba0f..48198a4be00 100644 --- a/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts +++ b/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts @@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab import '../rxjs-operators'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; /* tslint:disable:no-unused-variable member-ordering */ @@ -56,6 +56,20 @@ export class FakeService { return objA; } + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (let consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + /** * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * @@ -79,44 +93,43 @@ export class FakeService { * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r */ public testCodeInjectEndRnNRWithHttpInfo(test code inject * ' " =end rn n r?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/fake`; + const path = this.basePath + '/fake'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - let formParams = new URLSearchParams(); - - // to determine the Content-Type header let consumes: string[] = [ 'application/json', '*_/ =end -- ' ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; // to determine the Accept header let produces: string[] = [ 'application/json', '*_/ =end -- ' ]; - + - headers.set('Content-Type', 'application/x-www-form-urlencoded'); - - if (test code inject * ' " =end rn n r !== undefined) { - formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); + formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: formParams.toString(), + body: formParams, search: queryParameters }); - + // https://github.com/swagger-api/swagger-codegen/issues/4037 if (extraHttpRequestParams) { - requestOptions = this.extendObj(requestOptions, extraHttpRequestParams); + requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } return this.http.request(path, requestOptions); diff --git a/samples/client/petstore-security-test/typescript-angular2/model/modelReturn.ts b/samples/client/petstore-security-test/typescript-angular2/model/modelReturn.ts new file mode 100644 index 00000000000..170661be61a --- /dev/null +++ b/samples/client/petstore-security-test/typescript-angular2/model/modelReturn.ts @@ -0,0 +1,24 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + + +/** + * Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r + */ +export interface ModelReturn { + /** + * property description *_/ ' \" =end -- \\r\\n \\n \\r + */ + return?: number; + +} diff --git a/samples/client/petstore-security-test/typescript-angular2/variables.ts b/samples/client/petstore-security-test/typescript-angular2/variables.ts index 27b987e9b23..944e688f1b1 100644 --- a/samples/client/petstore-security-test/typescript-angular2/variables.ts +++ b/samples/client/petstore-security-test/typescript-angular2/variables.ts @@ -1,3 +1,9 @@ import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new OpaqueToken('basePath'); \ No newline at end of file +export const BASE_PATH = new OpaqueToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} \ No newline at end of file diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 3c9dcf27af0..576d718f1f1 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -126,7 +126,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index a9bff313266..5ba936a5701 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -145,7 +145,7 @@ - 1.5.9 + 1.5.12 2.3.1 4.8.1 1.0.0 diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index c92f468b12b..0b51769d921 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -126,7 +126,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java index 9772342710a..557c97a958f 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java @@ -66,7 +66,7 @@ public class PetApi { Object postBody = body; // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + String path = "/pet"; // query params List queryParams = new ArrayList(); @@ -188,7 +188,7 @@ public class PetApi { } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); @@ -310,7 +310,7 @@ public class PetApi { Object postBody = null; // create path and map variables - String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String path = "/pet/findByStatus"; // query params List queryParams = new ArrayList(); @@ -430,7 +430,7 @@ public class PetApi { Object postBody = null; // create path and map variables - String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String path = "/pet/findByTags"; // query params List queryParams = new ArrayList(); @@ -555,7 +555,7 @@ public class PetApi { } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); @@ -679,7 +679,7 @@ public class PetApi { Object postBody = body; // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + String path = "/pet"; // query params List queryParams = new ArrayList(); @@ -802,7 +802,7 @@ public class PetApi { } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); @@ -948,7 +948,7 @@ formParams.put("status", ApiInvoker.parameterToString(status)); } // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params List queryParams = new ArrayList(); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java index 1aac5e84fa5..16cd37138fe 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java @@ -71,7 +71,7 @@ public class StoreApi { } // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params List queryParams = new ArrayList(); @@ -190,7 +190,7 @@ public class StoreApi { Object postBody = null; // create path and map variables - String path = "/store/inventory".replaceAll("\\{format\\}","json"); + String path = "/store/inventory"; // query params List queryParams = new ArrayList(); @@ -313,7 +313,7 @@ public class StoreApi { } // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params List queryParams = new ArrayList(); @@ -437,7 +437,7 @@ public class StoreApi { Object postBody = body; // create path and map variables - String path = "/store/order".replaceAll("\\{format\\}","json"); + String path = "/store/order"; // query params List queryParams = new ArrayList(); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java index 0857956f749..83bdcbd8305 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java @@ -66,7 +66,7 @@ public class UserApi { Object postBody = body; // create path and map variables - String path = "/user".replaceAll("\\{format\\}","json"); + String path = "/user"; // query params List queryParams = new ArrayList(); @@ -180,7 +180,7 @@ public class UserApi { Object postBody = body; // create path and map variables - String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String path = "/user/createWithArray"; // query params List queryParams = new ArrayList(); @@ -294,7 +294,7 @@ public class UserApi { Object postBody = body; // create path and map variables - String path = "/user/createWithList".replaceAll("\\{format\\}","json"); + String path = "/user/createWithList"; // query params List queryParams = new ArrayList(); @@ -413,7 +413,7 @@ public class UserApi { } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params List queryParams = new ArrayList(); @@ -538,7 +538,7 @@ public class UserApi { } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params List queryParams = new ArrayList(); @@ -663,7 +663,7 @@ public class UserApi { Object postBody = null; // create path and map variables - String path = "/user/login".replaceAll("\\{format\\}","json"); + String path = "/user/login"; // query params List queryParams = new ArrayList(); @@ -784,7 +784,7 @@ public class UserApi { Object postBody = null; // create path and map variables - String path = "/user/logout".replaceAll("\\{format\\}","json"); + String path = "/user/logout"; // query params List queryParams = new ArrayList(); @@ -904,7 +904,7 @@ public class UserApi { } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params List queryParams = new ArrayList(); diff --git a/samples/client/petstore/bash/Dockerfile b/samples/client/petstore/bash/Dockerfile index ed2aed705d3..2d4a88cdfd0 100644 --- a/samples/client/petstore/bash/Dockerfile +++ b/samples/client/petstore/bash/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get install -y bash-completion zsh curl cowsay git vim bsdmainutils ADD petstore-cli /usr/bin/petstore-cli ADD _petstore-cli /usr/local/share/zsh/site-functions/_petstore-cli ADD petstore-cli.bash-completion /etc/bash-completion.d/petstore-cli - +RUN chmod 755 /usr/bin/petstore-cli # # Install oh-my-zsh diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index fd6809257f4..2d9f4ef773d 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -10,7 +10,7 @@ # ! # ! Based on: https://github.com/Valodim/zsh-curl-completion/blob/master/_curl # ! -# ! Generated on: 2017-03-13T18:03:04.084+01:00 +# ! Generated on: 2017-03-13T20:38:05.746+01:00 # ! # ! # ! Installation: diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 0f7552a3991..19e64fa6e89 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -8,7 +8,7 @@ # ! swagger-codegen (https://github.com/swagger-api/swagger-codegen) # ! FROM SWAGGER SPECIFICATION IN JSON. # ! -# ! Generated on: 2017-03-13T18:03:04.084+01:00 +# ! Generated on: 2017-03-13T20:38:05.746+01:00 # ! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -237,7 +237,7 @@ declare -A body_parameters ## # These arguments will be directly passed to cURL -curl_arguments="" +curl_arguments="-sS --tlsv1.2" ## # The host for making the request @@ -390,7 +390,7 @@ body_parameters_to_json() { if [[ $count -lt $body_parameter_count-1 ]]; then body_json+=", " fi - count+=1 + ((count+=1)) done body_json+="}'" @@ -460,7 +460,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "multi" ]]; then local vcount=0 @@ -470,7 +470,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="&" fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "csv" ]]; then path_template+="${qparam}=" @@ -481,7 +481,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="," fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "ssv" ]]; then path_template+="${qparam}=" @@ -491,7 +491,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+=" " fi - vcount+=1 + ((vcount+=1)) done elif [[ "${operation_parameters_collection_type["${operation}:::${qparam}"]}" == "tsv" ]]; then path_template+="${qparam}=" @@ -501,7 +501,7 @@ validate_request_parameters() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then path_template+="\t" fi - vcount+=1 + ((vcount+=1)) done else echo -e "" @@ -514,7 +514,7 @@ validate_request_parameters() { if [[ $count -lt $query_parameter_count-1 ]]; then path_template+="&" fi - count+=1 + ((count+=1)) done } @@ -582,7 +582,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'mutli' collections i.e. param=value1¶m=value2&... @@ -595,7 +595,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="&" fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'csv' collections i.e. param=value1,value2,... @@ -609,7 +609,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="," fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'ssv' collections i.e. param="value1 value2 ..." @@ -623,7 +623,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+=" " fi - vcount+=1 + ((vcount+=1)) done # # Append parameters specified as 'tsv' collections i.e. param="value1\tvalue2\t..." @@ -637,7 +637,7 @@ build_request_path() { if [[ $vcount -lt ${#parameter_values[@]}-1 ]]; then parameter_value+="\t" fi - vcount+=1 + ((vcount+=1)) done fi @@ -649,8 +649,7 @@ build_request_path() { query_request_part+="&" fi - count+=1 - + ((count+=1)) done diff --git a/samples/client/petstore/bash/petstore-cli.bash-completion b/samples/client/petstore/bash/petstore-cli.bash-completion index d1f27f1ecfb..ba5e11c8083 100644 --- a/samples/client/petstore/bash/petstore-cli.bash-completion +++ b/samples/client/petstore/bash/petstore-cli.bash-completion @@ -8,7 +8,7 @@ # ! swagger-codegen (https://github.com/swagger-api/swagger-codegen) # ! FROM SWAGGER SPECIFICATION IN JSON. # ! -# ! Generated on: 2017-03-13T18:03:04.084+01:00 +# ! Generated on: 2017-03-13T20:38:05.746+01:00 # ! # ! # ! System wide installation: diff --git a/samples/client/petstore/bash/tests/petstore_test.sh b/samples/client/petstore/bash/tests/petstore_test.sh index 139679eb3ee..eb9b2291a49 100644 --- a/samples/client/petstore/bash/tests/petstore_test.sh +++ b/samples/client/petstore/bash/tests/petstore_test.sh @@ -22,6 +22,18 @@ export PETSTORE_HOST="http://petstore.swagger.io" [[ "$output" =~ "Error: Request's content-type not specified!" ]] } +@test "addPet abbreviated content type" { + run bash $PETSTORE_CLI -ct json -ac xml --host $PETSTORE_HOST \ + addPet id:=123321 name==lucky status==available --dry-run + [[ "$output" =~ "Content-type: application/json" ]] +} + +@test "addPet unabbreviated content type" { + run bash $PETSTORE_CLI -ct userdefined/custom -ac xml --host $PETSTORE_HOST \ + addPet id:=123321 name==lucky status==available --dry-run + [[ "$output" =~ "Content-type: userdefined/custom" ]] +} + @test "fakeOperation invalid operation name" { run bash \ -c "bash $PETSTORE_CLI --host http://petstore.swagger.io fakeOperation" @@ -46,8 +58,11 @@ export PETSTORE_HOST="http://petstore.swagger.io" [[ ! "$output" =~ "-H \"api_key:" ]] } - - +@test "findPetsByStatus has default cURL parameters" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus status=s1 --dry-run" + [[ ! "$output" =~ " -Ss " ]] +} @test "findPetsByStatus too few values" { run bash \ @@ -97,6 +112,3 @@ export PETSTORE_HOST="http://petstore.swagger.io" bash $PETSTORE_CLI -ct json -ac xml addPet -" [[ "$output" =~ "37567" ]] } - - - diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj index 96c1cf85fc2..845aa55b526 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj @@ -24,28 +24,6 @@ ([optional-params] (:data (add-pet-with-http-info optional-params)))) -(defn add-pet-using-byte-array-with-http-info - "Fake endpoint to test byte array in body parameter for adding a new pet to the store - " - ([] (add-pet-using-byte-array-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/pet?testing_byte_array=true" :post - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types ["application/json" "application/xml"] - :accepts ["application/json" "application/xml"] - :auth-names ["petstore_auth"]}))) - -(defn add-pet-using-byte-array - "Fake endpoint to test byte array in body parameter for adding a new pet to the store - " - ([] (add-pet-using-byte-array nil)) - ([optional-params] - (:data (add-pet-using-byte-array-with-http-info optional-params)))) - (defn delete-pet-with-http-info "Deletes a pet " @@ -120,7 +98,7 @@ :form-params {} :content-types [] :accepts ["application/json" "application/xml"] - :auth-names ["api_key" "petstore_auth"]})) + :auth-names ["petstore_auth" "api_key"]})) (defn get-pet-by-id "Find pet by ID @@ -128,44 +106,6 @@ [pet-id ] (:data (get-pet-by-id-with-http-info pet-id))) -(defn get-pet-by-id-in-object-with-http-info - "Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions" - [pet-id ] - (call-api "/pet/{petId}?response=inline_arbitrary_object" :get - {:path-params {"petId" pet-id } - :header-params {} - :query-params {} - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["api_key" "petstore_auth"]})) - -(defn get-pet-by-id-in-object - "Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions" - [pet-id ] - (:data (get-pet-by-id-in-object-with-http-info pet-id))) - -(defn pet-pet-idtesting-byte-arraytrue-get-with-http-info - "Fake endpoint to test byte array return by 'Find pet by ID' - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions" - [pet-id ] - (call-api "/pet/{petId}?testing_byte_array=true" :get - {:path-params {"petId" pet-id } - :header-params {} - :query-params {} - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["api_key" "petstore_auth"]})) - -(defn pet-pet-idtesting-byte-arraytrue-get - "Fake endpoint to test byte array return by 'Find pet by ID' - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions" - [pet-id ] - (:data (pet-pet-idtesting-byte-arraytrue-get-with-http-info pet-id))) - (defn update-pet-with-http-info "Update an existing pet " @@ -229,3 +169,4 @@ ([pet-id ] (upload-file pet-id nil)) ([pet-id optional-params] (:data (upload-file-with-http-info pet-id optional-params)))) + diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj index 1e3cc25e4a6..04d185a8086 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj @@ -21,27 +21,6 @@ [order-id ] (:data (delete-order-with-http-info order-id))) -(defn find-orders-by-status-with-http-info - "Finds orders by status - A single status value can be provided as a string" - ([] (find-orders-by-status-with-http-info nil)) - ([{:keys [status ]}] - (call-api "/store/findByStatus" :get - {:path-params {} - :header-params {} - :query-params {"status" status } - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["test_api_client_id" "test_api_client_secret"]}))) - -(defn find-orders-by-status - "Finds orders by status - A single status value can be provided as a string" - ([] (find-orders-by-status nil)) - ([optional-params] - (:data (find-orders-by-status-with-http-info optional-params)))) - (defn get-inventory-with-http-info "Returns pet inventories by status Returns a map of status codes to quantities" @@ -61,25 +40,6 @@ [] (:data (get-inventory-with-http-info))) -(defn get-inventory-in-object-with-http-info - "Fake endpoint to test arbitrary object return by 'Get inventory' - Returns an arbitrary object which is actually a map of status codes to quantities" - [] - (call-api "/store/inventory?response=arbitrary_object" :get - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["api_key"]})) - -(defn get-inventory-in-object - "Fake endpoint to test arbitrary object return by 'Get inventory' - Returns an arbitrary object which is actually a map of status codes to quantities" - [] - (:data (get-inventory-in-object-with-http-info))) - (defn get-order-by-id-with-http-info "Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions" @@ -91,7 +51,7 @@ :form-params {} :content-types [] :accepts ["application/json" "application/xml"] - :auth-names ["test_api_key_header" "test_api_key_query"]})) + :auth-names []})) (defn get-order-by-id "Find purchase order by ID @@ -112,7 +72,7 @@ :body-param body :content-types [] :accepts ["application/json" "application/xml"] - :auth-names ["test_api_client_id" "test_api_client_secret"]}))) + :auth-names []}))) (defn place-order "Place an order for a pet @@ -120,3 +80,4 @@ ([] (place-order nil)) ([optional-params] (:data (place-order-with-http-info optional-params)))) + diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj index 07b016d641a..26e3dffc624 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj @@ -167,3 +167,4 @@ ([username ] (update-user username nil)) ([username optional-params] (:data (update-user-with-http-info username optional-params)))) + diff --git a/samples/client/petstore/clojure/src/swagger_petstore/core.clj b/samples/client/petstore/clojure/src/swagger_petstore/core.clj index f01f3061e0d..20c31bb9a71 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/core.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/core.clj @@ -8,11 +8,7 @@ (java.text SimpleDateFormat))) (def auth-definitions - {"test_api_key_header" {:type :api-key :in :header :param-name "test_api_key_header"} - "api_key" {:type :api-key :in :header :param-name "api_key"} - "test_api_client_secret" {:type :api-key :in :header :param-name "x-test_api_client_secret"} - "test_api_client_id" {:type :api-key :in :header :param-name "x-test_api_client_id"} - "test_api_key_query" {:type :api-key :in :query :param-name "test_api_key_query"} + {"api_key" {:type :api-key :in :header :param-name "api_key"} "petstore_auth" {:type :oauth2}}) (def default-api-context @@ -21,11 +17,7 @@ :date-format "yyyy-MM-dd" :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" :debug false - :auths {"test_api_key_header" nil - "api_key" nil - "test_api_client_secret" nil - "test_api_client_id" nil - "test_api_key_query" nil + :auths {"api_key" nil "petstore_auth" nil}}) (def ^:dynamic *api-context* diff --git a/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj b/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj index 220afbf9d62..9c50a3d1af6 100644 --- a/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj +++ b/samples/client/petstore/clojure/test/swagger_petstore/core_test.clj @@ -11,11 +11,7 @@ :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" :debug false :auths {"api_key" nil - "petstore_auth" nil - "test_api_client_id" nil - "test_api_client_secret" nil - "test_api_key_query" nil - "test_api_key_header" nil}} + "petstore_auth" nil}} default-api-context *api-context* (with-api-context {} @@ -50,11 +46,7 @@ :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" :debug false :auths {"api_key" nil - "petstore_auth" nil - "test_api_client_id" nil - "test_api_client_secret" nil - "test_api_key_query" nil - "test_api_key_header" nil}} + "petstore_auth" nil}} default-api-context *api-context*)))) diff --git a/samples/client/petstore/cpprest/api/PetApi.cpp b/samples/client/petstore/cpprest/api/PetApi.cpp index aa9aab9d89c..d3e337d367f 100644 --- a/samples/client/petstore/cpprest/api/PetApi.cpp +++ b/samples/client/petstore/cpprest/api/PetApi.cpp @@ -518,7 +518,7 @@ pplx::task>> PetApi::findPetsByTags(std::vector else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling findPetsByTags: unsupported response type")); } return result; @@ -644,7 +644,7 @@ pplx::task> PetApi::getPetById(int64_t petId) else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getPetById: unsupported response type")); } return result; @@ -1005,7 +1005,7 @@ pplx::task> PetApi::uploadFile(int64_t petId, utili else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling uploadFile: unsupported response type")); } return result; diff --git a/samples/client/petstore/cpprest/api/StoreApi.cpp b/samples/client/petstore/cpprest/api/StoreApi.cpp index 39a3c6a39f7..40a6b8cfb71 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.cpp +++ b/samples/client/petstore/cpprest/api/StoreApi.cpp @@ -259,7 +259,7 @@ pplx::task> StoreApi::getInventory() else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getInventory: unsupported response type")); } return result; @@ -377,7 +377,7 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getOrderById: unsupported response type")); } return result; @@ -513,7 +513,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling placeOrder: unsupported response type")); } return result; diff --git a/samples/client/petstore/cpprest/api/UserApi.cpp b/samples/client/petstore/cpprest/api/UserApi.cpp index 669be733361..289295a36b5 100644 --- a/samples/client/petstore/cpprest/api/UserApi.cpp +++ b/samples/client/petstore/cpprest/api/UserApi.cpp @@ -616,7 +616,7 @@ pplx::task> UserApi::getUserByName(utility::string_t usern else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling getUserByName: unsupported response type")); } return result; @@ -751,7 +751,7 @@ pplx::task UserApi::loginUser(utility::string_t username, uti else { throw ApiException(500 - , U("error calling findPetsByStatus: unsupported response type")); + , U("error calling loginUser: unsupported response type")); } return result; diff --git a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln index fe31b214495..f51b1980c99 100644 --- a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{883BBE2E-9469-4541-A7E5-BE20571E9306}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{1289047F-8FA6-4CE8-A8F2-90F14016B774}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{883BBE2E-9469-4541-A7E5-BE20571E9306}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{883BBE2E-9469-4541-A7E5-BE20571E9306}.Debug|Any CPU.Build.0 = Debug|Any CPU -{883BBE2E-9469-4541-A7E5-BE20571E9306}.Release|Any CPU.ActiveCfg = Release|Any CPU -{883BBE2E-9469-4541-A7E5-BE20571E9306}.Release|Any CPU.Build.0 = Release|Any CPU +{1289047F-8FA6-4CE8-A8F2-90F14016B774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{1289047F-8FA6-4CE8-A8F2-90F14016B774}.Debug|Any CPU.Build.0 = Debug|Any CPU +{1289047F-8FA6-4CE8-A8F2-90F14016B774}.Release|Any CPU.ActiveCfg = Release|Any CPU +{1289047F-8FA6-4CE8-A8F2-90F14016B774}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 68f3e29b301..7030a49ad7c 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -18,7 +18,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later -The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index 502deb884fd..127c5e582be 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -390,9 +390,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -469,9 +466,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -583,9 +577,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -711,9 +702,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -811,9 +799,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter @@ -900,9 +885,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/Fake_classname_tags123Api.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/Fake_classname_tags123Api.cs index 543f94e700a..7d2814d826e 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/Fake_classname_tags123Api.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/Fake_classname_tags123Api.cs @@ -226,9 +226,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -305,9 +302,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs index d28c2e4fe2e..2ac2703b700 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs @@ -541,9 +541,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -627,9 +624,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -712,9 +706,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -792,9 +783,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -870,9 +858,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -948,9 +933,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -1025,9 +1007,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1103,9 +1082,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1180,9 +1156,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1258,9 +1231,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1335,9 +1305,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1421,9 +1388,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1509,9 +1473,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1593,9 +1554,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1676,9 +1634,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); @@ -1760,9 +1715,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs index c9c9461bc60..809f16f7239 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs @@ -347,9 +347,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -418,9 +415,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -483,9 +477,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -554,9 +545,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -629,9 +617,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -701,9 +686,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -772,9 +754,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -851,9 +830,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs index f05fc22dcca..281f116981c 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs @@ -523,9 +523,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -601,9 +598,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -678,9 +672,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -756,9 +747,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -833,9 +821,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -911,9 +896,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -988,9 +970,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1059,9 +1038,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1130,9 +1106,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1202,9 +1175,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1278,9 +1248,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1356,9 +1323,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1422,9 +1386,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1487,9 +1448,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1561,9 +1519,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { @@ -1645,9 +1600,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj index c320ab5dd49..55c4b4e9e56 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj @@ -11,7 +11,7 @@ Contact: apiteam@swagger.io Debug AnyCPU - {883BBE2E-9469-4541-A7E5-BE20571E9306} + {1289047F-8FA6-4CE8-A8F2-90F14016B774} Library Properties IO.Swagger diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln index 9fa02d64da9..6b856a0e98b 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{F1AC30CE-606F-4C16-86BF-A51318DE4D3E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{9BBF43FA-576F-4571-99A7-9BDBB93F6B91}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{F1AC30CE-606F-4C16-86BF-A51318DE4D3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{F1AC30CE-606F-4C16-86BF-A51318DE4D3E}.Debug|Any CPU.Build.0 = Debug|Any CPU -{F1AC30CE-606F-4C16-86BF-A51318DE4D3E}.Release|Any CPU.ActiveCfg = Release|Any CPU -{F1AC30CE-606F-4C16-86BF-A51318DE4D3E}.Release|Any CPU.Build.0 = Release|Any CPU +{9BBF43FA-576F-4571-99A7-9BDBB93F6B91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{9BBF43FA-576F-4571-99A7-9BDBB93F6B91}.Debug|Any CPU.Build.0 = Debug|Any CPU +{9BBF43FA-576F-4571-99A7-9BDBB93F6B91}.Release|Any CPU.ActiveCfg = Release|Any CPU +{9BBF43FA-576F-4571-99A7-9BDBB93F6B91}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index 68f3e29b301..7030a49ad7c 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -18,7 +18,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later -The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj index b0705818588..c2edf6a9091 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -74,7 +74,7 @@ Contact: apiteam@swagger.io - {F1AC30CE-606F-4C16-86BF-A51318DE4D3E} + {9BBF43FA-576F-4571-99A7-9BDBB93F6B91} IO.Swagger diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs index 502deb884fd..127c5e582be 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs @@ -390,9 +390,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -469,9 +466,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -583,9 +577,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -711,9 +702,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -811,9 +799,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter @@ -900,9 +885,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/Fake_classname_tags123Api.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/Fake_classname_tags123Api.cs index 543f94e700a..7d2814d826e 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/Fake_classname_tags123Api.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/Fake_classname_tags123Api.cs @@ -226,9 +226,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -305,9 +302,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs index d28c2e4fe2e..2ac2703b700 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs @@ -541,9 +541,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -627,9 +624,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -712,9 +706,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -792,9 +783,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -870,9 +858,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -948,9 +933,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -1025,9 +1007,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1103,9 +1082,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -1180,9 +1156,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1258,9 +1231,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -1335,9 +1305,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1421,9 +1388,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -1509,9 +1473,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1593,9 +1554,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -1676,9 +1634,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); @@ -1760,9 +1715,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs index c9c9461bc60..809f16f7239 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs @@ -347,9 +347,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -418,9 +415,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -483,9 +477,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -554,9 +545,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -629,9 +617,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -701,9 +686,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter @@ -772,9 +754,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -851,9 +830,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs index f05fc22dcca..281f116981c 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs @@ -523,9 +523,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -601,9 +598,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -678,9 +672,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -756,9 +747,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -833,9 +821,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -911,9 +896,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -988,9 +970,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1059,9 +1038,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1130,9 +1106,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1202,9 +1175,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -1278,9 +1248,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1356,9 +1323,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -1422,9 +1386,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1487,9 +1448,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -1561,9 +1519,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { @@ -1645,9 +1600,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj index 12874356c84..f3a3f2da5ac 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/IO.Swagger.csproj @@ -11,7 +11,7 @@ Contact: apiteam@swagger.io Debug AnyCPU - {F1AC30CE-606F-4C16-86BF-A51318DE4D3E} + {9BBF43FA-576F-4571-99A7-9BDBB93F6B91} Library Properties IO.Swagger diff --git a/samples/client/petstore/dart/swagger/README.md b/samples/client/petstore/dart/swagger/README.md index 487490fe02f..4ac75e49d78 100644 --- a/samples/client/petstore/dart/swagger/README.md +++ b/samples/client/petstore/dart/swagger/README.md @@ -4,7 +4,6 @@ This is a sample server Petstore server. You can find out more about Swagger at This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 -- Build date: 2017-03-13T18:03:16.229+01:00 - Build package: io.swagger.codegen.languages.DartClientCodegen ## Requirements diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as index 34b1b7a395d..55c861c7e59 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as @@ -86,7 +86,7 @@ public class PetApi extends SwaggerApi { } - headerParams["apiKey"] = toPathValue(apiKey); + headerParams["api_key"] = toPathValue(apiKey); var token:AsyncToken = getApiInvoker().invokeAPI(path, "DELETE", queryParams, null, headerParams); diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 64441ed3d92..84dce5282a1 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -100,7 +100,7 @@ Class | Method | HTTP request | Description - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - **write:pets**: modify pets in your account - **read:pets**: read your pets diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy index b1b43f81559..a223f4bbadb 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy @@ -17,7 +17,7 @@ class PetApi { String versionPath = "/api/v1" def addPet ( Pet body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet" // query params @@ -31,13 +31,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def deletePet ( Long petId, String apiKey, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}" // query params @@ -50,7 +52,9 @@ class PetApi { } - headerParams.put("apiKey", apiKey) + headerParams.put("api_key", apiKey) + + // Also still TODO: form params, body param invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "DELETE", "", @@ -58,7 +62,7 @@ class PetApi { } def findPetsByStatus ( List status, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/findByStatus" // query params @@ -74,13 +78,15 @@ class PetApi { queryParams.put("status", String.valueOf(status)) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "array", Pet.class ) } def findPetsByTags ( List tags, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/findByTags" // query params @@ -96,13 +102,15 @@ class PetApi { queryParams.put("tags", String.valueOf(tags)) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "array", Pet.class ) } def getPetById ( Long petId, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}" // query params @@ -116,13 +124,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", Pet.class ) } def updatePet ( Pet body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet" // query params @@ -136,13 +146,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "PUT", "", null ) } def updatePetWithForm ( Long petId, String name, String status, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}" // query params @@ -156,13 +168,15 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def uploadFile ( Long petId, String additionalMetadata, File file, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/pet/{petId}/uploadImage" // query params @@ -176,6 +190,8 @@ class PetApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", ModelApiResponse.class ) diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy index 51047b4834b..bf74dd21266 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy @@ -16,7 +16,7 @@ class StoreApi { String versionPath = "/api/v1" def deleteOrder ( String orderId, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/order/{orderId}" // query params @@ -30,13 +30,15 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "DELETE", "", null ) } def getInventory ( Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/inventory" // query params @@ -46,13 +48,15 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "map", Map.class ) } def getOrderById ( Long orderId, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/order/{orderId}" // query params @@ -66,13 +70,15 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", Order.class ) } def placeOrder ( Order body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/store/order" // query params @@ -86,6 +92,8 @@ class StoreApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", Order.class ) diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy index 5a8a4b2eea8..411fc55ae86 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy @@ -15,7 +15,7 @@ class UserApi { String versionPath = "/api/v1" def createUser ( User body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user" // query params @@ -29,13 +29,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def createUsersWithArrayInput ( List body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/createWithArray" // query params @@ -49,13 +51,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def createUsersWithListInput ( List body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/createWithList" // query params @@ -69,13 +73,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", null ) } def deleteUser ( String username, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/{username}" // query params @@ -89,13 +95,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "DELETE", "", null ) } def getUserByName ( String username, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/{username}" // query params @@ -109,13 +117,15 @@ class UserApi { + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", User.class ) } def loginUser ( String username, String password, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/login" // query params @@ -137,13 +147,15 @@ if (!"null".equals(String.valueOf(password))) queryParams.put("password", String.valueOf(password)) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", String.class ) } def logoutUser ( Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/logout" // query params @@ -153,13 +165,15 @@ if (!"null".equals(String.valueOf(password))) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", null ) } def updateUser ( String username, User body, Closure onSuccess, Closure onFailure) { - // create path and map variables + // create path and map path parameters (TODO) String resourcePath = "/user/{username}" // query params @@ -177,6 +191,8 @@ if (!"null".equals(String.valueOf(password))) + // Also still TODO: form params, body param + invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "PUT", "", null ) diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 02f01a201ae..a7174ec03c1 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -235,7 +235,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 8.17.0 2.0.2 2.7.5 diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java index 73511cfb0d6..2c0d42f7ccf 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java @@ -41,13 +41,13 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { + for(String authName : authNames) { RequestInterceptor auth; - if ("api_key".equals(authName)) { + if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); - } else if ("http_basic_test".equals(authName)) { + } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); - } else if ("petstore_auth".equals(authName)) { + } else if ("petstore_auth".equals(authName)) { auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java index 2f379c7fa28..d9bc1fce1fb 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d73b68b4c42..e77f70d78d3 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java index 4c40105822e..4d183d4877d 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java index 43f7719bd42..500ce3f5fc3 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java index 1f9bffa1a61..1ebeccb2e01 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index 9dc30daeb19..0f76d709e38 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java index 33a39234153..96baa57047b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/jersey1/README.md b/samples/client/petstore/java/jersey1/README.md index c824c828980..264fe34c81a 100644 --- a/samples/client/petstore/java/jersey1/README.md +++ b/samples/client/petstore/java/jersey1/README.md @@ -167,7 +167,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java index cd3bdff27d9..8c55ac11dcb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java @@ -23,6 +23,7 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.GenericType; import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.GZIPContentEncodingFilter; import com.sun.jersey.api.client.filter.LoggingFilter; import com.sun.jersey.api.client.WebResource.Builder; @@ -117,6 +118,7 @@ public class ApiClient { DefaultClientConfig conf = new DefaultClientConfig(); conf.getSingletons().add(jsonProvider); Client client = Client.create(conf); + client.addFilter(new GZIPContentEncodingFilter(false)); if (debugging) { client.addFilter(new LoggingFilter()); } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java index 04e9ce2f7d0..823149a5345 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java @@ -67,7 +67,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -135,7 +135,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -205,7 +205,7 @@ if (paramCallback != null) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index bd7c179ff1e..909c0dd718e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -64,7 +64,7 @@ public class FakeClassnameTags123Api { } // create path and map variables - String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake_classname_test"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java index 2d67203c51e..63095c199cd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/PetApi.java @@ -65,7 +65,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -106,7 +106,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -150,7 +150,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; // query params List localVarQueryParams = new ArrayList(); @@ -192,7 +192,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; // query params List localVarQueryParams = new ArrayList(); @@ -234,7 +234,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -275,7 +275,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -317,7 +317,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -365,7 +365,7 @@ if (status != null) } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java index 74bd29b88b0..48d7c58de7b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/StoreApi.java @@ -63,7 +63,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -99,7 +99,7 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; // query params List localVarQueryParams = new ArrayList(); @@ -140,7 +140,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -182,7 +182,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java index b2e57a05aaa..ce5ebd56cf3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/UserApi.java @@ -63,7 +63,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; // query params List localVarQueryParams = new ArrayList(); @@ -103,7 +103,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; // query params List localVarQueryParams = new ArrayList(); @@ -143,7 +143,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; // query params List localVarQueryParams = new ArrayList(); @@ -183,7 +183,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -225,7 +225,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -273,7 +273,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; // query params List localVarQueryParams = new ArrayList(); @@ -309,7 +309,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; // query params List localVarQueryParams = new ArrayList(); @@ -355,7 +355,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java index 2f379c7fa28..d9bc1fce1fb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d73b68b4c42..e77f70d78d3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java index 4c40105822e..4d183d4877d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java index 43f7719bd42..500ce3f5fc3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java index 1f9bffa1a61..1ebeccb2e01 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java index 9dc30daeb19..0f76d709e38 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java index 33a39234153..96baa57047b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/jersey2-java6/README.md b/samples/client/petstore/java/jersey2-java6/README.md index 115ac085d74..ea5261dff95 100644 --- a/samples/client/petstore/java/jersey2-java6/README.md +++ b/samples/client/petstore/java/jersey2-java6/README.md @@ -164,7 +164,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/jersey2-java8/README.md b/samples/client/petstore/java/jersey2-java8/README.md index 579d98c8224..78f4711d060 100644 --- a/samples/client/petstore/java/jersey2-java8/README.md +++ b/samples/client/petstore/java/jersey2-java8/README.md @@ -155,7 +155,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index 651c9d0c43f..0e370b3862f 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -175,8 +175,8 @@ Name | Type | Description | Notes **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] ### Return type diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index be696a53993..ac527b7d825 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -238,7 +238,7 @@
- 1.5.9 + 1.5.12 2.22.2 2.7.5 1.0.0 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java index 7b33209b8cc..974daecfc97 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java @@ -53,7 +53,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -121,7 +121,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -191,7 +191,7 @@ if (paramCallback != null) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java index e816fce5bad..c8f8b730ca5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/PetApi.java @@ -51,7 +51,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -92,7 +92,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -136,7 +136,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; // query params List localVarQueryParams = new ArrayList(); @@ -178,7 +178,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; // query params List localVarQueryParams = new ArrayList(); @@ -220,7 +220,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -261,7 +261,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -303,7 +303,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -351,7 +351,7 @@ if (status != null) } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java index 41bd6751871..d0a1e843743 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,7 +49,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -85,7 +85,7 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; // query params List localVarQueryParams = new ArrayList(); @@ -126,7 +126,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -168,7 +168,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java index 7602f4e2ba9..a7dced63d85 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java @@ -49,7 +49,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; // query params List localVarQueryParams = new ArrayList(); @@ -89,7 +89,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; // query params List localVarQueryParams = new ArrayList(); @@ -129,7 +129,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; // query params List localVarQueryParams = new ArrayList(); @@ -169,7 +169,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -211,7 +211,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -259,7 +259,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; // query params List localVarQueryParams = new ArrayList(); @@ -295,7 +295,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; // query params List localVarQueryParams = new ArrayList(); @@ -341,7 +341,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java index 0904135b735..cac28a9d336 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b62601da3ef..314de8aef1b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java index 4c40105822e..4d183d4877d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java index 43f7719bd42..500ce3f5fc3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java index 1f9bffa1a61..1ebeccb2e01 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java index 048db164342..296fddfe10d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java index 33a39234153..96baa57047b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/jersey2/README.md b/samples/client/petstore/java/jersey2/README.md index 6b6db099581..a1088603f3f 100644 --- a/samples/client/petstore/java/jersey2/README.md +++ b/samples/client/petstore/java/jersey2/README.md @@ -146,7 +146,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index aba408069a9..e8edd381216 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -238,7 +238,7 @@ - 1.5.9 + 1.5.12 2.22.2 2.6.4 1.0.0 diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java index 60192509f52..208886d5bed 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java @@ -53,7 +53,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -121,7 +121,7 @@ public class FakeApi { } // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); @@ -191,7 +191,7 @@ if (paramCallback != null) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index f51298081fe..08b909ba04b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -50,7 +50,7 @@ public class FakeClassnameTags123Api { } // create path and map variables - String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake_classname_test"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java index e816fce5bad..c8f8b730ca5 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/PetApi.java @@ -51,7 +51,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -92,7 +92,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -136,7 +136,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; // query params List localVarQueryParams = new ArrayList(); @@ -178,7 +178,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; // query params List localVarQueryParams = new ArrayList(); @@ -220,7 +220,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -261,7 +261,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; // query params List localVarQueryParams = new ArrayList(); @@ -303,7 +303,7 @@ public class PetApi { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params @@ -351,7 +351,7 @@ if (status != null) } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") + String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java index 41bd6751871..d0a1e843743 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/StoreApi.java @@ -49,7 +49,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -85,7 +85,7 @@ public class StoreApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; // query params List localVarQueryParams = new ArrayList(); @@ -126,7 +126,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + String localVarPath = "/store/order/{orderId}" .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); // query params @@ -168,7 +168,7 @@ public class StoreApi { } // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; // query params List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java index 7602f4e2ba9..a7dced63d85 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/UserApi.java @@ -49,7 +49,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; // query params List localVarQueryParams = new ArrayList(); @@ -89,7 +89,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; // query params List localVarQueryParams = new ArrayList(); @@ -129,7 +129,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; // query params List localVarQueryParams = new ArrayList(); @@ -169,7 +169,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -211,7 +211,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params @@ -259,7 +259,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; // query params List localVarQueryParams = new ArrayList(); @@ -295,7 +295,7 @@ public class UserApi { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; // query params List localVarQueryParams = new ArrayList(); @@ -341,7 +341,7 @@ public class UserApi { } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") + String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 8d68edf25f3..c9a29f55e0c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -70,7 +70,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java index 7c570ce933d..3e7ac59fb6f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java @@ -46,7 +46,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -64,7 +64,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index edefc3111a0..686f90117d3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2ccaee931fd..07f2d70b4a9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java index 709f80b5da5..ce44773df9a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -73,7 +73,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +96,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java index 1466f669520..240e9e6f74c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java @@ -51,7 +51,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -69,7 +69,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -87,7 +87,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -105,7 +105,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -123,7 +123,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -141,7 +141,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java index d72618f68ba..d753d3cbf94 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java @@ -37,7 +37,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java index b42e6098f4d..d562cf32dee 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java @@ -39,7 +39,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java index 48bb3d85f06..bec4fd5fd99 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java @@ -37,7 +37,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java index b441a0260cf..fd0108836b0 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java @@ -36,7 +36,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java index 26fc623e49b..3dafad9e905 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java @@ -37,7 +37,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java index a83dc31d7fc..6d032565b21 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -101,7 +101,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -124,7 +124,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java index c2c9d6b084b..ea3ee497177 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java @@ -138,7 +138,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -156,7 +156,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -174,7 +174,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -192,7 +192,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java index 2f379c7fa28..d9bc1fce1fb 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java @@ -78,7 +78,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -98,7 +98,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -116,7 +116,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -136,7 +136,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -156,7 +156,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -176,7 +176,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -194,7 +194,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -212,7 +212,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -230,7 +230,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -248,7 +248,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -266,7 +266,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -284,7 +284,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -302,7 +302,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 80d3969a03f..96810b2da2a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -34,7 +34,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java index f26335591b7..7fbe1b28404 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java @@ -77,7 +77,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +100,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d73b68b4c42..e77f70d78d3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java index 4c40105822e..4d183d4877d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java @@ -40,7 +40,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java index 6f430c1e646..9638574c47c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -42,7 +42,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -60,7 +60,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -78,7 +78,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java index 43f7719bd42..500ce3f5fc3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -37,7 +37,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java index 1f9bffa1a61..1ebeccb2e01 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java @@ -46,7 +46,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -73,7 +73,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -86,7 +86,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java index 4c58fc75f1c..6a340dcd08b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -37,7 +37,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java index 9dc30daeb19..0f76d709e38 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java @@ -84,7 +84,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -102,7 +102,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -120,7 +120,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -138,7 +138,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -156,7 +156,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -174,7 +174,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java index 01c889b26a1..099fa295f7f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java @@ -87,7 +87,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -105,7 +105,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -146,7 +146,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -169,7 +169,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -187,7 +187,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 06a19111a9d..9e60d1fec2a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -48,7 +48,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java index 33a39234153..96baa57047b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -36,7 +36,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java index 9948de4e69a..03036de0700 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java @@ -39,7 +39,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +57,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java index 8fec0f487cd..8839299f45c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java @@ -57,7 +57,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +75,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -93,7 +93,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -111,7 +111,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -129,7 +129,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -147,7 +147,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -165,7 +165,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -183,7 +183,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md index 8266ae87a9c..ce4c6f54fa4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md @@ -167,7 +167,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 1163f291fcb..116117b98a1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -206,7 +206,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.7.5 2.6.2 1.3.2 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index 8410522b276..c13f71bedc8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -75,7 +75,17 @@ public class ApiClient { verifyingSsl = true; - json = new JSON(); + + json = new JSON(this); + + /* + * Use RFC3339 format for date and datetime. + * See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 + */ + this.dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + // Always use UTC as the default time zone when dealing with date (without time). + this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + initDatetimeFormat(); // Set default User-Agent. setUserAgent("Swagger-Codegen/1.0.0/java"); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/GzipRequestInterceptor.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..cc4e4f951c1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/GzipRequestInterceptor.java @@ -0,0 +1,81 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java index 70699c70e22..29c010ba5b9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java @@ -57,12 +57,19 @@ public class FakeApi { this.apiClient = apiClient; } - /* Build call for testClientModel */ - private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testClientModel + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -175,12 +182,32 @@ public class FakeApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for testEndpointParameters */ - private com.squareup.okhttp.Call testEndpointParametersCall(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, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEndpointParameters + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEndpointParametersCall(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, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -371,12 +398,26 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for testEnumParameters */ - private com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEnumParameters + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); if (enumQueryStringArray != null) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index d19a14e08b6..ea7a08b189f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -54,12 +54,19 @@ public class FakeClassnameTags123Api { this.apiClient = apiClient; } - /* Build call for testClassname */ - private com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testClassname + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake_classname_test"; List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java index b7119add7d1..aaf615a09ec 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java @@ -56,12 +56,19 @@ public class PetApi { this.apiClient = apiClient; } - /* Build call for addPet */ - private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for addPet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -170,13 +177,21 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deletePet */ - private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deletePet + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -290,12 +305,19 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for findPetsByStatus */ - private com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByStatus + * @param status Status values that need to be considered for filter (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; List localVarQueryParams = new ArrayList(); if (status != null) @@ -410,12 +432,19 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for findPetsByTags */ - private com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByTags + * @param tags Tags to filter by (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; List localVarQueryParams = new ArrayList(); if (tags != null) @@ -530,13 +559,20 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getPetById */ - private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getPetById + * @param petId ID of pet to return (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -649,12 +685,19 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for updatePet */ - private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -763,13 +806,22 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updatePetWithForm */ - private com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePetWithForm + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -888,13 +940,22 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for uploadFile */ - private com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for uploadFile + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java index 199f2c7b109..0b9fc0c48c1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java @@ -54,13 +54,20 @@ public class StoreApi { this.apiClient = apiClient; } - /* Build call for deleteOrder */ - private com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteOrder + * @param orderId ID of the order that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -169,12 +176,18 @@ public class StoreApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getInventory */ - private com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getInventory + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; List localVarQueryParams = new ArrayList(); @@ -279,13 +292,20 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getOrderById */ - private com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getOrderById + * @param orderId ID of pet that needs to be fetched (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -398,12 +418,19 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for placeOrder */ - private com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for placeOrder + * @param body order placed for purchasing the pet (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java index ea719996a6b..a0d51095ef0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java @@ -54,12 +54,19 @@ public class UserApi { this.apiClient = apiClient; } - /* Build call for createUser */ - private com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUser + * @param body Created user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; List localVarQueryParams = new ArrayList(); @@ -168,12 +175,19 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithArrayInput */ - private com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithArrayInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; List localVarQueryParams = new ArrayList(); @@ -282,12 +296,19 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithListInput */ - private com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithListInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; List localVarQueryParams = new ArrayList(); @@ -396,13 +417,20 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deleteUser */ - private com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteUser + * @param username The name that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -511,13 +539,20 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getUserByName */ - private com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getUserByName + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -630,12 +665,20 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for loginUser */ - private com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for loginUser + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; List localVarQueryParams = new ArrayList(); if (username != null) @@ -760,12 +803,18 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for logoutUser */ - private com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for logoutUser + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; List localVarQueryParams = new ArrayList(); @@ -866,13 +915,21 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updateUser */ - private com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updateUser + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 509edd69457..2bd4852e8ea 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class AdditionalPropertiesClass implements Parcelable { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -71,7 +71,7 @@ public class AdditionalPropertiesClass implements Parcelable { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java index df1255ab2ae..1fcb086e419 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java @@ -41,7 +41,7 @@ public class Animal implements Parcelable { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -59,7 +59,7 @@ public class Animal implements Parcelable { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f7b9740dd33..6c98580df10 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c5e8cf8dcda..faf67248e52 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly implements Parcelable { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java index 8b282c9796f..3e34712b7ea 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest implements Parcelable { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -74,7 +74,7 @@ public class ArrayTest implements Parcelable { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -97,7 +97,7 @@ public class ArrayTest implements Parcelable { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java index 3899582de4e..83b2d090c41 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java @@ -52,7 +52,7 @@ public class Capitalization implements Parcelable { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -70,7 +70,7 @@ public class Capitalization implements Parcelable { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -88,7 +88,7 @@ public class Capitalization implements Parcelable { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -106,7 +106,7 @@ public class Capitalization implements Parcelable { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -124,7 +124,7 @@ public class Capitalization implements Parcelable { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -142,7 +142,7 @@ public class Capitalization implements Parcelable { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java index 446f7079cd5..f38325dda15 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java @@ -38,7 +38,7 @@ public class Cat extends Animal implements Parcelable { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java index 682da148ee7..f57160064d5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java @@ -40,7 +40,7 @@ public class Category implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Category implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java index 1b7d5f90c2d..94379760337 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java @@ -38,7 +38,7 @@ public class ClassModel implements Parcelable { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java index fe409e10c0c..9c93c340da6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java @@ -37,7 +37,7 @@ public class Client implements Parcelable { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java index ab00719a026..8632408f529 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java @@ -38,7 +38,7 @@ public class Dog extends Animal implements Parcelable { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java index 965014b8ad9..8f0ed50d7cd 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java @@ -86,7 +86,7 @@ public class EnumArrays implements Parcelable { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -109,7 +109,7 @@ public class EnumArrays implements Parcelable { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java index 84fd6e64938..b323d9d6913 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java @@ -116,7 +116,7 @@ public class EnumTest implements Parcelable { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -134,7 +134,7 @@ public class EnumTest implements Parcelable { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -152,7 +152,7 @@ public class EnumTest implements Parcelable { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -170,7 +170,7 @@ public class EnumTest implements Parcelable { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java index 6ec74ffe915..56d0da58b72 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java @@ -79,7 +79,7 @@ public class FormatTest implements Parcelable { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -99,7 +99,7 @@ public class FormatTest implements Parcelable { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -117,7 +117,7 @@ public class FormatTest implements Parcelable { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -137,7 +137,7 @@ public class FormatTest implements Parcelable { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -157,7 +157,7 @@ public class FormatTest implements Parcelable { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -177,7 +177,7 @@ public class FormatTest implements Parcelable { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -195,7 +195,7 @@ public class FormatTest implements Parcelable { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -213,7 +213,7 @@ public class FormatTest implements Parcelable { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -231,7 +231,7 @@ public class FormatTest implements Parcelable { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -249,7 +249,7 @@ public class FormatTest implements Parcelable { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -267,7 +267,7 @@ public class FormatTest implements Parcelable { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -285,7 +285,7 @@ public class FormatTest implements Parcelable { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -303,7 +303,7 @@ public class FormatTest implements Parcelable { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index cc192a52704..4d59b539bef 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly implements Parcelable { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -44,7 +44,7 @@ public class HasOnlyReadOnly implements Parcelable { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java index 9c88e52a70c..eda550e267c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java @@ -70,7 +70,7 @@ public class MapTest implements Parcelable { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -93,7 +93,7 @@ public class MapTest implements Parcelable { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d6a6fbd9e6a..8c763ffc4d4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -49,7 +49,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -67,7 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -90,7 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java index e02fe8ed623..528115eeb1d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java @@ -41,7 +41,7 @@ public class Model200Response implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Model200Response implements Parcelable { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java index cdd7d39842b..b97da392058 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -43,7 +43,7 @@ public class ModelApiResponse implements Parcelable { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -61,7 +61,7 @@ public class ModelApiResponse implements Parcelable { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -79,7 +79,7 @@ public class ModelApiResponse implements Parcelable { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java index 03e79de1cf3..e816e867cf7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java @@ -38,7 +38,7 @@ public class ModelReturn implements Parcelable { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java index 63368110a8a..20abe1d8777 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java @@ -47,7 +47,7 @@ public class Name implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -60,7 +60,7 @@ public class Name implements Parcelable { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -74,7 +74,7 @@ public class Name implements Parcelable { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -87,7 +87,7 @@ public class Name implements Parcelable { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java index 0ab9c71910a..9e3d066ffd3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java @@ -38,7 +38,7 @@ public class NumberOnly implements Parcelable { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java index fd989fc7a2e..ec559361e6b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java @@ -78,7 +78,7 @@ public class Order implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -96,7 +96,7 @@ public class Order implements Parcelable { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -114,7 +114,7 @@ public class Order implements Parcelable { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -132,7 +132,7 @@ public class Order implements Parcelable { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -150,7 +150,7 @@ public class Order implements Parcelable { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -168,7 +168,7 @@ public class Order implements Parcelable { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java index f497bf3be4b..43c61fae2b3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java @@ -81,7 +81,7 @@ public class Pet implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -99,7 +99,7 @@ public class Pet implements Parcelable { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -140,7 +140,7 @@ public class Pet implements Parcelable { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -163,7 +163,7 @@ public class Pet implements Parcelable { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -181,7 +181,7 @@ public class Pet implements Parcelable { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 1b069d1bad5..fcbbcd73686 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -35,7 +35,7 @@ public class ReadOnlyFirst implements Parcelable { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -49,7 +49,7 @@ public class ReadOnlyFirst implements Parcelable { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java index 564a81ab3ff..1cc6a1395c8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -37,7 +37,7 @@ public class SpecialModelName implements Parcelable { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java index fe7f28b3c7b..51775132a73 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java @@ -40,7 +40,7 @@ public class Tag implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Tag implements Parcelable { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java index eb4cf0a42d6..66576fba9d4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java @@ -58,7 +58,7 @@ public class User implements Parcelable { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -76,7 +76,7 @@ public class User implements Parcelable { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -94,7 +94,7 @@ public class User implements Parcelable { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -112,7 +112,7 @@ public class User implements Parcelable { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -130,7 +130,7 @@ public class User implements Parcelable { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -148,7 +148,7 @@ public class User implements Parcelable { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -166,7 +166,7 @@ public class User implements Parcelable { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -184,7 +184,7 @@ public class User implements Parcelable { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index f2b11d703c2..541407fec8b 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -149,7 +149,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index 1163f291fcb..116117b98a1 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -206,7 +206,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.7.5 2.6.2 1.3.2 diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 8410522b276..c13f71bedc8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -75,7 +75,17 @@ public class ApiClient { verifyingSsl = true; - json = new JSON(); + + json = new JSON(this); + + /* + * Use RFC3339 format for date and datetime. + * See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 + */ + this.dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + // Always use UTC as the default time zone when dealing with date (without time). + this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + initDatetimeFormat(); // Set default User-Agent. setUserAgent("Swagger-Codegen/1.0.0/java"); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/GzipRequestInterceptor.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..cc4e4f951c1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/GzipRequestInterceptor.java @@ -0,0 +1,81 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java index 70699c70e22..29c010ba5b9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java @@ -57,12 +57,19 @@ public class FakeApi { this.apiClient = apiClient; } - /* Build call for testClientModel */ - private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testClientModel + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -175,12 +182,32 @@ public class FakeApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for testEndpointParameters */ - private com.squareup.okhttp.Call testEndpointParametersCall(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, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEndpointParameters + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEndpointParametersCall(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, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); @@ -371,12 +398,26 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for testEnumParameters */ - private com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testEnumParameters + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); if (enumQueryStringArray != null) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index d19a14e08b6..ea7a08b189f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -54,12 +54,19 @@ public class FakeClassnameTags123Api { this.apiClient = apiClient; } - /* Build call for testClassname */ - private com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for testClassname + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json"); + String localVarPath = "/fake_classname_test"; List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java index b7119add7d1..aaf615a09ec 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java @@ -56,12 +56,19 @@ public class PetApi { this.apiClient = apiClient; } - /* Build call for addPet */ - private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for addPet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -170,13 +177,21 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deletePet */ - private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deletePet + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -290,12 +305,19 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for findPetsByStatus */ - private com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByStatus + * @param status Status values that need to be considered for filter (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus"; List localVarQueryParams = new ArrayList(); if (status != null) @@ -410,12 +432,19 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for findPetsByTags */ - private com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for findPetsByTags + * @param tags Tags to filter by (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags"; List localVarQueryParams = new ArrayList(); if (tags != null) @@ -530,13 +559,20 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getPetById */ - private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getPetById + * @param petId ID of pet to return (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -649,12 +685,19 @@ public class PetApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for updatePet */ - private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePet + * @param body Pet object that needs to be added to the store (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet"; List localVarQueryParams = new ArrayList(); @@ -763,13 +806,22 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updatePetWithForm */ - private com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updatePetWithForm + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); @@ -888,13 +940,22 @@ public class PetApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for uploadFile */ - private com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for uploadFile + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java index 199f2c7b109..0b9fc0c48c1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java @@ -54,13 +54,20 @@ public class StoreApi { this.apiClient = apiClient; } - /* Build call for deleteOrder */ - private com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteOrder + * @param orderId ID of the order that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -169,12 +176,18 @@ public class StoreApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getInventory */ - private com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getInventory + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory"; List localVarQueryParams = new ArrayList(); @@ -279,13 +292,20 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for getOrderById */ - private com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getOrderById + * @param orderId ID of pet that needs to be fetched (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); @@ -398,12 +418,19 @@ public class StoreApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for placeOrder */ - private com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for placeOrder + * @param body order placed for purchasing the pet (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order"; List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java index ea719996a6b..a0d51095ef0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java @@ -54,12 +54,19 @@ public class UserApi { this.apiClient = apiClient; } - /* Build call for createUser */ - private com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUser + * @param body Created user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user"; List localVarQueryParams = new ArrayList(); @@ -168,12 +175,19 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithArrayInput */ - private com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithArrayInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray"; List localVarQueryParams = new ArrayList(); @@ -282,12 +296,19 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for createUsersWithListInput */ - private com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for createUsersWithListInput + * @param body List of user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList"; List localVarQueryParams = new ArrayList(); @@ -396,13 +417,20 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for deleteUser */ - private com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for deleteUser + * @param username The name that needs to be deleted (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -511,13 +539,20 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for getUserByName */ - private com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for getUserByName + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); @@ -630,12 +665,20 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for loginUser */ - private com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for loginUser + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login"; List localVarQueryParams = new ArrayList(); if (username != null) @@ -760,12 +803,18 @@ public class UserApi { apiClient.executeAsync(call, localVarReturnType, callback); return call; } - /* Build call for logoutUser */ - private com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for logoutUser + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout"; List localVarQueryParams = new ArrayList(); @@ -866,13 +915,21 @@ public class UserApi { apiClient.executeAsync(call, callback); return call; } - /* Build call for updateUser */ - private com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + /** + * Build call for updateUser + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java index db1dc0c9008..15d3cbe3c69 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java index 9fc1eab0e50..0591869a31a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0243de3d108..fcb5453715f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java index fd05d6e9bef..768361db92c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java index f5f3aef8f57..fa6b9b0fadd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java index 77acc1e2230..c6ce300e7b2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java index 52deeadabcf..59f3b2d0745 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java index 3d0ee70b1b5..8b330f6ebbf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java index 5951ebc5aa6..014d8367d47 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java index c53f7ceb050..425b10ed435 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java index 19635b3b5b0..b64e15e422c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index 5d23171a297..aaa9654d87a 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -212,7 +212,7 @@ - 1.5.9 + 1.5.12 1.9.0 2.7.5 2.9.3 diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java index ed9821db8f7..250c8f9550a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java @@ -52,13 +52,15 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); - for(String authName : authNames) { + for(String authName : authNames) { Interceptor auth; - if ("api_key".equals(authName)) { + if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); - } else if ("http_basic_test".equals(authName)) { + } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); - } else if ("petstore_auth".equals(authName)) { + + } else if ("petstore_auth".equals(authName)) { + auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java index db1dc0c9008..15d3cbe3c69 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java index b79593fdb6a..e52a1656493 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 89fce6dad9e..13487e7e351 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java index fd05d6e9bef..768361db92c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java index f5f3aef8f57..fa6b9b0fadd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java index 77acc1e2230..c6ce300e7b2 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java index de5cc9a6d3a..52c53649506 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java index 3d0ee70b1b5..8b330f6ebbf 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java index 5951ebc5aa6..014d8367d47 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java index c53f7ceb050..425b10ed435 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java index 19635b3b5b0..b64e15e422c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index db713a8877f..c2833654901 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -245,7 +245,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 2.7.5 1.3.2 diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java index a8a2c0804f2..368d5d5f5a4 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index a3e18a44fc6..24698e3ddb5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java index ec44297e20e..7b32044e838 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java index d2e38f90cbf..2ffc90a478b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/StoreApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java index 7034b3ab5b9..19fc25ccd23 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index d64d61f3c52..073f605cd49 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -48,7 +48,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -71,7 +71,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java index 32cf42cdd74..3009c1fb4a6 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java @@ -48,7 +48,7 @@ public class Animal { * @return className **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -66,7 +66,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 2e8235c8c49..a59dccde4e2 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 4d909396195..5872c2e7749 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java index 29b73261642..9bf3e2bb705 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -74,7 +74,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -97,7 +97,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java index 6aa8eb59dc5..2fa81e5d61f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java @@ -52,7 +52,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -70,7 +70,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -88,7 +88,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -106,7 +106,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -124,7 +124,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -142,7 +142,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java index a04574c0ea9..4114f80908a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java @@ -38,7 +38,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java index c8691c3ee4f..75d5aed3dc9 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java @@ -40,7 +40,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java index 5fe97c0b21c..fcc4b60d2c1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java @@ -38,7 +38,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java index f2f6c4b6130..56ef2a6f917 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java @@ -37,7 +37,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java index 9e18aa16b51..5d51058223e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java @@ -38,7 +38,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java index 973534c6c1d..c0aa3ca485f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java @@ -102,7 +102,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -125,7 +125,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java index 38fa33789f3..1c2b7b18f38 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java @@ -139,7 +139,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -157,7 +157,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -175,7 +175,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -193,7 +193,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java index 1eacb85997d..dcdac73d82e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java @@ -79,9 +79,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @Min(10) - @Max(100) - @ApiModelProperty(example = "null", value = "") + @Min(10) @Max(100) @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -101,9 +99,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @Min(20) - @Max(200) - @ApiModelProperty(example = "null", value = "") + @Min(20) @Max(200) @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -121,7 +117,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -142,9 +138,7 @@ public class FormatTest { * @return number **/ @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - @ApiModelProperty(example = "null", required = true, value = "") + @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -164,9 +158,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @DecimalMin("54.3") - @DecimalMax("987.6") - @ApiModelProperty(example = "null", value = "") + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -186,9 +178,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @DecimalMin("67.8") - @DecimalMax("123.4") - @ApiModelProperty(example = "null", value = "") + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -206,8 +196,7 @@ public class FormatTest { * Get string * @return string **/ - @Pattern(regexp="/[a-z]/i") - @ApiModelProperty(example = "null", value = "") + @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") public String getString() { return string; } @@ -226,7 +215,7 @@ public class FormatTest { * @return _byte **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -244,7 +233,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -263,7 +252,7 @@ public class FormatTest { * @return date **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -281,7 +270,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -299,7 +288,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -318,8 +307,7 @@ public class FormatTest { * @return password **/ @NotNull - @Size(min=10,max=64) - @ApiModelProperty(example = "null", required = true, value = "") + @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6a96f1964a0..dee7f0bd29b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -44,7 +44,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java index 4db64f866f5..f703cd5ecf5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java @@ -78,7 +78,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -101,7 +101,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 90d4e6ad079..d7e50b02683 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -49,7 +49,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -67,7 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -90,7 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java index 8142243744e..e01123c868f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java @@ -41,7 +41,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -59,7 +59,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java index 0fdfa8f52f7..f3caa44435d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -43,7 +43,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -61,7 +61,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -79,7 +79,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java index 1e4ae4973d3..8cc3bd148ab 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java @@ -38,7 +38,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java index 872603a2329..78cd0326f32 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java @@ -48,7 +48,7 @@ public class Name { * @return name **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -61,7 +61,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -75,7 +75,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -88,7 +88,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java index 06fdd444d86..c838c8ad9b3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java @@ -38,7 +38,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java index 55ac6779d05..12611a7720a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java @@ -85,7 +85,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -103,7 +103,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -121,7 +121,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -139,7 +139,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -157,7 +157,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -175,7 +175,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java index 0bb51a4f5c0..e90e3f7df24 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java @@ -88,7 +88,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -106,7 +106,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -149,7 +149,7 @@ public class Pet { * @return photoUrls **/ @NotNull - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -172,7 +172,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -190,7 +190,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 7b9247bb24e..72bed951737 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -35,7 +35,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -49,7 +49,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java index 480fb41e9ea..058d6156f48 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -37,7 +37,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java index 271c21de570..97110c9fffd 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java @@ -40,7 +40,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -58,7 +58,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java index dfec21c2a96..4827937f0e6 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java @@ -58,7 +58,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -76,7 +76,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -94,7 +94,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -112,7 +112,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -130,7 +130,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -148,7 +148,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -166,7 +166,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -184,7 +184,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 1ec90faab5f..c53cbf652bb 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -214,7 +214,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 1.3.2 1.0.1 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java index 4878fcf16e8..84cb5c6c794 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index d214188b811..5f579321487 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java index 0860d5354ed..df1999db5c0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java index f2d3a26d0ed..224d4f02500 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java index 87a4921c70e..2a189ac4e60 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java @@ -3,6 +3,7 @@ package io.swagger.client.api; import io.swagger.client.CollectionFormats.*; + import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java index db1dc0c9008..15d3cbe3c69 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java index 9fc1eab0e50..0591869a31a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0243de3d108..fcb5453715f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java index fd05d6e9bef..768361db92c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java index f5f3aef8f57..fa6b9b0fadd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java index 77acc1e2230..c6ce300e7b2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java index 52deeadabcf..59f3b2d0745 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java index 3d0ee70b1b5..8b330f6ebbf 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java index 5951ebc5aa6..014d8367d47 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java index c53f7ceb050..425b10ed435 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java index 19635b3b5b0..b64e15e422c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index d0877daf669..da4ccb50e74 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -224,7 +224,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 2.1.0 1.1.6 1.3.2 diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java index ee7d1af5389..37ec68b1804 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java @@ -114,7 +114,7 @@ public class ApiClient { .Builder() .baseUrl(baseUrl) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) - .addConverterFactory(ScalarsConverterFactory.create()) + .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index 3b198cb5433..b9e9f3383ce 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 04e5c547d7e..2421c3261ae 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java index 7d036572540..3fa5d01ee65 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java index 847c2721144..5c87a20f433 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java index af1bb5f0ffd..79428c2ad04 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java @@ -4,6 +4,7 @@ import io.swagger.client.CollectionFormats.*; import rx.Observable; + import retrofit2.http.*; import okhttp3.RequestBody; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 37674fcf9ef..7643088bc13 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } @@ -69,7 +69,7 @@ public class AdditionalPropertiesClass { * Get mapOfMapProperty * @return mapOfMapProperty **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java index 31b4137edcf..a0c2fb9d1de 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java @@ -39,7 +39,7 @@ public class Animal { * Get className * @return className **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } @@ -57,7 +57,7 @@ public class Animal { * Get color * @return color **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getColor() { return color; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3d34c2246a0..fbc5eef2f7a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c67a52b549e..47e816f633e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -43,7 +43,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java index 1a0b48d9c21..39008027e21 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -49,7 +49,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } @@ -72,7 +72,7 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -95,7 +95,7 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java index 0767353985f..69643664125 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java @@ -50,7 +50,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } @@ -68,7 +68,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } @@ -86,7 +86,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } @@ -104,7 +104,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } @@ -122,7 +122,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -140,7 +140,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java index ac54bd1d416..4c4cb819fb4 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java @@ -36,7 +36,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java index db1dc0c9008..15d3cbe3c69 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java @@ -38,7 +38,7 @@ public class Category { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Category { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java index ee9722ad373..5e1154ab673 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java @@ -36,7 +36,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java index 0c9d5dd4fa4..c938784e86a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java @@ -35,7 +35,7 @@ public class Client { * Get client * @return client **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getClient() { return client; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java index e9a4ee9a2fe..4783bcf6a4e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java @@ -36,7 +36,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBreed() { return breed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java index b48aa639d7c..68e8f21eb2d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,7 +107,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java index 14116c3c445..81d729c3e30 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java @@ -114,7 +114,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } @@ -132,7 +132,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -150,7 +150,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -168,7 +168,7 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java index 9fc1eab0e50..0591869a31a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java @@ -77,7 +77,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; } @@ -97,7 +97,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; } @@ -115,7 +115,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getInt64() { return int64; } @@ -135,7 +135,7 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } @@ -155,7 +155,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; } @@ -175,7 +175,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; } @@ -193,7 +193,7 @@ public class FormatTest { * Get string * @return string **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getString() { return string; } @@ -211,7 +211,7 @@ public class FormatTest { * Get _byte * @return _byte **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; } @@ -229,7 +229,7 @@ public class FormatTest { * Get binary * @return binary **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public byte[] getBinary() { return binary; } @@ -247,7 +247,7 @@ public class FormatTest { * Get date * @return date **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } @@ -265,7 +265,7 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -283,7 +283,7 @@ public class FormatTest { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -301,7 +301,7 @@ public class FormatTest { * Get password * @return password **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 77a113b793d..f3dd4126b70 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -42,7 +42,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFoo() { return foo; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java index 2ab5c4e4899..a03d25c6d18 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java @@ -68,7 +68,7 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } @@ -91,7 +91,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0243de3d108..fcb5453715f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } @@ -88,7 +88,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Map getMap() { return map; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java index fd05d6e9bef..768361db92c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java @@ -39,7 +39,7 @@ public class Model200Response { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getName() { return name; } @@ -57,7 +57,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java index 5af5c68f073..4ac2a08183b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -41,7 +41,7 @@ public class ModelApiResponse { * Get code * @return code **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -59,7 +59,7 @@ public class ModelApiResponse { * Get type * @return type **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getType() { return type; } @@ -77,7 +77,7 @@ public class ModelApiResponse { * Get message * @return message **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java index f5f3aef8f57..fa6b9b0fadd 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java @@ -36,7 +36,7 @@ public class ModelReturn { * Get _return * @return _return **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java index 77acc1e2230..c6ce300e7b2 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java @@ -45,7 +45,7 @@ public class Name { * Get name * @return name **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } @@ -58,7 +58,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } @@ -72,7 +72,7 @@ public class Name { * Get property * @return property **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getProperty() { return property; } @@ -85,7 +85,7 @@ public class Name { * Get _123Number * @return _123Number **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java index 0a233175c0c..4d9306eea00 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java @@ -36,7 +36,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java index 52deeadabcf..59f3b2d0745 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java @@ -76,7 +76,7 @@ public class Order { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -94,7 +94,7 @@ public class Order { * Get petId * @return petId **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -112,7 +112,7 @@ public class Order { * Get quantity * @return quantity **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -130,7 +130,7 @@ public class Order { * Get shipDate * @return shipDate **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -148,7 +148,7 @@ public class Order { * Order Status * @return status **/ - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -166,7 +166,7 @@ public class Order { * Get complete * @return complete **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java index 3d0ee70b1b5..8b330f6ebbf 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java @@ -79,7 +79,7 @@ public class Pet { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -97,7 +97,7 @@ public class Pet { * Get category * @return category **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -138,7 +138,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -161,7 +161,7 @@ public class Pet { * Get tags * @return tags **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -179,7 +179,7 @@ public class Pet { * pet status in the store * @return status **/ - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 94df25e613d..3af382fb273 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBar() { return bar; } @@ -47,7 +47,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getBaz() { return baz; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java index 5951ebc5aa6..014d8367d47 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -35,7 +35,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java index c53f7ceb050..425b10ed435 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java @@ -38,7 +38,7 @@ public class Tag { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,7 +56,7 @@ public class Tag { * Get name * @return name **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java index 19635b3b5b0..b64e15e422c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java @@ -56,7 +56,7 @@ public class User { * Get id * @return id **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public Long getId() { return id; } @@ -74,7 +74,7 @@ public class User { * Get username * @return username **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -92,7 +92,7 @@ public class User { * Get firstName * @return firstName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -110,7 +110,7 @@ public class User { * Get lastName * @return lastName **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -128,7 +128,7 @@ public class User { * Get email * @return email **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -146,7 +146,7 @@ public class User { * Get password * @return password **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -164,7 +164,7 @@ public class User { * Get phone * @return phone **/ - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -182,7 +182,7 @@ public class User { * User Status * @return userStatus **/ - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 6556dba1fbb..9f288e81961 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -14,18 +14,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['superagent'], factory); + define(['superagent', 'querystring'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent')); + module.exports = factory(require('superagent'), require('querystring')); } else { // Browser globals (root is window) if (!root.SwaggerPetstore) { root.SwaggerPetstore = {}; } - root.SwaggerPetstore.ApiClient = factory(root.superagent); + root.SwaggerPetstore.ApiClient = factory(root.superagent, root.querystring); } -}(this, function(superagent) { +}(this, function(superagent, querystring) { 'use strict'; /** @@ -78,6 +78,22 @@ * @default true */ this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + }; /** @@ -397,7 +413,7 @@ } if (contentType === 'application/x-www-form-urlencoded') { - request.send(this.normalizeParams(formParams)); + request.send(querystring.stringify(this.normalizeParams(formParams))); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { @@ -419,6 +435,16 @@ request.accept(accept); } + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + return new Promise(function(resolve, reject) { request.end(function(error, response) { if (error) { @@ -426,7 +452,10 @@ } else { try { var data = _this.deserialize(response, returnType); - resolve(data); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } + resolve({data, response}); } catch (err) { reject(err); } @@ -451,9 +480,12 @@ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on data will be converted to this type. - * @returns An instance of the specified type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. */ exports.convertToType = function(data, type) { + if (data === null || data === undefined) + return data + switch (type) { case 'Boolean': return Boolean(data); diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 8a556c0b24c..12ab2c70413 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -50,13 +50,13 @@ * To test \"client\" model * To test \"client\" model * @param {module:model/Client} body client model - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response */ - this.testClientModel = function(body) { + this.testClientModelWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClientModel"); } @@ -84,6 +84,19 @@ ); } + /** + * To test \"client\" model + * To test \"client\" model + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + this.testClientModel = function(body) { + return this.testClientModelWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -103,29 +116,29 @@ * @param {Date} opts.dateTime None * @param {String} opts.password None * @param {String} opts.callback None - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts) { + this.testEndpointParametersWithHttpInfo = function(_number, _double, patternWithoutDelimiter, _byte, opts) { opts = opts || {}; var postBody = null; // verify the required parameter '_number' is set - if (_number == undefined || _number == null) { + if (_number === undefined || _number === null) { throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } // verify the required parameter '_double' is set - if (_double == undefined || _double == null) { + if (_double === undefined || _double === null) { throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == undefined || patternWithoutDelimiter == null) { + if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) { throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } // verify the required parameter '_byte' is set - if (_byte == undefined || _byte == null) { + if (_byte === undefined || _byte === null) { throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } @@ -167,6 +180,33 @@ ); } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param {Number} _number None + * @param {Number} _double None + * @param {String} patternWithoutDelimiter None + * @param {String} _byte None + * @param {Object} opts Optional parameters + * @param {Number} opts.integer None + * @param {Number} opts.int32 None + * @param {Number} opts.int64 None + * @param {Number} opts._float None + * @param {String} opts._string None + * @param {String} opts.binary None + * @param {Date} opts._date None + * @param {Date} opts.dateTime None + * @param {String} opts.password None + * @param {String} opts.callback None + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts) { + return this.testEndpointParametersWithHttpInfo(_number, _double, patternWithoutDelimiter, _byte, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * To test enum parameters @@ -180,9 +220,9 @@ * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg) * @param {Number} opts.enumQueryInteger Query parameter enum test (double) * @param {Number} opts.enumQueryDouble Query parameter enum test (double) - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.testEnumParameters = function(opts) { + this.testEnumParametersWithHttpInfo = function(opts) { opts = opts || {}; var postBody = null; @@ -220,6 +260,27 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * To test enum parameters + * To test enum parameters + * @param {Object} opts Optional parameters + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to -efg) + * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to -efg) + * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg) + * @param {Number} opts.enumQueryInteger Query parameter enum test (double) + * @param {Number} opts.enumQueryDouble Query parameter enum test (double) + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.testEnumParameters = function(opts) { + return this.testEnumParametersWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index d6437279388..5f979d8ecad 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -50,13 +50,13 @@ * Add a new pet to the store * * @param {module:model/Pet} body Pet object that needs to be added to the store - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.addPet = function(body) { + this.addPetWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling addPet"); } @@ -84,6 +84,19 @@ ); } + /** + * Add a new pet to the store + * + * @param {module:model/Pet} body Pet object that needs to be added to the store + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.addPet = function(body) { + return this.addPetWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Deletes a pet @@ -91,14 +104,14 @@ * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters * @param {String} opts.apiKey - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deletePet = function(petId, opts) { + this.deletePetWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling deletePet"); } @@ -128,18 +141,33 @@ ); } + /** + * Deletes a pet + * + * @param {Number} petId Pet id to delete + * @param {Object} opts Optional parameters + * @param {String} opts.apiKey + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.deletePet = function(petId, opts) { + return this.deletePetWithHttpInfo(petId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param {Array.} status Status values that need to be considered for filter - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ - this.findPetsByStatus = function(status) { + this.findPetsByStatusWithHttpInfo = function(status) { var postBody = null; // verify the required parameter 'status' is set - if (status == undefined || status == null) { + if (status === undefined || status === null) { throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } @@ -171,18 +199,31 @@ ); } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param {Array.} status Status values that need to be considered for filter + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + */ + this.findPetsByStatus = function(status) { + return this.findPetsByStatusWithHttpInfo(status) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param {Array.} tags Tags to filter by - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ - this.findPetsByTags = function(tags) { + this.findPetsByTagsWithHttpInfo = function(tags) { var postBody = null; // verify the required parameter 'tags' is set - if (tags == undefined || tags == null) { + if (tags === undefined || tags === null) { throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } @@ -214,18 +255,31 @@ ); } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param {Array.} tags Tags to filter by + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} + */ + this.findPetsByTags = function(tags) { + return this.findPetsByTagsWithHttpInfo(tags) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Find pet by ID * Returns a single pet * @param {Number} petId ID of pet to return - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Pet} and HTTP response */ - this.getPetById = function(petId) { + this.getPetByIdWithHttpInfo = function(petId) { var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling getPetById"); } @@ -254,18 +308,31 @@ ); } + /** + * Find pet by ID + * Returns a single pet + * @param {Number} petId ID of pet to return + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet} + */ + this.getPetById = function(petId) { + return this.getPetByIdWithHttpInfo(petId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Update an existing pet * * @param {module:model/Pet} body Pet object that needs to be added to the store - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updatePet = function(body) { + this.updatePetWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updatePet"); } @@ -293,6 +360,19 @@ ); } + /** + * Update an existing pet + * + * @param {module:model/Pet} body Pet object that needs to be added to the store + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.updatePet = function(body) { + return this.updatePetWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Updates a pet in the store with form data @@ -301,14 +381,14 @@ * @param {Object} opts Optional parameters * @param {String} opts.name Updated name of the pet * @param {String} opts.status Updated status of the pet - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updatePetWithForm = function(petId, opts) { + this.updatePetWithFormWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } @@ -339,6 +419,22 @@ ); } + /** + * Updates a pet in the store with form data + * + * @param {Number} petId ID of pet that needs to be updated + * @param {Object} opts Optional parameters + * @param {String} opts.name Updated name of the pet + * @param {String} opts.status Updated status of the pet + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.updatePetWithForm = function(petId, opts) { + return this.updatePetWithFormWithHttpInfo(petId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * uploads an image @@ -347,14 +443,14 @@ * @param {Object} opts Optional parameters * @param {String} opts.additionalMetadata Additional data to pass to server * @param {File} opts.file file to upload - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiResponse} and HTTP response */ - this.uploadFile = function(petId, opts) { + this.uploadFileWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } @@ -384,6 +480,22 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * uploads an image + * + * @param {Number} petId ID of pet to update + * @param {Object} opts Optional parameters + * @param {String} opts.additionalMetadata Additional data to pass to server + * @param {File} opts.file file to upload + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse} + */ + this.uploadFile = function(petId, opts) { + return this.uploadFileWithHttpInfo(petId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index ea76640fd72..633c7595157 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -50,13 +50,13 @@ * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deleteOrder = function(orderId) { + this.deleteOrderWithHttpInfo = function(orderId) { var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } @@ -85,13 +85,26 @@ ); } + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param {String} orderId ID of the order that needs to be deleted + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.deleteOrder = function(orderId) { + return this.deleteOrderWithHttpInfo(orderId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object.} and HTTP response */ - this.getInventory = function() { + this.getInventoryWithHttpInfo = function() { var postBody = null; @@ -118,18 +131,30 @@ ); } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.} + */ + this.getInventory = function() { + return this.getInventoryWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ - this.getOrderById = function(orderId) { + this.getOrderByIdWithHttpInfo = function(orderId) { var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } @@ -158,18 +183,31 @@ ); } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param {Number} orderId ID of pet that needs to be fetched + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + */ + this.getOrderById = function(orderId) { + return this.getOrderByIdWithHttpInfo(orderId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Place an order for a pet * * @param {module:model/Order} body order placed for purchasing the pet - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ - this.placeOrder = function(body) { + this.placeOrderWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling placeOrder"); } @@ -196,6 +234,19 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * Place an order for a pet + * + * @param {module:model/Order} body order placed for purchasing the pet + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} + */ + this.placeOrder = function(body) { + return this.placeOrderWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index bd83a64ef9c..2f5127fe50e 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -50,13 +50,13 @@ * Create user * This can only be done by the logged in user. * @param {module:model/User} body Created user object - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.createUser = function(body) { + this.createUserWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUser"); } @@ -84,18 +84,31 @@ ); } + /** + * Create user + * This can only be done by the logged in user. + * @param {module:model/User} body Created user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.createUser = function(body) { + return this.createUserWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Creates list of users with given input array * * @param {Array.} body List of user object - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.createUsersWithArrayInput = function(body) { + this.createUsersWithArrayInputWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } @@ -123,18 +136,31 @@ ); } - /** * Creates list of users with given input array * * @param {Array.} body List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.createUsersWithListInput = function(body) { + this.createUsersWithArrayInput = function(body) { + return this.createUsersWithArrayInputWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Creates list of users with given input array + * + * @param {Array.} body List of user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + this.createUsersWithListInputWithHttpInfo = function(body) { var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } @@ -162,18 +188,31 @@ ); } + /** + * Creates list of users with given input array + * + * @param {Array.} body List of user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.createUsersWithListInput = function(body) { + return this.createUsersWithListInputWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Delete user * This can only be done by the logged in user. * @param {String} username The name that needs to be deleted - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deleteUser = function(username) { + this.deleteUserWithHttpInfo = function(username) { var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling deleteUser"); } @@ -202,18 +241,31 @@ ); } + /** + * Delete user + * This can only be done by the logged in user. + * @param {String} username The name that needs to be deleted + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.deleteUser = function(username) { + return this.deleteUserWithHttpInfo(username) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Get user by user name * * @param {String} username The name that needs to be fetched. Use user1 for testing. - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response */ - this.getUserByName = function(username) { + this.getUserByNameWithHttpInfo = function(username) { var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling getUserByName"); } @@ -242,24 +294,37 @@ ); } + /** + * Get user by user name + * + * @param {String} username The name that needs to be fetched. Use user1 for testing. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User} + */ + this.getUserByName = function(username) { + return this.getUserByNameWithHttpInfo(username) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Logs user into the system * * @param {String} username The user name for login * @param {String} password The password for login in clear text - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link 'String'} and HTTP response */ - this.loginUser = function(username, password) { + this.loginUserWithHttpInfo = function(username, password) { var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling loginUser"); } // verify the required parameter 'password' is set - if (password == undefined || password == null) { + if (password === undefined || password === null) { throw new Error("Missing the required parameter 'password' when calling loginUser"); } @@ -289,13 +354,27 @@ ); } + /** + * Logs user into the system + * + * @param {String} username The user name for login + * @param {String} password The password for login in clear text + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'} + */ + this.loginUser = function(username, password) { + return this.loginUserWithHttpInfo(username, password) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Logs out current logged in user session * - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.logoutUser = function() { + this.logoutUserWithHttpInfo = function() { var postBody = null; @@ -322,24 +401,36 @@ ); } + /** + * Logs out current logged in user session + * + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.logoutUser = function() { + return this.logoutUserWithHttpInfo() + .then(function(response_and_data) { + return response_and_data.data; + }); + } + /** * Updated user * This can only be done by the logged in user. * @param {String} username name that need to be deleted * @param {module:model/User} body Updated user object - * @return {Promise} a {@link https://www.promisejs.org/|Promise} + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updateUser = function(username, body) { + this.updateUserWithHttpInfo = function(username, body) { var postBody = body; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling updateUser"); } // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updateUser"); } @@ -367,6 +458,20 @@ authNames, contentTypes, accepts, returnType ); } + + /** + * Updated user + * This can only be done by the logged in user. + * @param {String} username name that need to be deleted + * @param {module:model/User} body Updated user object + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.updateUser = function(username, body) { + return this.updateUserWithHttpInfo(username, body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 10e54f6911a..bfa769c5d34 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -14,18 +14,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['superagent'], factory); + define(['superagent', 'querystring'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent')); + module.exports = factory(require('superagent'), require('querystring')); } else { // Browser globals (root is window) if (!root.SwaggerPetstore) { root.SwaggerPetstore = {}; } - root.SwaggerPetstore.ApiClient = factory(root.superagent); + root.SwaggerPetstore.ApiClient = factory(root.superagent, root.querystring); } -}(this, function(superagent) { +}(this, function(superagent, querystring) { 'use strict'; /** @@ -78,6 +78,22 @@ * @default true */ this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + }; /** @@ -406,7 +422,7 @@ } if (contentType === 'application/x-www-form-urlencoded') { - request.send(this.normalizeParams(formParams)); + request.send(querystring.stringify(this.normalizeParams(formParams))); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { @@ -428,6 +444,16 @@ request.accept(accept); } + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + request.end(function(error, response) { if (callback) { @@ -435,6 +461,9 @@ if (!error) { try { data = _this.deserialize(response, returnType); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } } catch (err) { error = err; } @@ -462,9 +491,12 @@ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on data will be converted to this type. - * @returns An instance of the specified type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. */ exports.convertToType = function(data, type) { + if (data === null || data === undefined) + return data + switch (type) { case 'Boolean': return Boolean(data); diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index 2ee4b332d0d..d964b82b2ea 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -64,7 +64,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClientModel"); } @@ -125,22 +125,22 @@ var postBody = null; // verify the required parameter '_number' is set - if (_number == undefined || _number == null) { + if (_number === undefined || _number === null) { throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } // verify the required parameter '_double' is set - if (_double == undefined || _double == null) { + if (_double === undefined || _double === null) { throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == undefined || patternWithoutDelimiter == null) { + if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) { throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } // verify the required parameter '_byte' is set - if (_byte == undefined || _byte == null) { + if (_byte === undefined || _byte === null) { throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index 4f5445eed16..d715dd5edc0 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -63,7 +63,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling addPet"); } @@ -112,7 +112,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling deletePet"); } @@ -161,7 +161,7 @@ var postBody = null; // verify the required parameter 'status' is set - if (status == undefined || status == null) { + if (status === undefined || status === null) { throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } @@ -212,7 +212,7 @@ var postBody = null; // verify the required parameter 'tags' is set - if (tags == undefined || tags == null) { + if (tags === undefined || tags === null) { throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } @@ -263,7 +263,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling getPetById"); } @@ -310,7 +310,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updatePet"); } @@ -360,7 +360,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } @@ -414,7 +414,7 @@ var postBody = null; // verify the required parameter 'petId' is set - if (petId == undefined || petId == null) { + if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 2e943f96f55..cd9c405ae2f 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -63,7 +63,7 @@ var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } @@ -152,7 +152,7 @@ var postBody = null; // verify the required parameter 'orderId' is set - if (orderId == undefined || orderId == null) { + if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } @@ -200,7 +200,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling placeOrder"); } diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 17959fa1c12..83dcb7e35c9 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -63,7 +63,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUser"); } @@ -109,7 +109,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } @@ -155,7 +155,7 @@ var postBody = body; // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } @@ -201,7 +201,7 @@ var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling deleteUser"); } @@ -249,7 +249,7 @@ var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling getUserByName"); } @@ -298,12 +298,12 @@ var postBody = null; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling loginUser"); } // verify the required parameter 'password' is set - if (password == undefined || password == null) { + if (password === undefined || password === null) { throw new Error("Missing the required parameter 'password' when calling loginUser"); } @@ -392,12 +392,12 @@ var postBody = body; // verify the required parameter 'username' is set - if (username == undefined || username == null) { + if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling updateUser"); } // verify the required parameter 'body' is set - if (body == undefined || body == null) { + if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updateUser"); } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index c0ca97c3480..36a2a6d700a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -60,9 +60,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -132,9 +129,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; @@ -195,9 +189,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -256,9 +247,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSArray* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -328,9 +316,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; @@ -388,9 +373,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -463,9 +445,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; @@ -546,9 +525,6 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (petId != nil) { pathParams[@"petId"] = petId; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index 2a17173f83a..ebf27ab982a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -71,9 +71,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (orderId != nil) { pathParams[@"orderId"] = orderId; @@ -129,9 +126,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; (void (^)(NSDictionary* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -197,9 +191,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (orderId != nil) { pathParams[@"orderId"] = orderId; @@ -257,9 +248,6 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index e1acf3af007..2a1c4ecda81 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -60,9 +60,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -118,9 +115,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -176,9 +170,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -245,9 +236,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (username != nil) { pathParams[@"username"] = username; @@ -316,9 +304,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (username != nil) { pathParams[@"username"] = username; @@ -379,9 +364,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; completionHandler: (void (^)(NSString* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -440,9 +422,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; @@ -511,9 +490,6 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - // remove format in URL if needed - [resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)]; - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; if (username != nil) { pathParams[@"username"] = username; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m index f757e139d0e..4b1d014d2bc 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m @@ -89,7 +89,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { #pragma mark - Task Methods - (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - + NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { SWGDebugLogResponse(response, responseObject,request,error); if(!error) { @@ -104,7 +104,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; completionBlock(nil, augmentedError); }]; - + return task; } @@ -135,7 +135,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(file, nil); }]; - + return task; } @@ -222,7 +222,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { [self postProcessRequest:request]; - + NSURLSessionTask *task = nil; if ([self.downloadTaskResponseTypes containsObject:responseType]) { @@ -241,9 +241,9 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { completionBlock(response, error); }]; } - + [task resume]; - + return task; } @@ -330,7 +330,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - + id config = self.configuration; for (NSString *auth in authSettings) { NSDictionary *authSetting = config.authSettings[auth]; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm index ebb8bb5b86e..961e102e081 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm @@ -83,7 +83,6 @@ sub test_client_model { # parse inputs my $_resource_path = '/fake'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'PATCH'; my $query_params = {}; @@ -242,7 +241,6 @@ sub test_endpoint_parameters { # parse inputs my $_resource_path = '/fake'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -406,7 +404,6 @@ sub test_enum_parameters { # parse inputs my $_resource_path = '/fake'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm index ac715bb60bf..c658538dac6 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm @@ -83,7 +83,6 @@ sub add_pet { # parse inputs my $_resource_path = '/pet'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -151,7 +150,6 @@ sub delete_pet { # parse inputs my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'DELETE'; my $query_params = {}; @@ -220,7 +218,6 @@ sub find_pets_by_status { # parse inputs my $_resource_path = '/pet/findByStatus'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -286,7 +283,6 @@ sub find_pets_by_tags { # parse inputs my $_resource_path = '/pet/findByTags'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -352,7 +348,6 @@ sub get_pet_by_id { # parse inputs my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -420,7 +415,6 @@ sub update_pet { # parse inputs my $_resource_path = '/pet'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'PUT'; my $query_params = {}; @@ -494,7 +488,6 @@ sub update_pet_with_form { # parse inputs my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -580,7 +573,6 @@ sub upload_file { # parse inputs my $_resource_path = '/pet/{petId}/uploadImage'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm index ee508043e54..87589c7a7ec 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -83,7 +83,6 @@ sub delete_order { # parse inputs my $_resource_path = '/store/order/{orderId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'DELETE'; my $query_params = {}; @@ -136,7 +135,6 @@ sub get_inventory { # parse inputs my $_resource_path = '/store/inventory'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -197,7 +195,6 @@ sub get_order_by_id { # parse inputs my $_resource_path = '/store/order/{orderId}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -265,7 +262,6 @@ sub place_order { # parse inputs my $_resource_path = '/store/order'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm index 13f2e705272..c0312e5d231 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm @@ -83,7 +83,6 @@ sub create_user { # parse inputs my $_resource_path = '/user'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -145,7 +144,6 @@ sub create_users_with_array_input { # parse inputs my $_resource_path = '/user/createWithArray'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -207,7 +205,6 @@ sub create_users_with_list_input { # parse inputs my $_resource_path = '/user/createWithList'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'POST'; my $query_params = {}; @@ -269,7 +266,6 @@ sub delete_user { # parse inputs my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'DELETE'; my $query_params = {}; @@ -333,7 +329,6 @@ sub get_user_by_name { # parse inputs my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -412,7 +407,6 @@ sub login_user { # parse inputs my $_resource_path = '/user/login'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -472,7 +466,6 @@ sub logout_user { # parse inputs my $_resource_path = '/user/logout'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'GET'; my $query_params = {}; @@ -540,7 +533,6 @@ sub update_user { # parse inputs my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json my $_method = 'PUT'; my $query_params = {}; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index 54522e7a792..7024bdb6820 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -129,9 +129,6 @@ class FakeApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -296,9 +293,6 @@ class FakeApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/xml; charset=utf-8', 'application/json; charset=utf-8']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($integer !== null) { $formParams['integer'] = $this->apiClient->getSerializer()->toFormValue($integer); @@ -465,9 +459,6 @@ class FakeApi if ($enum_header_string !== null) { $headerParams['enum_header_string'] = $this->apiClient->getSerializer()->toHeaderValue($enum_header_string); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($enum_form_string_array !== null) { $formParams['enum_form_string_array'] = $this->apiClient->getSerializer()->toFormValue($enum_form_string_array); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php index 88191d22240..38974979730 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php @@ -129,9 +129,6 @@ class Fake_classname_tags123Api } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index cb902068dd4..2a83fec174f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -129,9 +129,6 @@ class PetApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/xml']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -225,9 +222,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -309,9 +303,6 @@ class PetApi if ($status !== null) { $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -397,9 +388,6 @@ class PetApi if ($tags !== null) { $queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -486,9 +474,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -568,9 +553,6 @@ class PetApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/xml']); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -662,9 +644,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($name !== null) { $formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name); @@ -759,9 +738,6 @@ class PetApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // form params if ($additional_metadata !== null) { $formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index 655fb65737a..e3d7e466722 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -137,9 +137,6 @@ class StoreApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -204,9 +201,6 @@ class StoreApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -301,9 +295,6 @@ class StoreApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -378,9 +369,6 @@ class StoreApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 31580e1b3c1..8d893d055ec 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -129,9 +129,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -207,9 +204,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -285,9 +279,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { @@ -371,9 +362,6 @@ class UserApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -452,9 +440,6 @@ class UserApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -543,9 +528,6 @@ class UserApi if ($password !== null) { $queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -614,9 +596,6 @@ class UserApi } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { @@ -701,9 +680,6 @@ class UserApi $resourcePath ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // body params $_tempBody = null; if (isset($body)) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index 2fd3dff03bc..95acee508bc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -68,9 +68,9 @@ class ApiException extends Exception * @param string $message Error message * @param int $code HTTP status code * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP body of the server response either as Json or string + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, array $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -90,7 +90,7 @@ class ApiException extends Exception /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as Json or string + * @return mixed HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index cc6875156cf..4bd9a69cdd8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -39,7 +39,7 @@ namespace Swagger\Client; */ class Configuration { - private static $defaultConfiguration = null; + private static $defaultConfiguration; /** * Associate array to store API key(s) @@ -109,7 +109,7 @@ class Configuration * * @var string */ - protected $userAgent = "Swagger-Codegen/1.0.0/php"; + protected $userAgent = 'Swagger-Codegen/1.0.0/php'; /** * Debug switch (default set to false) @@ -191,7 +191,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $key API key or token * - * @return Configuration + * @return $this */ public function setApiKey($apiKeyIdentifier, $key) { @@ -217,7 +217,7 @@ class Configuration * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $prefix API key prefix, e.g. Bearer * - * @return Configuration + * @return $this */ public function setApiKeyPrefix($apiKeyIdentifier, $prefix) { @@ -242,7 +242,7 @@ class Configuration * * @param string $accessToken Token for OAuth * - * @return Configuration + * @return $this */ public function setAccessToken($accessToken) { @@ -265,7 +265,7 @@ class Configuration * * @param string $username Username for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setUsername($username) { @@ -288,7 +288,7 @@ class Configuration * * @param string $password Password for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setPassword($password) { @@ -312,7 +312,8 @@ class Configuration * @param string $headerName header name (e.g. Token) * @param string $headerValue header value (e.g. 1z8wp3) * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function addDefaultHeader($headerName, $headerValue) { @@ -339,11 +340,12 @@ class Configuration * * @param string $headerName the header to delete * - * @return Configuration + * @return $this */ public function deleteDefaultHeader($headerName) { unset($this->defaultHeaders[$headerName]); + return $this; } /** @@ -351,7 +353,7 @@ class Configuration * * @param string $host Host * - * @return Configuration + * @return $this */ public function setHost($host) { @@ -374,7 +376,8 @@ class Configuration * * @param string $userAgent the user agent of the api client * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setUserAgent($userAgent) { @@ -401,7 +404,8 @@ class Configuration * * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlTimeout($seconds) { @@ -428,7 +432,8 @@ class Configuration * * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setCurlConnectTimeout($seconds) { @@ -456,7 +461,7 @@ class Configuration * * @param string $proxyHost HTTP Proxy URL * - * @return ApiClient + * @return $this */ public function setCurlProxyHost($proxyHost) { @@ -479,7 +484,7 @@ class Configuration * * @param integer $proxyPort HTTP Proxy Port * - * @return ApiClient + * @return $this */ public function setCurlProxyPort($proxyPort) { @@ -502,7 +507,7 @@ class Configuration * * @param integer $proxyType HTTP Proxy Type * - * @return ApiClient + * @return $this */ public function setCurlProxyType($proxyType) { @@ -525,7 +530,7 @@ class Configuration * * @param string $proxyUser HTTP Proxy User * - * @return ApiClient + * @return $this */ public function setCurlProxyUser($proxyUser) { @@ -548,7 +553,7 @@ class Configuration * * @param string $proxyPassword HTTP Proxy Password * - * @return ApiClient + * @return $this */ public function setCurlProxyPassword($proxyPassword) { @@ -571,7 +576,7 @@ class Configuration * * @param bool $debug Debug flag * - * @return Configuration + * @return $this */ public function setDebug($debug) { @@ -594,7 +599,7 @@ class Configuration * * @param string $debugFile Debug file * - * @return Configuration + * @return $this */ public function setDebugFile($debugFile) { @@ -617,7 +622,7 @@ class Configuration * * @param string $tempFolderPath Temp folder path * - * @return Configuration + * @return $this */ public function setTempFolderPath($tempFolderPath) { @@ -640,7 +645,7 @@ class Configuration * * @param boolean $sslVerification True if the certificate should be validated, false otherwise * - * @return Configuration + * @return $this */ public function setSSLVerification($sslVerification) { @@ -693,7 +698,7 @@ class Configuration { $report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . phpversion() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index 223e012b084..1e12ea14587 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -29,8 +29,6 @@ namespace Swagger\Client\Model; -use \ArrayAccess; - /** * EnumClass Class Doc Comment * @@ -40,11 +38,25 @@ use \ArrayAccess; * @link https://github.com/swagger-api/swagger-codegen */ class EnumClass { + /** + * Possible values of this enum + */ const ABC = '_abc'; const EFG = '-efg'; const XYZ = '(xyz)'; - - + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::ABC, + self::EFG, + self::XYZ, + ]; + } } + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php index b077a3b7b74..e1247e2423e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php @@ -29,8 +29,6 @@ namespace Swagger\Client\Model; -use \ArrayAccess; - /** * OuterEnum Class Doc Comment * @@ -40,11 +38,25 @@ use \ArrayAccess; * @link https://github.com/swagger-api/swagger-codegen */ class OuterEnum { + /** + * Possible values of this enum + */ const PLACED = 'placed'; const APPROVED = 'approved'; const DELIVERED = 'delivered'; - - + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::PLACED, + self::APPROVED, + self::DELIVERED, + ]; + } } + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index fbb2e8b1e45..281e51143b6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -59,10 +59,16 @@ class ObjectSerializer return $data; } elseif (is_object($data)) { $values = []; - foreach (array_keys($data::swaggerTypes()) as $property) { + foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; - if ($data->$getter() !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); + $value = $data->$getter(); + if (method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value); } } return (object)$values; @@ -269,6 +275,12 @@ class ObjectSerializer } return $deserialized; + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; } else { // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php new file mode 100644 index 00000000000..d7d12d5cbb8 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php @@ -0,0 +1,94 @@ +assertInternalType('string', $result); + $this->assertEquals('placed', $result); + } + + public function testDeserializeInvalidValue() + { + $this->setExpectedException(\InvalidArgumentException::class, 'Invalid value for enum'); + + ObjectSerializer::deserialize( + "lkjfalgkdfjg", + OuterEnum::class + ); + } + + public function testDeserializeNested() + { + $json = '{ + "enum_string": "UPPER", + "enum_integer": -1, + "enum_number": -1.2, + "outerEnum": "approved" + }'; + + /** * @var EnumTest $result */ + $result = ObjectSerializer::deserialize( + json_decode($json), + EnumTest::class + ); + + $this->assertInstanceOf(EnumTest::class, $result); + $this->assertEquals('approved', $result->getOuterEnum()); + } + + public function testSanitize() + { + $json = "placed"; + + $result = ObjectSerializer::sanitizeForSerialization( + $json + ); + + $this->assertInternalType('string', $result); + } + + public function testSanitizeNested() + { + $input = new EnumTest([ + 'enum_string' => 'UPPER', + 'enum_integer' => -1, + 'enum_number' => -1.2, + 'outer_enum' => 'approved' + ]); + + $result = ObjectSerializer::sanitizeForSerialization( + $input + ); + + $this->assertInternalType('object', $result); + $this->assertInstanceOf(\stdClass::class, $result); + + $this->assertInternalType('string', $result->outerEnum); + $this->assertEquals('approved', $result->outerEnum); + } + + public function testSanitizeNestedInvalidValue() + { + $this->setExpectedException(\InvalidArgumentException::class, 'Invalid value for enum'); + + $input = new EnumTest([ + 'enum_string' => 'UPPER', + 'enum_integer' => -1, + 'enum_number' => -1.2, + 'outer_enum' => 'invalid_value' + ]); + + ObjectSerializer::sanitizeForSerialization($input); + } +} diff --git a/samples/client/petstore/php/test.php b/samples/client/petstore/php/test.php index 6f571a1c176..5c27e3d7ae9 100644 --- a/samples/client/petstore/php/test.php +++ b/samples/client/petstore/php/test.php @@ -55,7 +55,7 @@ try { } catch (Swagger\Client\ApiException $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; - echo 'HTTP response headers: ', $e->getResponseHeaders(), "\n"; - echo 'HTTP response body: ', $e->getResponseBody(), "\n"; + echo 'HTTP response headers: ', print_r($e->getResponseHeaders(), true), "\n"; + echo 'HTTP response body: ', print_r($e->getResponseBody(), true), "\n"; echo 'HTTP status code: ', $e->getCode(), "\n"; } diff --git a/samples/client/petstore/python/petstore_api/apis/fake_api.py b/samples/client/petstore/python/petstore_api/apis/fake_api.py index 95fc5c69362..c4563b41c75 100644 --- a/samples/client/petstore/python/petstore_api/apis/fake_api.py +++ b/samples/client/petstore/python/petstore_api/apis/fake_api.py @@ -108,7 +108,6 @@ class FakeApi(object): collection_formats = {} - resource_path = '/fake'.replace('{format}', 'json') path_params = {} query_params = {} @@ -132,7 +131,7 @@ class FakeApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'PATCH', + return self.api_client.call_api('/fake', 'PATCH', path_params, query_params, header_params, @@ -276,7 +275,6 @@ class FakeApi(object): collection_formats = {} - resource_path = '/fake'.replace('{format}', 'json') path_params = {} query_params = {} @@ -326,7 +324,7 @@ class FakeApi(object): # Authentication setting auth_settings = ['http_basic_test'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/fake', 'POST', path_params, query_params, header_params, @@ -420,7 +418,6 @@ class FakeApi(object): collection_formats = {} - resource_path = '/fake'.replace('{format}', 'json') path_params = {} query_params = {} @@ -461,7 +458,7 @@ class FakeApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/fake', 'GET', path_params, query_params, header_params, diff --git a/samples/client/petstore/python/petstore_api/apis/pet_api.py b/samples/client/petstore/python/petstore_api/apis/pet_api.py index d3d5e96025a..4cca462f7db 100644 --- a/samples/client/petstore/python/petstore_api/apis/pet_api.py +++ b/samples/client/petstore/python/petstore_api/apis/pet_api.py @@ -108,7 +108,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet'.replace('{format}', 'json') path_params = {} query_params = {} @@ -132,7 +131,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/pet', 'POST', path_params, query_params, header_params, @@ -217,7 +216,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -239,7 +237,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'DELETE', + return self.api_client.call_api('/pet/{petId}', 'DELETE', path_params, query_params, header_params, @@ -322,7 +320,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/findByStatus'.replace('{format}', 'json') path_params = {} query_params = {} @@ -343,7 +340,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/pet/findByStatus', 'GET', path_params, query_params, header_params, @@ -426,7 +423,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/findByTags'.replace('{format}', 'json') path_params = {} query_params = {} @@ -447,7 +443,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/pet/findByTags', 'GET', path_params, query_params, header_params, @@ -530,7 +526,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -550,7 +545,7 @@ class PetApi(object): # Authentication setting auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/pet/{petId}', 'GET', path_params, query_params, header_params, @@ -633,7 +628,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet'.replace('{format}', 'json') path_params = {} query_params = {} @@ -657,7 +651,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'PUT', + return self.api_client.call_api('/pet', 'PUT', path_params, query_params, header_params, @@ -744,7 +738,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -772,7 +765,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/pet/{petId}', 'POST', path_params, query_params, header_params, @@ -859,7 +852,6 @@ class PetApi(object): collection_formats = {} - resource_path = '/pet/{petId}/uploadImage'.replace('{format}', 'json') path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -887,7 +879,7 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', path_params, query_params, header_params, diff --git a/samples/client/petstore/python/petstore_api/apis/store_api.py b/samples/client/petstore/python/petstore_api/apis/store_api.py index 7bfe115b10e..c3f1b7f77bd 100644 --- a/samples/client/petstore/python/petstore_api/apis/store_api.py +++ b/samples/client/petstore/python/petstore_api/apis/store_api.py @@ -108,7 +108,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/order/{orderId}'.replace('{format}', 'json') path_params = {} if 'order_id' in params: path_params['orderId'] = params['order_id'] @@ -128,7 +127,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'DELETE', + return self.api_client.call_api('/store/order/{orderId}', 'DELETE', path_params, query_params, header_params, @@ -205,7 +204,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/inventory'.replace('{format}', 'json') path_params = {} query_params = {} @@ -223,7 +221,7 @@ class StoreApi(object): # Authentication setting auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/store/inventory', 'GET', path_params, query_params, header_params, @@ -310,7 +308,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/order/{orderId}'.replace('{format}', 'json') path_params = {} if 'order_id' in params: path_params['orderId'] = params['order_id'] @@ -330,7 +327,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/store/order/{orderId}', 'GET', path_params, query_params, header_params, @@ -413,7 +410,6 @@ class StoreApi(object): collection_formats = {} - resource_path = '/store/order'.replace('{format}', 'json') path_params = {} query_params = {} @@ -433,7 +429,7 @@ class StoreApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/store/order', 'POST', path_params, query_params, header_params, diff --git a/samples/client/petstore/python/petstore_api/apis/user_api.py b/samples/client/petstore/python/petstore_api/apis/user_api.py index 6b620aa63af..5fe1fb6f2a4 100644 --- a/samples/client/petstore/python/petstore_api/apis/user_api.py +++ b/samples/client/petstore/python/petstore_api/apis/user_api.py @@ -108,7 +108,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user'.replace('{format}', 'json') path_params = {} query_params = {} @@ -128,7 +127,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/user', 'POST', path_params, query_params, header_params, @@ -211,7 +210,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/createWithArray'.replace('{format}', 'json') path_params = {} query_params = {} @@ -231,7 +229,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/user/createWithArray', 'POST', path_params, query_params, header_params, @@ -314,7 +312,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/createWithList'.replace('{format}', 'json') path_params = {} query_params = {} @@ -334,7 +331,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api('/user/createWithList', 'POST', path_params, query_params, header_params, @@ -417,7 +414,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/{username}'.replace('{format}', 'json') path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -437,7 +433,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'DELETE', + return self.api_client.call_api('/user/{username}', 'DELETE', path_params, query_params, header_params, @@ -520,7 +516,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/{username}'.replace('{format}', 'json') path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -540,7 +535,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/user/{username}', 'GET', path_params, query_params, header_params, @@ -628,7 +623,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/login'.replace('{format}', 'json') path_params = {} query_params = {} @@ -650,7 +644,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/user/login', 'GET', path_params, query_params, header_params, @@ -727,7 +721,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/logout'.replace('{format}', 'json') path_params = {} query_params = {} @@ -745,7 +738,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api('/user/logout', 'GET', path_params, query_params, header_params, @@ -833,7 +826,6 @@ class UserApi(object): collection_formats = {} - resource_path = '/user/{username}'.replace('{format}', 'json') path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -855,7 +847,7 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, 'PUT', + return self.api_client.call_api('/user/{username}', 'PUT', path_params, query_params, header_params, diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index e6763164fa2..d736f570be5 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -89,6 +89,9 @@ class Configuration(object): # client key file self.key_file = None + # Proxy URL + self.proxy = None + @property def logger_file(self): """ diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index 5fda97044b3..3ed3cf31849 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -85,15 +85,30 @@ class RESTClientObject(object): # key file key_file = Configuration().key_file + # proxy + proxy = Configuration().proxy + # https pool manager - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=cert_file, - key_file=key_file - ) + if proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file, + proxy_url=proxy + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=cert_file, + key_file=key_file + ) + def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None): diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 403705d2746..932201de831 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_client_model" if body.nil? # resource path - local_var_path = "/fake".sub('{format}','json') + local_var_path = "/fake" # query parameters query_params = {} @@ -178,7 +178,7 @@ module Petstore end # resource path - local_var_path = "/fake".sub('{format}','json') + local_var_path = "/fake" # query parameters query_params = {} @@ -274,7 +274,7 @@ module Petstore fail ArgumentError, 'invalid value for "enum_query_string", must be one of _abc, -efg, (xyz)' end # resource path - local_var_path = "/fake".sub('{format}','json') + local_var_path = "/fake" # query parameters query_params = {} diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index f6ca76d10b0..39ea74058b3 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.add_pet" if body.nil? # resource path - local_var_path = "/pet".sub('{format}','json') + local_var_path = "/pet" # query parameters query_params = {} @@ -95,7 +95,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} @@ -146,7 +146,7 @@ module Petstore # verify the required parameter 'status' is set fail ArgumentError, "Missing the required parameter 'status' when calling PetApi.find_pets_by_status" if status.nil? # resource path - local_var_path = "/pet/findByStatus".sub('{format}','json') + local_var_path = "/pet/findByStatus" # query parameters query_params = {} @@ -198,7 +198,7 @@ module Petstore # verify the required parameter 'tags' is set fail ArgumentError, "Missing the required parameter 'tags' when calling PetApi.find_pets_by_tags" if tags.nil? # resource path - local_var_path = "/pet/findByTags".sub('{format}','json') + local_var_path = "/pet/findByTags" # query parameters query_params = {} @@ -250,7 +250,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} @@ -301,7 +301,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.update_pet" if body.nil? # resource path - local_var_path = "/pet".sub('{format}','json') + local_var_path = "/pet" # query parameters query_params = {} @@ -357,7 +357,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} @@ -415,7 +415,7 @@ module Petstore # verify the required parameter 'pet_id' is set fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" if pet_id.nil? # resource path - local_var_path = "/pet/{petId}/uploadImage".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = "/pet/{petId}/uploadImage".sub('{' + 'petId' + '}', pet_id.to_s) # query parameters query_params = {} diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 30e2a46dfac..6b8978f1b9e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" if order_id.nil? # resource path - local_var_path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{orderId}".sub('{' + 'orderId' + '}', order_id.to_s) # query parameters query_params = {} @@ -87,7 +87,7 @@ module Petstore @api_client.config.logger.debug "Calling API: StoreApi.get_inventory ..." end # resource path - local_var_path = "/store/inventory".sub('{format}','json') + local_var_path = "/store/inventory" # query parameters query_params = {} @@ -146,7 +146,7 @@ module Petstore end # resource path - local_var_path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', order_id.to_s) + local_var_path = "/store/order/{orderId}".sub('{' + 'orderId' + '}', order_id.to_s) # query parameters query_params = {} @@ -197,7 +197,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling StoreApi.place_order" if body.nil? # resource path - local_var_path = "/store/order".sub('{format}','json') + local_var_path = "/store/order" # query parameters query_params = {} diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 30766994678..3bb8b2130d7 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -41,7 +41,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_user" if body.nil? # resource path - local_var_path = "/user".sub('{format}','json') + local_var_path = "/user" # query parameters query_params = {} @@ -91,7 +91,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_array_input" if body.nil? # resource path - local_var_path = "/user/createWithArray".sub('{format}','json') + local_var_path = "/user/createWithArray" # query parameters query_params = {} @@ -141,7 +141,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_list_input" if body.nil? # resource path - local_var_path = "/user/createWithList".sub('{format}','json') + local_var_path = "/user/createWithList" # query parameters query_params = {} @@ -191,7 +191,7 @@ module Petstore # verify the required parameter 'username' is set fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" if username.nil? # resource path - local_var_path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username.to_s) + local_var_path = "/user/{username}".sub('{' + 'username' + '}', username.to_s) # query parameters query_params = {} @@ -241,7 +241,7 @@ module Petstore # verify the required parameter 'username' is set fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" if username.nil? # resource path - local_var_path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username.to_s) + local_var_path = "/user/{username}".sub('{' + 'username' + '}', username.to_s) # query parameters query_params = {} @@ -296,7 +296,7 @@ module Petstore # verify the required parameter 'password' is set fail ArgumentError, "Missing the required parameter 'password' when calling UserApi.login_user" if password.nil? # resource path - local_var_path = "/user/login".sub('{format}','json') + local_var_path = "/user/login" # query parameters query_params = {} @@ -345,7 +345,7 @@ module Petstore @api_client.config.logger.debug "Calling API: UserApi.logout_user ..." end # resource path - local_var_path = "/user/logout".sub('{format}','json') + local_var_path = "/user/logout" # query parameters query_params = {} @@ -399,7 +399,7 @@ module Petstore # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.update_user" if body.nil? # resource path - local_var_path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username.to_s) + local_var_path = "/user/{username}".sub('{' + 'username' + '}', username.to_s) # query parameters query_params = {} diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index df2f05d0b64..99b2f1556f4 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -134,7 +134,7 @@ module Petstore # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? + (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. diff --git a/samples/client/petstore/ruby/pom.xml b/samples/client/petstore/ruby/pom.xml index 85b6268cc9e..2e720e226b2 100644 --- a/samples/client/petstore/ruby/pom.xml +++ b/samples/client/petstore/ruby/pom.xml @@ -36,6 +36,8 @@ bundle install + --path + vendor/bundle diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 3e8b4496287..0db8a5c88e6 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -24,6 +24,7 @@ import com.sun.jersey.multipart.file.FileDataBodyPart import java.io.File import java.net.URLEncoder +import java.util.UUID import javax.ws.rs.core.MediaType import scala.collection.JavaConverters._ @@ -66,6 +67,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def escape(value: Long): String = value.toString def escape(value: Double): String = value.toString def escape(value: Float): String = value.toString + def escape(value: UUID): String = value.toString def deserialize(json: String, containerType: String, cls: Class[_]) = { if (cls == classOf[String]) { diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala index 7ddb74d163f..a2badb49ae1 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/ApiResponse.scala @@ -14,7 +14,8 @@ package io.swagger.client.model case class ApiResponse ( - code: Integer, - _type: String, - message: String + code: Option[Integer], + _type: Option[String], + message: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala index 8ec37098e1b..e39d097b918 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala @@ -14,6 +14,7 @@ package io.swagger.client.model case class Category ( - id: Long, - name: String + id: Option[Long], + name: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala index 446455f7657..a88c0ec23d9 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala @@ -15,11 +15,12 @@ package io.swagger.client.model import org.joda.time.DateTime case class Order ( - id: Long, - petId: Long, - quantity: Integer, - shipDate: DateTime, + id: Option[Long], + petId: Option[Long], + quantity: Option[Integer], + shipDate: Option[DateTime], /* Order Status */ - status: String, - complete: Boolean + status: Option[String], + complete: Option[Boolean] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala index fcf1a205081..baabc18c99f 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala @@ -14,11 +14,12 @@ package io.swagger.client.model case class Pet ( - id: Long, - category: Category, + id: Option[Long], + category: Option[Category], name: String, photoUrls: List[String], - tags: List[Tag], + tags: Option[List[Tag]], /* pet status in the store */ - status: String + status: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala index 8abb53e0903..5ae718fd7e8 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala @@ -14,6 +14,7 @@ package io.swagger.client.model case class Tag ( - id: Long, - name: String + id: Option[Long], + name: Option[String] ) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala index 30f58e19b7e..c5bdb386638 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala @@ -14,13 +14,14 @@ package io.swagger.client.model case class User ( - id: Long, - username: String, - firstName: String, - lastName: String, - email: String, - password: String, - phone: String, + id: Option[Long], + username: Option[String], + firstName: Option[String], + lastName: Option[String], + email: Option[String], + password: Option[String], + phone: Option[String], /* User Status */ - userStatus: Integer + userStatus: Option[Integer] ) + diff --git a/samples/client/petstore/scala/src/test/scala/PetApiTest.scala b/samples/client/petstore/scala/src/test/scala/PetApiTest.scala index 426df5871ac..b5ae542a5fe 100644 --- a/samples/client/petstore/scala/src/test/scala/PetApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/PetApiTest.scala @@ -17,22 +17,22 @@ class PetApiTest extends FlatSpec with Matchers { it should "add and fetch a pet" in { val pet = Pet( - 1000, - Category(1, "sold"), + Some(1000), + Some(Category(Some(1), Some("sold"))), "dragon", (for (i <- (1 to 10)) yield "http://foo.com/photo/" + i).toList, - (for (i <- (1 to 5)) yield io.swagger.client.model.Tag(i, "tag-" + i)).toList, - "lost" + Some((for (i <- (1 to 5)) yield io.swagger.client.model.Tag(Some(i), Some("tag-" + i))).toList), + Some("lost") ) api.addPet(pet) api.getPetById(1000) match { case Some(pet) => { - pet.id should be(1000) - pet.tags.size should be(5) - pet.status should be("lost") + pet.id should be(Some(1000)) + pet.tags.get.size should be(5) + pet.status should be(Some("lost")) pet.category should not be (null) - pet.category.name should be("sold") + pet.category.get.name should be(Some("sold")) pet.name should be("dragon") pet.photoUrls.size should be(10) } @@ -42,12 +42,12 @@ class PetApiTest extends FlatSpec with Matchers { it should "update a pet" in { val pet = Pet( - 1000, - Category(1, "sold"), + Some(1000), + Some(Category(Some(1), Some("sold"))), "programmer", (for (i <- (1 to 10)) yield "http://foo.com/photo/" + i).toList, - (for (i <- (1 to 5)) yield io.swagger.client.model.Tag(i, "tag-" + i)).toList, - "confused" + Some((for (i <- (1 to 5)) yield io.swagger.client.model.Tag(Some(i), Some("tag-" + i))).toList), + Some("confused") ) api.addPet(pet) @@ -55,16 +55,16 @@ class PetApiTest extends FlatSpec with Matchers { api.getPetById(1000) match { case Some(pet) => { pet.name should be("programmer") - pet.status should be("confused") + pet.status should be(Some("confused")) } case None => fail("didn't find pet created") } - val updatedPet = pet.copy(status = "fulfilled") + val updatedPet = pet.copy(status = Some("fulfilled")) api.updatePet(updatedPet) api.getPetById(1000) match { case Some(pet) => { pet.name should be("programmer") - pet.status should be("fulfilled") + pet.status should be(Some("fulfilled")) } case None => fail("didn't find pet updated") } @@ -83,8 +83,8 @@ class PetApiTest extends FlatSpec with Matchers { api.findPetsByTags(List("tag1", "tag2")) match { case Some(pets) => { pets.foreach(pet => { - val tags = (for (tag <- pet.tags) yield tag.name).toSet - if ((tags & Set("tag1", "tag2")).size == 0) + val tags = (for (tag <- pet.tags.get) yield tag.name).toSet + if ((tags & Set(Some("tag1"), Some("tag2"))).size == 0) fail("unexpected tags in " + tags) }) } diff --git a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala index b0eac1af66e..4c1a06f1cb6 100644 --- a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala @@ -20,22 +20,22 @@ class StoreApiTest extends FlatSpec with Matchers { it should "place and fetch an order" in { val now = new org.joda.time.DateTime val order = Order( - petId = 10, - id = 1000, - quantity = 101, - status = "pending", - shipDate = now, - complete = true) + petId = Some(10), + id = Some(1000), + quantity = Some(101), + status = Some("pending"), + shipDate = Some(now), + complete = Some(true)) api.placeOrder(order) api.getOrderById(1000) match { case Some(order) => { - order.id should be(1000) - order.petId should be(10) - order.quantity should be(101) + order.id should be(Some(1000)) + order.petId should be(Some(10)) + order.quantity should be(Some(101)) // use `getMillis` to compare across timezones - order.shipDate.getMillis.equals(now.getMillis) should be(true) + order.shipDate.get.getMillis.equals(now.getMillis) should be(true) } case None => fail("didn't find order created") } @@ -44,17 +44,17 @@ class StoreApiTest extends FlatSpec with Matchers { it should "delete an order" in { val now = new org.joda.time.DateTime val order = Order( - id = 1001, - petId = 10, - quantity = 101, - status = "pending", - shipDate = now, - complete = true) + id = Some(1001), + petId = Some(10), + quantity = Some(101), + status = Some("pending"), + shipDate = Some(now), + complete = Some(true)) api.placeOrder(order) api.getOrderById(1001) match { - case Some(order) => order.id should be(1001) + case Some(order) => order.id should be(Some(1001)) case None => fail("didn't find order created") } diff --git a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala index 77614a5dbbb..b47f7002e96 100644 --- a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala @@ -19,14 +19,14 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { // preparation before running a test override def beforeAll() { val user = User( - 11222, - "scala-test-username", - "scala-test-first", - "scala-test-last", - "scala_test@fail.com", - "SCALATEST", - "408-867-5309", - 1) + Some(11222), + Some("scala-test-username"), + Some("scala-test-first"), + Some("scala-test-last"), + Some("scala_test@fail.com"), + Some("SCALATEST"), + Some("408-867-5309"), + Some(1)) api.createUser(user) } @@ -39,14 +39,14 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "fetch a user" in { api.getUserByName("scala-test-username") match { case Some(user) => { - user.id should be(11222) - user.username should be("scala-test-username") - user.password should be("SCALATEST") - user.email should be("scala_test@fail.com") - user.firstName should be("scala-test-first") - user.lastName should be("scala-test-last") - user.phone should be("408-867-5309") - user.userStatus should be(1) + user.id should be(Some(11222)) + user.username should be(Some("scala-test-username")) + user.password should be(Some("SCALATEST")) + user.email should be(Some("scala_test@fail.com")) + user.firstName should be(Some("scala-test-first")) + user.lastName should be(Some("scala-test-last")) + user.phone should be(Some("408-867-5309")) + user.userStatus should be(Some(1)) } case None => } @@ -69,22 +69,22 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "create 2 users" in { val userArray = (for (i <- (1 to 2)) yield { User( - 2000 + i, - "johnny-" + i, - "Johnny", - "Rocket-" + i, - "johnny-" + i + "@fail.com", - "XXXXXXXXXXX", - "408-867-5309", - 1) + Some(2000 + i), + Some("johnny-" + i), + Some("Johnny"), + Some("Rocket-" + i), + Some("johnny-" + i + "@fail.com"), + Some("XXXXXXXXXXX"), + Some("408-867-5309"), + Some(1)) }).toList api.createUsersWithArrayInput(userArray) for (i <- (1 to 2)) { api.getUserByName("johnny-" + i) match { case Some(user) => { - user.id should be(2000 + i) - user.email should be("johnny-" + i + "@fail.com") + user.id should be(Some(2000 + i)) + user.email should be(Some("johnny-" + i + "@fail.com")) } case None => fail("didn't find user " + i) } @@ -94,22 +94,22 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "create 3 users" in { val userList = (for (i <- (1 to 3)) yield { User( - 3000 + i, - "fred-" + i, - "Johnny", - "Rocket-" + i, - "fred-" + i + "@fail.com", - "XXXXXXXXXXX", - "408-867-5309", - 1) + Some(3000 + i), + Some("fred-" + i), + Some("Johnny"), + Some("Rocket-" + i), + Some("fred-" + i + "@fail.com"), + Some("XXXXXXXXXXX"), + Some("408-867-5309"), + Some(1)) }).toList api.createUsersWithListInput(userList) for (i <- (1 to 3)) { api.getUserByName("fred-" + i) match { case Some(user) => { - user.id should be(3000 + i) - user.email should be("fred-" + i + "@fail.com") + user.id should be(Some(3000 + i)) + user.email should be(Some("fred-" + i + "@fail.com")) } case None => fail("didn't find user " + i) } @@ -118,31 +118,31 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "update a user" in { val user = User( - 4000, - "tony", - "Tony", - "Tiger", - "tony@fail.com", - "XXXXXXXXXXX", - "408-867-5309", - 1) + Some(4000), + Some("tony"), + Some("Tony"), + Some("Tiger"), + Some("tony@fail.com"), + Some("XXXXXXXXXXX"), + Some("408-867-5309"), + Some(1)) api.createUser(user) api.getUserByName("tony") match { case Some(user) => { - user.id should be(4000) - user.username should be("tony") + user.id should be(Some(4000)) + user.username should be(Some("tony")) } case None => } - val updatedUser = user.copy(email = "tony@succeed.com") + val updatedUser = user.copy(email = Some("tony@succeed.com")) api.updateUser("tony", updatedUser) api.getUserByName("tony") match { case Some(user) => { - user.email should be("tony@succeed.com") + user.email should be(Some("tony@succeed.com")) } case None => } diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index 722574a2f1c..3fbbe9f7017 100644 --- a/samples/client/petstore/spring-cloud/pom.xml +++ b/samples/client/petstore/spring-cloud/pom.xml @@ -9,7 +9,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 org.springframework.boot @@ -69,4 +69,4 @@ test - + \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java index 6a3e9b8eeb3..3c622693dc5 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -44,12 +45,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -61,6 +62,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", consumes = "application/json", @@ -77,6 +79,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = "application/json", consumes = "application/json", @@ -91,6 +94,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", @@ -108,6 +112,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -123,13 +128,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -140,12 +144,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestParam("file") MultipartFile file); + com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestParam("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java index 49e70ead367..316ca6982bf 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -36,6 +37,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = "application/json", consumes = "application/json", @@ -48,6 +50,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -59,6 +62,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = "application/json", consumes = "application/json", diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java index 4fa2b81aa6a..7e715510dc4 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = "application/json", consumes = "application/json", @@ -33,6 +34,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = "application/json", consumes = "application/json", @@ -43,6 +45,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = "application/json", consumes = "application/json", @@ -54,6 +57,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -66,6 +70,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -77,17 +82,18 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + com.netflix.hystrix.HystrixCommand> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = "application/json", consumes = "application/json", @@ -99,11 +105,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index 2b6bb97460c..1b8b27b8d15 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -44,12 +45,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -61,6 +62,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", consumes = "application/json", @@ -77,6 +79,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = "application/json", consumes = "application/json", @@ -91,6 +94,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/json", @@ -108,6 +112,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = "application/json", consumes = "application/json", @@ -123,13 +128,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -140,12 +144,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java index de152b505c0..4adbf7e7fc0 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -36,6 +37,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = "application/json", consumes = "application/json", @@ -48,6 +50,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", consumes = "application/json", @@ -59,6 +62,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = "application/json", consumes = "application/json", diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index 28c184dabd1..b34e9bb0f77 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = "application/json", consumes = "application/json", @@ -33,6 +34,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = "application/json", consumes = "application/json", @@ -43,6 +45,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = "application/json", consumes = "application/json", @@ -54,6 +57,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -66,6 +70,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", @@ -77,17 +82,18 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = "application/json", consumes = "application/json", @@ -99,11 +105,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index efef8693f78..50ac003dace 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -134,16 +134,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 7, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 4 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 5 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= 123456789 @@ -157,16 +157,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 7, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 4 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 5 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter status: (query) Status values that need to be considered for filter @@ -221,16 +221,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 3, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 9 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= 123456789 @@ -244,16 +244,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 3, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 9 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter tags: (query) Tags to filter by @@ -308,16 +308,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 8 } ], - "status" : "aeiou" + "status" : "available" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -331,16 +331,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 8 } ], - "status" : "aeiou" + "status" : "available" }}] - parameter petId: (path) ID of pet to return @@ -471,7 +471,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 123, + "code" : 9, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index b375d849065..b5a896a0ce8 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -66,7 +66,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 123 + "key" : 5 }}] - returns: RequestBuilder<[String:Int32]> @@ -109,12 +109,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 8, + "quantity" : 9, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -124,12 +124,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 8, + "quantity" : 9, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -175,12 +175,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 6, + "quantity" : 6, + "id" : 7, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -190,12 +190,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 6, + "quantity" : 6, + "id" : 7, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter body: (body) order placed for purchasing the pet diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 9f440aa1a40..6cfcdae7eb5 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -181,9 +181,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 8, "phone" : "aeiou", - "id" : 123456789, + "id" : 6, "email" : "aeiou", "username" : "aeiou" }}] @@ -200,9 +200,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 8, "phone" : "aeiou", - "id" : 123456789, + "id" : 6, "email" : "aeiou", "username" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 801647631e4..66e95afde41 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 7327edd38a9..8bf8b80c398 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -187,16 +187,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 5, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 4 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= 123456789 @@ -210,16 +210,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 5, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 4 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter status: (query) Status values that need to be considered for filter @@ -291,16 +291,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 3 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 8 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= 123456789 @@ -314,16 +314,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 3 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 8 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter tags: (query) Tags to filter by @@ -395,16 +395,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 8 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 7 } ], - "status" : "aeiou" + "status" : "available" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -418,16 +418,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 0, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 8 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 7 } ], - "status" : "aeiou" + "status" : "available" }}] - parameter petId: (path) ID of pet to return @@ -613,7 +613,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 123, + "code" : 7, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 100a6ba86a1..7f06508a09b 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -100,7 +100,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 123 + "key" : 7 }}] - returns: RequestBuilder<[String:Int32]> @@ -160,12 +160,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 6, + "quantity" : 5, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -175,12 +175,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 6, + "quantity" : 5, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -243,12 +243,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 9, + "quantity" : 9, + "id" : 3, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -258,12 +258,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 9, + "quantity" : 9, + "id" : 3, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter body: (body) order placed for purchasing the pet diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 926d7dd546c..d04e93c6d4f 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -267,9 +267,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 5, "phone" : "aeiou", - "id" : 123456789, + "id" : 0, "email" : "aeiou", "username" : "aeiou" }}] @@ -286,9 +286,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 5, "phone" : "aeiou", - "id" : 123456789, + "id" : 0, "email" : "aeiou", "username" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 801647631e4..66e95afde41 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 8e54eb50a69..d203eb5ae2a 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -193,16 +193,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 6, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 6 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 1 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= 123456789 @@ -216,16 +216,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 6, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 6 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 1 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter status: (query) Status values that need to be considered for filter @@ -299,16 +299,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 1 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 2 } ], - "status" : "aeiou" + "status" : "available" } ]}] - examples: [{contentType=application/xml, example= 123456789 @@ -322,16 +322,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example=[ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 2, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 1 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 2 } ], - "status" : "aeiou" + "status" : "available" } ]}] - parameter tags: (query) Tags to filter by @@ -405,16 +405,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 7 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 7 } ], - "status" : "aeiou" + "status" : "available" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -428,16 +428,16 @@ open class PetAPI: APIBase { }, {contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 7 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 7 } ], - "status" : "aeiou" + "status" : "available" }}] - parameter petId: (path) ID of pet to return @@ -629,7 +629,7 @@ open class PetAPI: APIBase { - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "code" : 123, + "code" : 9, "type" : "aeiou", "message" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 023a565e38c..464f5fff1f4 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -104,7 +104,7 @@ open class StoreAPI: APIBase { - type: apiKey api_key - name: api_key - examples: [{contentType=application/json, example={ - "key" : 123 + "key" : 9 }}] - returns: RequestBuilder<[String:Int32]> @@ -166,12 +166,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 0, + "quantity" : 0, + "id" : 2, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -181,12 +181,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 0, + "quantity" : 0, + "id" : 2, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -251,12 +251,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 4, + "quantity" : 3, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - examples: [{contentType=application/xml, example= 123456789 @@ -266,12 +266,12 @@ open class StoreAPI: APIBase { aeiou true }, {contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 4, + "quantity" : 3, + "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }}] - parameter body: (body) order placed for purchasing the pet diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index c4b001d2453..64c9171c386 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -277,9 +277,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 2, "phone" : "aeiou", - "id" : 123456789, + "id" : 7, "email" : "aeiou", "username" : "aeiou" }}] @@ -296,9 +296,9 @@ open class UserAPI: APIBase { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 2, "phone" : "aeiou", - "id" : 123456789, + "id" : 7, "email" : "aeiou", "username" : "aeiou" }}] diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 801647631e4..66e95afde41 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -88,7 +88,7 @@ open class AlamofireRequestBuilder: RequestBuilder { switch encodingResult { case .success(let upload, _, _): if let onProgressReady = self.onProgressReady { - onProgressReady(upload.progress) + onProgressReady(upload.uploadProgress) } self.processRequest(request: upload, managerId, completion) case .failure(let encodingError): diff --git a/samples/client/petstore/tizen/client/SamiApiResponse.h b/samples/client/petstore/tizen/client/SamiApiResponse.h new file mode 100644 index 00000000000..19570f9c1f8 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiApiResponse.h @@ -0,0 +1,59 @@ +/* + * SamiApiResponse.h + * + * Describes the result of uploading an image resource + */ + +#ifndef SamiApiResponse_H_ +#define SamiApiResponse_H_ + +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" + +using namespace Tizen::Web::Json; + + +using Tizen::Base::Integer; +using Tizen::Base::String; + + +namespace Swagger { + +class SamiApiResponse: public SamiObject { +public: + SamiApiResponse(); + SamiApiResponse(String* json); + virtual ~SamiApiResponse(); + + void init(); + + void cleanup(); + + String asJson (); + + JsonObject* asJsonObject(); + + void fromJsonObject(IJsonValue* json); + + SamiApiResponse* fromJson(String* obj); + + Integer* getPCode(); + void setPCode(Integer* pCode); + String* getPType(); + void setPType(String* pType); + String* getPMessage(); + void setPMessage(String* pMessage); + +private: + Integer* pCode; +String* pType; +String* pMessage; +}; + +} /* namespace Swagger */ + +#endif /* SamiApiResponse_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiCategory.h b/samples/client/petstore/tizen/client/SamiCategory.h new file mode 100644 index 00000000000..b29d92e967f --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiCategory.h @@ -0,0 +1,56 @@ +/* + * SamiCategory.h + * + * A category for a pet + */ + +#ifndef SamiCategory_H_ +#define SamiCategory_H_ + +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" + +using namespace Tizen::Web::Json; + + +using Tizen::Base::Long; +using Tizen::Base::String; + + +namespace Swagger { + +class SamiCategory: public SamiObject { +public: + SamiCategory(); + SamiCategory(String* json); + virtual ~SamiCategory(); + + void init(); + + void cleanup(); + + String asJson (); + + JsonObject* asJsonObject(); + + void fromJsonObject(IJsonValue* json); + + SamiCategory* fromJson(String* obj); + + Long* getPId(); + void setPId(Long* pId); + String* getPName(); + void setPName(String* pName); + +private: + Long* pId; +String* pName; +}; + +} /* namespace Swagger */ + +#endif /* SamiCategory_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiOrder.h b/samples/client/petstore/tizen/client/SamiOrder.h new file mode 100644 index 00000000000..5290bd6ef41 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiOrder.h @@ -0,0 +1,71 @@ +/* + * SamiOrder.h + * + * An order for a pets from the pet store + */ + +#ifndef SamiOrder_H_ +#define SamiOrder_H_ + +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" + +using namespace Tizen::Web::Json; + + +using Tizen::Base::Boolean; +using Tizen::Base::DateTime; +using Tizen::Base::Integer; +using Tizen::Base::Long; +using Tizen::Base::String; + + +namespace Swagger { + +class SamiOrder: public SamiObject { +public: + SamiOrder(); + SamiOrder(String* json); + virtual ~SamiOrder(); + + void init(); + + void cleanup(); + + String asJson (); + + JsonObject* asJsonObject(); + + void fromJsonObject(IJsonValue* json); + + SamiOrder* fromJson(String* obj); + + Long* getPId(); + void setPId(Long* pId); + Long* getPPetId(); + void setPPetId(Long* pPetId); + Integer* getPQuantity(); + void setPQuantity(Integer* pQuantity); + DateTime* getPShipDate(); + void setPShipDate(DateTime* pShipDate); + String* getPStatus(); + void setPStatus(String* pStatus); + Boolean* getPComplete(); + void setPComplete(Boolean* pComplete); + +private: + Long* pId; +Long* pPetId; +Integer* pQuantity; +DateTime* pShipDate; +String* pStatus; +Boolean* pComplete; +}; + +} /* namespace Swagger */ + +#endif /* SamiOrder_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiPet.h b/samples/client/petstore/tizen/client/SamiPet.h new file mode 100644 index 00000000000..5c1dddece78 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiPet.h @@ -0,0 +1,71 @@ +/* + * SamiPet.h + * + * A pet for sale in the pet store + */ + +#ifndef SamiPet_H_ +#define SamiPet_H_ + +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" + +using namespace Tizen::Web::Json; + + +#include "SamiCategory.h" +#include "SamiTag.h" +using Tizen::Base::Collection::IList; +using Tizen::Base::Long; +using Tizen::Base::String; + + +namespace Swagger { + +class SamiPet: public SamiObject { +public: + SamiPet(); + SamiPet(String* json); + virtual ~SamiPet(); + + void init(); + + void cleanup(); + + String asJson (); + + JsonObject* asJsonObject(); + + void fromJsonObject(IJsonValue* json); + + SamiPet* fromJson(String* obj); + + Long* getPId(); + void setPId(Long* pId); + SamiCategory* getPCategory(); + void setPCategory(SamiCategory* pCategory); + String* getPName(); + void setPName(String* pName); + IList* getPPhotoUrls(); + void setPPhotoUrls(IList* pPhotoUrls); + IList* getPTags(); + void setPTags(IList* pTags); + String* getPStatus(); + void setPStatus(String* pStatus); + +private: + Long* pId; +SamiCategory* pCategory; +String* pName; +IList* pPhotoUrls; +IList* pTags; +String* pStatus; +}; + +} /* namespace Swagger */ + +#endif /* SamiPet_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiPetApi.h b/samples/client/petstore/tizen/client/SamiPetApi.h new file mode 100644 index 00000000000..89bf5c6da65 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiPetApi.h @@ -0,0 +1,50 @@ +#ifndef SamiPetApi_H_ +#define SamiPetApi_H_ + +#include +#include "SamiApiClient.h" +#include "SamiError.h" + +using Tizen::Base::Long; +#include "SamiApiResponse.h" +#include "SamiFile.h" +#include "SamiPet.h" +using Tizen::Base::String; + +using namespace Tizen::Net::Http; + +namespace Swagger { + +class SamiPetApi { +public: + SamiPetApi(); + virtual ~SamiPetApi(); + + void + addPetWithCompletion(SamiPet* body, void(* handler)(SamiError*)); + void + deletePetWithCompletion(Long* petId, String* apiKey, void(* handler)(SamiError*)); + IList* + findPetsByStatusWithCompletion(IList* status, void (* handler)(IList*, SamiError*)); + IList* + findPetsByTagsWithCompletion(IList* tags, void (* handler)(IList*, SamiError*)); + SamiPet* + getPetByIdWithCompletion(Long* petId, void (* handler)(SamiPet*, SamiError*)); + void + updatePetWithCompletion(SamiPet* body, void(* handler)(SamiError*)); + void + updatePetWithFormWithCompletion(Long* petId, String* name, String* status, void(* handler)(SamiError*)); + SamiApiResponse* + uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void (* handler)(SamiApiResponse*, SamiError*)); + static String getBasePath() { + return L"http://petstore.swagger.io/v2"; + } + +private: + SamiApiClient* client; +}; + + +} /* namespace Swagger */ + +#endif /* SamiPetApi_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiStoreApi.h b/samples/client/petstore/tizen/client/SamiStoreApi.h new file mode 100644 index 00000000000..4c419bf7a87 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiStoreApi.h @@ -0,0 +1,41 @@ +#ifndef SamiStoreApi_H_ +#define SamiStoreApi_H_ + +#include +#include "SamiApiClient.h" +#include "SamiError.h" + +using Tizen::Base::Integer; +using Tizen::Base::Long; +#include "SamiOrder.h" +using Tizen::Base::String; + +using namespace Tizen::Net::Http; + +namespace Swagger { + +class SamiStoreApi { +public: + SamiStoreApi(); + virtual ~SamiStoreApi(); + + void + deleteOrderWithCompletion(String* orderId, void(* handler)(SamiError*)); + HashMap* + getInventoryWithCompletion( void (* handler)(HashMap*, SamiError*)); + SamiOrder* + getOrderByIdWithCompletion(Long* orderId, void (* handler)(SamiOrder*, SamiError*)); + SamiOrder* + placeOrderWithCompletion(SamiOrder* body, void (* handler)(SamiOrder*, SamiError*)); + static String getBasePath() { + return L"http://petstore.swagger.io/v2"; + } + +private: + SamiApiClient* client; +}; + + +} /* namespace Swagger */ + +#endif /* SamiStoreApi_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiTag.h b/samples/client/petstore/tizen/client/SamiTag.h new file mode 100644 index 00000000000..589a23a84c3 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiTag.h @@ -0,0 +1,56 @@ +/* + * SamiTag.h + * + * A tag for a pet + */ + +#ifndef SamiTag_H_ +#define SamiTag_H_ + +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" + +using namespace Tizen::Web::Json; + + +using Tizen::Base::Long; +using Tizen::Base::String; + + +namespace Swagger { + +class SamiTag: public SamiObject { +public: + SamiTag(); + SamiTag(String* json); + virtual ~SamiTag(); + + void init(); + + void cleanup(); + + String asJson (); + + JsonObject* asJsonObject(); + + void fromJsonObject(IJsonValue* json); + + SamiTag* fromJson(String* obj); + + Long* getPId(); + void setPId(Long* pId); + String* getPName(); + void setPName(String* pName); + +private: + Long* pId; +String* pName; +}; + +} /* namespace Swagger */ + +#endif /* SamiTag_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiUser.h b/samples/client/petstore/tizen/client/SamiUser.h new file mode 100644 index 00000000000..6e575eb7bb9 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiUser.h @@ -0,0 +1,75 @@ +/* + * SamiUser.h + * + * A User who is purchasing from the pet store + */ + +#ifndef SamiUser_H_ +#define SamiUser_H_ + +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" + +using namespace Tizen::Web::Json; + + +using Tizen::Base::Integer; +using Tizen::Base::Long; +using Tizen::Base::String; + + +namespace Swagger { + +class SamiUser: public SamiObject { +public: + SamiUser(); + SamiUser(String* json); + virtual ~SamiUser(); + + void init(); + + void cleanup(); + + String asJson (); + + JsonObject* asJsonObject(); + + void fromJsonObject(IJsonValue* json); + + SamiUser* fromJson(String* obj); + + Long* getPId(); + void setPId(Long* pId); + String* getPUsername(); + void setPUsername(String* pUsername); + String* getPFirstName(); + void setPFirstName(String* pFirstName); + String* getPLastName(); + void setPLastName(String* pLastName); + String* getPEmail(); + void setPEmail(String* pEmail); + String* getPPassword(); + void setPPassword(String* pPassword); + String* getPPhone(); + void setPPhone(String* pPhone); + Integer* getPUserStatus(); + void setPUserStatus(Integer* pUserStatus); + +private: + Long* pId; +String* pUsername; +String* pFirstName; +String* pLastName; +String* pEmail; +String* pPassword; +String* pPhone; +Integer* pUserStatus; +}; + +} /* namespace Swagger */ + +#endif /* SamiUser_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiUserApi.h b/samples/client/petstore/tizen/client/SamiUserApi.h new file mode 100644 index 00000000000..f6ae0231e95 --- /dev/null +++ b/samples/client/petstore/tizen/client/SamiUserApi.h @@ -0,0 +1,48 @@ +#ifndef SamiUserApi_H_ +#define SamiUserApi_H_ + +#include +#include "SamiApiClient.h" +#include "SamiError.h" + +using Tizen::Base::Collection::IList; +#include "SamiUser.h" +using Tizen::Base::String; + +using namespace Tizen::Net::Http; + +namespace Swagger { + +class SamiUserApi { +public: + SamiUserApi(); + virtual ~SamiUserApi(); + + void + createUserWithCompletion(SamiUser* body, void(* handler)(SamiError*)); + void + createUsersWithArrayInputWithCompletion(IList* body, void(* handler)(SamiError*)); + void + createUsersWithListInputWithCompletion(IList* body, void(* handler)(SamiError*)); + void + deleteUserWithCompletion(String* username, void(* handler)(SamiError*)); + SamiUser* + getUserByNameWithCompletion(String* username, void (* handler)(SamiUser*, SamiError*)); + String* + loginUserWithCompletion(String* username, String* password, void (* handler)(String*, SamiError*)); + void + logoutUserWithCompletion( void(* handler)(SamiError*)); + void + updateUserWithCompletion(String* username, SamiUser* body, void(* handler)(SamiError*)); + static String getBasePath() { + return L"http://petstore.swagger.io/v2"; + } + +private: + SamiApiClient* client; +}; + + +} /* namespace Swagger */ + +#endif /* SamiUserApi_H_ */ diff --git a/samples/client/petstore/typescript-angular2/default/.gitignore b/samples/client/petstore/typescript-angular2/default/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-angular2/default/.gitignore +++ b/samples/client/petstore/typescript-angular2/default/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/server/petstore/finch/LICENSE b/samples/client/petstore/typescript-angular2/default/LICENSE similarity index 100% rename from samples/server/petstore/finch/LICENSE rename to samples/client/petstore/typescript-angular2/default/LICENSE diff --git a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular2/default/api/pet.service.ts index 6746558021f..13eba85fea5 100644 --- a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/pet.service.ts @@ -211,7 +211,7 @@ export class PetService { * @param body Pet object that needs to be added to the store */ public addPetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -257,7 +257,8 @@ export class PetService { * @param apiKey */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -305,7 +306,7 @@ export class PetService { * @param status Status values that need to be considered for filter */ public findPetsByStatusWithHttpInfo(status?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByStatus`; + const path = this.basePath + '/pet/findByStatus'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -353,7 +354,7 @@ export class PetService { * @param tags Tags to filter by */ public findPetsByTagsWithHttpInfo(tags?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByTags`; + const path = this.basePath + '/pet/findByTags'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -401,7 +402,8 @@ export class PetService { * @param petId ID of pet that needs to be fetched */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -452,7 +454,7 @@ export class PetService { * @param body Pet object that needs to be added to the store */ public updatePetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -499,7 +501,8 @@ export class PetService { * @param status Updated status of the pet */ public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -565,7 +568,8 @@ export class PetService { * @param file file to upload */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}/uploadImage`; + const path = this.basePath + '/pet/${petId}/uploadImage' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/store.service.ts b/samples/client/petstore/typescript-angular2/default/api/store.service.ts index b7d2fbf66ae..0cb0daf846f 100644 --- a/samples/client/petstore/typescript-angular2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/store.service.ts @@ -141,7 +141,8 @@ export class StoreService { * @param orderId ID of the order that needs to be deleted */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -177,7 +178,7 @@ export class StoreService { * Returns a map of status codes to quantities */ public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/inventory`; + const path = this.basePath + '/store/inventory'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -215,7 +216,8 @@ export class StoreService { * @param orderId ID of pet that needs to be fetched */ public getOrderByIdWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -252,7 +254,7 @@ export class StoreService { * @param body order placed for purchasing the pet */ public placeOrderWithHttpInfo(body?: Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order`; + const path = this.basePath + '/store/order'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/user.service.ts b/samples/client/petstore/typescript-angular2/default/api/user.service.ts index 78c0ce2e8eb..a18694e7fa0 100644 --- a/samples/client/petstore/typescript-angular2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/user.service.ts @@ -207,7 +207,7 @@ export class UserService { * @param body Created user object */ public createUserWithHttpInfo(body?: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user`; + const path = this.basePath + '/user'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -243,7 +243,7 @@ export class UserService { * @param body List of user object */ public createUsersWithArrayInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithArray`; + const path = this.basePath + '/user/createWithArray'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -279,7 +279,7 @@ export class UserService { * @param body List of user object */ public createUsersWithListInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithList`; + const path = this.basePath + '/user/createWithList'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -315,7 +315,8 @@ export class UserService { * @param username The name that needs to be deleted */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -352,7 +353,8 @@ export class UserService { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -390,25 +392,17 @@ export class UserService { * @param password The password for login in clear text */ public loginUserWithHttpInfo(username?: string, password?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/login`; + const path = this.basePath + '/user/login'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (username !== undefined) { - if(username instanceof Date) { - queryParameters.set('username', username.d.toISOString()); - } else { - queryParameters.set('username', username); - } + queryParameters.set('username', username); } if (password !== undefined) { - if(password instanceof Date) { - queryParameters.set('password', password.d.toISOString()); - } else { - queryParameters.set('password', password); - } + queryParameters.set('password', password); } @@ -438,7 +432,7 @@ export class UserService { * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/logout`; + const path = this.basePath + '/user/logout'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -472,7 +466,8 @@ export class UserService { * @param body Updated user object */ public updateUserWithHttpInfo(username: string, body?: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/.gitignore b/samples/client/petstore/typescript-angular2/npm/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-angular2/npm/.gitignore +++ b/samples/client/petstore/typescript-angular2/npm/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index b46649ebbcd..b92e4be434d 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -1,4 +1,4 @@ -## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703131805 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703132058 ### Building @@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's. _published:_ ``` -npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703131805 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703132058 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts index 6746558021f..13eba85fea5 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts @@ -211,7 +211,7 @@ export class PetService { * @param body Pet object that needs to be added to the store */ public addPetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -257,7 +257,8 @@ export class PetService { * @param apiKey */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -305,7 +306,7 @@ export class PetService { * @param status Status values that need to be considered for filter */ public findPetsByStatusWithHttpInfo(status?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByStatus`; + const path = this.basePath + '/pet/findByStatus'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -353,7 +354,7 @@ export class PetService { * @param tags Tags to filter by */ public findPetsByTagsWithHttpInfo(tags?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByTags`; + const path = this.basePath + '/pet/findByTags'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -401,7 +402,8 @@ export class PetService { * @param petId ID of pet that needs to be fetched */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -452,7 +454,7 @@ export class PetService { * @param body Pet object that needs to be added to the store */ public updatePetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -499,7 +501,8 @@ export class PetService { * @param status Updated status of the pet */ public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -565,7 +568,8 @@ export class PetService { * @param file file to upload */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}/uploadImage`; + const path = this.basePath + '/pet/${petId}/uploadImage' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular2/npm/api/store.service.ts index b7d2fbf66ae..0cb0daf846f 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/store.service.ts @@ -141,7 +141,8 @@ export class StoreService { * @param orderId ID of the order that needs to be deleted */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -177,7 +178,7 @@ export class StoreService { * Returns a map of status codes to quantities */ public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/inventory`; + const path = this.basePath + '/store/inventory'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -215,7 +216,8 @@ export class StoreService { * @param orderId ID of pet that needs to be fetched */ public getOrderByIdWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -252,7 +254,7 @@ export class StoreService { * @param body order placed for purchasing the pet */ public placeOrderWithHttpInfo(body?: Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order`; + const path = this.basePath + '/store/order'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular2/npm/api/user.service.ts index 78c0ce2e8eb..a18694e7fa0 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/user.service.ts @@ -207,7 +207,7 @@ export class UserService { * @param body Created user object */ public createUserWithHttpInfo(body?: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user`; + const path = this.basePath + '/user'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -243,7 +243,7 @@ export class UserService { * @param body List of user object */ public createUsersWithArrayInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithArray`; + const path = this.basePath + '/user/createWithArray'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -279,7 +279,7 @@ export class UserService { * @param body List of user object */ public createUsersWithListInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithList`; + const path = this.basePath + '/user/createWithList'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -315,7 +315,8 @@ export class UserService { * @param username The name that needs to be deleted */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -352,7 +353,8 @@ export class UserService { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -390,25 +392,17 @@ export class UserService { * @param password The password for login in clear text */ public loginUserWithHttpInfo(username?: string, password?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/login`; + const path = this.basePath + '/user/login'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (username !== undefined) { - if(username instanceof Date) { - queryParameters.set('username', username.d.toISOString()); - } else { - queryParameters.set('username', username); - } + queryParameters.set('username', username); } if (password !== undefined) { - if(password instanceof Date) { - queryParameters.set('password', password.d.toISOString()); - } else { - queryParameters.set('password', password); - } + queryParameters.set('password', password); } @@ -438,7 +432,7 @@ export class UserService { * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/logout`; + const path = this.basePath + '/user/logout'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -472,7 +466,8 @@ export class UserService { * @param body Updated user object */ public updateUserWithHttpInfo(username: string, body?: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index 1665b2f9743..be3f2281b9e 100644 --- a/samples/client/petstore/typescript-angular2/npm/package.json +++ b/samples/client/petstore/typescript-angular2/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201703131805", + "version": "0.0.1-SNAPSHOT.201703132058", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [ diff --git a/samples/html/index.html b/samples/html/index.html index 2230ecbbfd4..57726e2ecf8 100644 --- a/samples/html/index.html +++ b/samples/html/index.html @@ -356,18 +356,18 @@ font-style: italic;

Example data

Content-Type: application/json
[ {
-  "photoUrls" : [ "aeiou" ],
-  "name" : "doggie",
-  "id" : 123456789,
-  "category" : {
-    "name" : "aeiou",
-    "id" : 123456789
-  },
   "tags" : [ {
-    "name" : "aeiou",
-    "id" : 123456789
+    "id" : 7,
+    "name" : "aeiou"
   } ],
-  "status" : "aeiou"
+  "id" : 2,
+  "category" : {
+    "id" : 2,
+    "name" : "aeiou"
+  },
+  "status" : "available",
+  "name" : "doggie",
+  "photoUrls" : [ "aeiou" ]
 } ]

Produces

@@ -429,18 +429,18 @@ font-style: italic;

Example data

Content-Type: application/json
[ {
-  "photoUrls" : [ "aeiou" ],
-  "name" : "doggie",
-  "id" : 123456789,
-  "category" : {
-    "name" : "aeiou",
-    "id" : 123456789
-  },
   "tags" : [ {
-    "name" : "aeiou",
-    "id" : 123456789
+    "id" : 1,
+    "name" : "aeiou"
   } ],
-  "status" : "aeiou"
+  "id" : 9,
+  "category" : {
+    "id" : 4,
+    "name" : "aeiou"
+  },
+  "status" : "available",
+  "name" : "doggie",
+  "photoUrls" : [ "aeiou" ]
 } ]

Produces

@@ -502,18 +502,18 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "photoUrls" : [ "aeiou" ],
-  "name" : "doggie",
-  "id" : 123456789,
-  "category" : {
-    "name" : "aeiou",
-    "id" : 123456789
-  },
   "tags" : [ {
-    "name" : "aeiou",
-    "id" : 123456789
+    "id" : 5,
+    "name" : "aeiou"
   } ],
-  "status" : "aeiou"
+  "id" : 8,
+  "category" : {
+    "id" : 3,
+    "name" : "aeiou"
+  },
+  "status" : "available",
+  "name" : "doggie",
+  "photoUrls" : [ "aeiou" ]
 }

Produces

@@ -679,9 +679,9 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "code" : 123,
-  "type" : "aeiou",
-  "message" : "aeiou"
+  "message" : "aeiou",
+  "code" : 3,
+  "type" : "aeiou"
 }

Produces

@@ -762,7 +762,7 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "key" : 123
+  "key" : 9
 }

Produces

@@ -818,12 +818,12 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "petId" : 123456789,
-  "quantity" : 123,
-  "id" : 123456789,
-  "shipDate" : "2000-01-23T04:56:07.000+00:00",
-  "complete" : true,
-  "status" : "aeiou"
+  "id" : 5,
+  "petId" : 8,
+  "complete" : false,
+  "status" : "placed",
+  "quantity" : 4,
+  "shipDate" : "2000-01-23T04:56:07.000+00:00"
 }

Produces

@@ -887,12 +887,12 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "petId" : 123456789,
-  "quantity" : 123,
-  "id" : 123456789,
-  "shipDate" : "2000-01-23T04:56:07.000+00:00",
-  "complete" : true,
-  "status" : "aeiou"
+  "id" : 6,
+  "petId" : 9,
+  "complete" : false,
+  "status" : "placed",
+  "quantity" : 2,
+  "shipDate" : "2000-01-23T04:56:07.000+00:00"
 }

Produces

@@ -946,7 +946,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation @@ -984,7 +984,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation @@ -1022,7 +1022,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation @@ -1109,14 +1109,14 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "firstName" : "aeiou",
+  "id" : 4,
   "lastName" : "aeiou",
-  "password" : "aeiou",
-  "userStatus" : 123,
   "phone" : "aeiou",
-  "id" : 123456789,
+  "username" : "aeiou",
   "email" : "aeiou",
-  "username" : "aeiou"
+  "userStatus" : 1,
+  "firstName" : "aeiou",
+  "password" : "aeiou"
 }

Produces

@@ -1218,7 +1218,7 @@ font-style: italic;

Responses

-

0

+

default

successful operation @@ -1271,22 +1271,21 @@ font-style: italic;
-

Models

[ Jump to Methods ]

Table of Contents

    -
  1. ApiResponse
  2. -
  3. Category
  4. -
  5. Order
  6. -
  7. Pet
  8. -
  9. Tag
  10. -
  11. User
  12. +
  13. ApiResponse - An uploaded response
  14. +
  15. Category - Pet catehgry
  16. +
  17. Order - Pet Order
  18. +
  19. Pet - a Pet
  20. +
  21. Tag - Pet Tag
  22. +
  23. User - a User
-

ApiResponse - An uploaded response Up

+

ApiResponse - An uploaded response Up

Describes the result of uploading an image resource
code (optional)
Integer format: int32
@@ -1295,7 +1294,7 @@ font-style: italic;
-

Category - Pet catehgry Up

+

Category - Pet catehgry Up

A category for a pet
id (optional)
Long format: int64
@@ -1303,7 +1302,7 @@ font-style: italic;
-

Order - Pet Order Up

+

Order - Pet Order Up

An order for a pets from the pet store
id (optional)
Long format: int64
@@ -1317,7 +1316,7 @@ font-style: italic;
-

Pet - a Pet Up

+

Pet - a Pet Up

A pet for sale in the pet store
id (optional)
Long format: int64
@@ -1331,7 +1330,7 @@ font-style: italic;
-

Tag - Pet Tag Up

+

Tag - Pet Tag Up

A tag for a pet
id (optional)
Long format: int64
@@ -1339,7 +1338,7 @@ font-style: italic;
-

User - a User Up

+

User - a User Up

A User who is purchasing from the pet store
id (optional)
Long format: int64
diff --git a/samples/html2/index.html b/samples/html2/index.html index 3e8795ff115..d4754c0d84c 100644 --- a/samples/html2/index.html +++ b/samples/html2/index.html @@ -1266,6 +1266,12 @@ except ApiException as e:

Responses

Status: 405 - Invalid input

+ + +
+
+

@@ -1595,6 +1601,12 @@ except ApiException as e:

Responses

Status: 400 - Invalid pet value

+ + +
+
+

@@ -1888,18 +1900,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid status value

+ + +
+
+
@@ -2224,18 +2242,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid tag value

+ + +
+
+
@@ -2571,18 +2595,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Pet not found

+ + +
+
+
@@ -2904,10 +2940,28 @@ except ApiException as e:

Responses

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Pet not found

+ + +
+
+

Status: 405 - Validation exception

+ + +
+
+
@@ -3280,6 +3334,12 @@ except ApiException as e:

Responses

Status: 405 - Invalid input

+ + +
+
+
@@ -3661,18 +3721,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +
@@ -3955,8 +4015,20 @@ except ApiException as e:

Responses

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Order not found

+ + +
+
+
@@ -4208,18 +4280,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +
@@ -4515,18 +4587,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid ID supplied

+ + +
+
+

Status: 404 - Order not found

+ + +
+
+
@@ -4830,18 +4914,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid Order

+ + +
+
+
@@ -5135,7 +5225,13 @@ except ApiException as e:

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

+ + + +
+
@@ -5400,7 +5496,13 @@ except ApiException as e:

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

+ + + +
+
@@ -5665,7 +5767,13 @@ except ApiException as e:

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

+ + + +
+
@@ -5918,8 +6026,20 @@ except ApiException as e:

Responses

Status: 400 - Invalid username supplied

+ + +
+
+

Status: 404 - User not found

+ + +
+
+
@@ -6180,18 +6300,17 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+ +

Status: 400 - Invalid username supplied

+ + +
+
+

Status: 404 - User not found

+ + +
+
+
@@ -6527,18 +6659,20 @@ except ApiException as e:

Responses

Status: 200 - successful operation

- -
-
-
- -
- +
-
+
+ + + + + + + + + + + + + + + + + + + +
NameTypeFormatDescription
X-Rate-LimitIntegerint32calls per hour allowed by the user
X-Expires-AfterDatedate-timedate in UTC when toekn expires
+
+ +

Status: 400 - Invalid username/password supplied

+ + +
+
+
@@ -6780,7 +6943,13 @@ except ApiException as e:

Responses

-

Status: 0 - successful operation

+

Status: default - successful operation

+ + + +
+
@@ -7094,8 +7263,20 @@ except ApiException as e:

Responses

Status: 400 - Invalid user supplied

+ + +
+
+

Status: 404 - User not found

+ + +
+
+
@@ -7112,7 +7293,7 @@ except ApiException as e:
- Generated 2017-03-13T18:03:30.112+01:00 + Generated 2017-03-13T21:00:41.149+01:00
diff --git a/samples/server/petstore/finch/src/main/scala/DataAccessor.scala b/samples/server/petstore/finch/src/main/scala/DataAccessor.scala index 83aa56a1468..4c9d06b2ea9 100644 --- a/samples/server/petstore/finch/src/main/scala/DataAccessor.scala +++ b/samples/server/petstore/finch/src/main/scala/DataAccessor.scala @@ -1,10 +1,10 @@ -package io.swagger.petstore +package io.swagger // TODO: properly handle custom imports import java.io._ import java.util.Date -import io.swagger.petstore.models._ +import io.swagger.models._ trait DataAccessor { // TODO: apiInfo -> apis -> operations = ??? diff --git a/samples/server/petstore/finch/src/main/scala/Server.scala b/samples/server/petstore/finch/src/main/scala/Server.scala index f5f4957b069..ec3ed482e27 100644 --- a/samples/server/petstore/finch/src/main/scala/Server.scala +++ b/samples/server/petstore/finch/src/main/scala/Server.scala @@ -1,4 +1,4 @@ -package io.swagger.petstore +package io.swagger import io.finch._ import io.finch.circe._ @@ -14,7 +14,7 @@ import com.twitter.util.{Await, Future} class Server { - // Loads implementation defined in resources/META-INF/services/io.swagger.petstore.DataAccessor + // Loads implementation defined in resources/META-INF/services/io.swagger.DataAccessor val db = LoadService[DataAccessor]() match { case accessor :: _ => accessor case _ => new DataAccessor { } diff --git a/samples/server/petstore/finch/src/main/scala/endpoint.scala b/samples/server/petstore/finch/src/main/scala/endpoint.scala index 6c914c131f0..5241b51bbd8 100644 --- a/samples/server/petstore/finch/src/main/scala/endpoint.scala +++ b/samples/server/petstore/finch/src/main/scala/endpoint.scala @@ -1,4 +1,4 @@ -package io.swagger.petstore +package io.swagger import com.twitter.finagle.Service import com.twitter.finagle.http.{Request, Response} @@ -9,7 +9,7 @@ import io.circe.{Encoder, Json} import io.finch.circe._ import io.circe.generic.semiauto._ -import io.swagger.petstore.apis._ +import io.swagger.apis._ /** * Provides the paths and endpoints for all the API's public service methods. diff --git a/samples/server/petstore/finch/src/main/scala/errors.scala b/samples/server/petstore/finch/src/main/scala/errors.scala index 69e3831c15d..162549e0f23 100644 --- a/samples/server/petstore/finch/src/main/scala/errors.scala +++ b/samples/server/petstore/finch/src/main/scala/errors.scala @@ -1,4 +1,4 @@ -package io.swagger.petstore +package io.swagger /** * The parent error from which most PetstoreAPI errors extend. Thrown whenever something in the api goes wrong. diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala new file mode 100644 index 00000000000..74a01c56f51 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala @@ -0,0 +1,149 @@ +package io.swagger.apis + +import java.io._ +import java.util.Date +import io.swagger._ +import io.swagger.models._ +import io.swagger.models.ApiResponse +import java.io.File +import io.swagger.models.Pet +import io.finch.circe._ +import io.circe.generic.semiauto._ +import com.twitter.concurrent.AsyncStream +import com.twitter.finagle.Service +import com.twitter.finagle.Http +import com.twitter.finagle.http.{Request, Response} +import com.twitter.finagle.http.exp.Multipart.{FileUpload, InMemoryFileUpload, OnDiskFileUpload} +import com.twitter.util.Future +import com.twitter.io.Buf +import io.finch._, items._ +import java.io.File + +object PetApi { + /** + * Compiles all service endpoints. + * @return Bundled compilation of all service endpoints. + */ + def endpoints(da: DataAccessor) = + addPet(da) :+: + deletePet(da) :+: + findPetsByStatus(da) :+: + findPetsByTags(da) :+: + getPetById(da) :+: + updatePet(da) :+: + updatePetWithForm(da) :+: + uploadFile(da) + + /** + * + * @return And endpoint representing a Unit + */ + private def addPet(da: DataAccessor): Endpoint[Unit] = + post("pet" :: jsonBody[Pet]) { (body: Pet) => + da.Pet_addPet(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def deletePet(da: DataAccessor): Endpoint[Unit] = + delete("pet" :: long :: string) { (petId: Long, apiKey: String) => + da.Pet_deletePet(petId, apiKey) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Seq[Pet] + */ + private def findPetsByStatus(da: DataAccessor): Endpoint[Seq[Pet]] = + get("pet" :: "findByStatus" :: params("status")) { (status: Seq[String]) => + Ok(da.Pet_findPetsByStatus(status)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Seq[Pet] + */ + private def findPetsByTags(da: DataAccessor): Endpoint[Seq[Pet]] = + get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => + Ok(da.Pet_findPetsByTags(tags)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Pet + */ + private def getPetById(da: DataAccessor): Endpoint[Pet] = + get("pet" :: long ) { (petId: Long) => + Ok(da.Pet_getPetById(petId)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def updatePet(da: DataAccessor): Endpoint[Unit] = + put("pet" :: jsonBody[Pet]) { (body: Pet) => + da.Pet_updatePet(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def updatePetWithForm(da: DataAccessor): Endpoint[Unit] = + post("pet" :: long :: string :: string) { (petId: Long, name: String, status: String) => + da.Pet_updatePetWithForm(petId, name, status) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a ApiResponse + */ + private def uploadFile(da: DataAccessor): Endpoint[ApiResponse] = + post("pet" :: long :: "uploadImage" :: string :: fileUpload("file")) { (petId: Long, additionalMetadata: String, file: FileUpload) => + Ok(da.Pet_uploadFile(petId, additionalMetadata, file)) + } handle { + case e: Exception => BadRequest(e) + } + + + implicit private def fileUploadToFile(fileUpload: FileUpload) : File = { + fileUpload match { + case upload: InMemoryFileUpload => + bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) + case upload: OnDiskFileUpload => + upload.content + case _ => null + } + } + + private def bytesToFile(input: Array[Byte]): java.io.File = { + val file = File.createTempFile("tmpPetApi", null) + val output = new FileOutputStream(file) + output.write(input) + file + } + + // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. + implicit def seqList[A](input: Seq[A]): List[A] = input.toList +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala new file mode 100644 index 00000000000..02186ce1f65 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala @@ -0,0 +1,96 @@ +package io.swagger.apis + +import java.io._ +import java.util.Date +import io.swagger._ +import io.swagger.models._ +import io.swagger.models.Order +import io.finch.circe._ +import io.circe.generic.semiauto._ +import com.twitter.concurrent.AsyncStream +import com.twitter.finagle.Service +import com.twitter.finagle.Http +import com.twitter.finagle.http.{Request, Response} +import com.twitter.finagle.http.exp.Multipart.{FileUpload, InMemoryFileUpload, OnDiskFileUpload} +import com.twitter.util.Future +import com.twitter.io.Buf +import io.finch._, items._ +import java.io.File + +object StoreApi { + /** + * Compiles all service endpoints. + * @return Bundled compilation of all service endpoints. + */ + def endpoints(da: DataAccessor) = + deleteOrder(da) :+: + getInventory(da) :+: + getOrderById(da) :+: + placeOrder(da) + + /** + * + * @return And endpoint representing a Unit + */ + private def deleteOrder(da: DataAccessor): Endpoint[Unit] = + delete("store" :: "order" :: string ) { (orderId: String) => + da.Store_deleteOrder(orderId) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Map[String, Int] + */ + private def getInventory(da: DataAccessor): Endpoint[Map[String, Int]] = + get("store" :: "inventory" ) { + Ok(da.Store_getInventory()) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Order + */ + private def getOrderById(da: DataAccessor): Endpoint[Order] = + get("store" :: "order" :: long ) { (orderId: Long) => + Ok(da.Store_getOrderById(orderId)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Order + */ + private def placeOrder(da: DataAccessor): Endpoint[Order] = + post("store" :: "order" :: jsonBody[Order]) { (body: Order) => + Ok(da.Store_placeOrder(body)) + } handle { + case e: Exception => BadRequest(e) + } + + + implicit private def fileUploadToFile(fileUpload: FileUpload) : File = { + fileUpload match { + case upload: InMemoryFileUpload => + bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) + case upload: OnDiskFileUpload => + upload.content + case _ => null + } + } + + private def bytesToFile(input: Array[Byte]): java.io.File = { + val file = File.createTempFile("tmpStoreApi", null) + val output = new FileOutputStream(file) + output.write(input) + file + } + + // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. + implicit def seqList[A](input: Seq[A]): List[A] = input.toList +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala new file mode 100644 index 00000000000..dfb49b4291a --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala @@ -0,0 +1,150 @@ +package io.swagger.apis + +import java.io._ +import java.util.Date +import io.swagger._ +import io.swagger.models._ +import scala.collection.immutable.Seq +import io.swagger.models.User +import io.finch.circe._ +import io.circe.generic.semiauto._ +import com.twitter.concurrent.AsyncStream +import com.twitter.finagle.Service +import com.twitter.finagle.Http +import com.twitter.finagle.http.{Request, Response} +import com.twitter.finagle.http.exp.Multipart.{FileUpload, InMemoryFileUpload, OnDiskFileUpload} +import com.twitter.util.Future +import com.twitter.io.Buf +import io.finch._, items._ +import java.io.File + +object UserApi { + /** + * Compiles all service endpoints. + * @return Bundled compilation of all service endpoints. + */ + def endpoints(da: DataAccessor) = + createUser(da) :+: + createUsersWithArrayInput(da) :+: + createUsersWithListInput(da) :+: + deleteUser(da) :+: + getUserByName(da) :+: + loginUser(da) :+: + logoutUser(da) :+: + updateUser(da) + + /** + * + * @return And endpoint representing a Unit + */ + private def createUser(da: DataAccessor): Endpoint[Unit] = + post("user" :: jsonBody[User]) { (body: User) => + da.User_createUser(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def createUsersWithArrayInput(da: DataAccessor): Endpoint[Unit] = + post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + da.User_createUsersWithArrayInput(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def createUsersWithListInput(da: DataAccessor): Endpoint[Unit] = + post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + da.User_createUsersWithListInput(body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def deleteUser(da: DataAccessor): Endpoint[Unit] = + delete("user" :: string ) { (username: String) => + da.User_deleteUser(username) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a User + */ + private def getUserByName(da: DataAccessor): Endpoint[User] = + get("user" :: string ) { (username: String) => + Ok(da.User_getUserByName(username)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a String + */ + private def loginUser(da: DataAccessor): Endpoint[String] = + get("user" :: "login" :: string :: string) { (username: String, password: String) => + Ok(da.User_loginUser(username, password)) + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def logoutUser(da: DataAccessor): Endpoint[Unit] = + get("user" :: "logout" ) { + da.User_logoutUser() + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + /** + * + * @return And endpoint representing a Unit + */ + private def updateUser(da: DataAccessor): Endpoint[Unit] = + put("user" :: string :: jsonBody[User]) { (username: String, body: User) => + da.User_updateUser(username, body) + NoContent[Unit] + } handle { + case e: Exception => BadRequest(e) + } + + + implicit private def fileUploadToFile(fileUpload: FileUpload) : File = { + fileUpload match { + case upload: InMemoryFileUpload => + bytesToFile(Buf.ByteArray.Owned.extract(upload.content)) + case upload: OnDiskFileUpload => + upload.content + case _ => null + } + } + + private def bytesToFile(input: Array[Byte]): java.io.File = { + val file = File.createTempFile("tmpUserApi", null) + val output = new FileOutputStream(file) + output.write(input) + file + } + + // This assists in params(string) application (which must be Seq[A] in parameter list) when the param is used as a List[A] elsewhere. + implicit def seqList[A](input: Seq[A]): List[A] = input.toList +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/ApiResponse.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/ApiResponse.scala new file mode 100644 index 00000000000..9e603aadec6 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/ApiResponse.scala @@ -0,0 +1,26 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * Describes the result of uploading an image resource + * @param code + * @param _type + * @param message + */ +case class ApiResponse(code: Option[Int], + _type: Option[String], + message: Option[String] + ) + +object ApiResponse { + /** + * Creates the codec for converting ApiResponse from and to JSON. + */ + implicit val decoder: Decoder[ApiResponse] = deriveDecoder + implicit val encoder: ObjectEncoder[ApiResponse] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Category.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Category.scala new file mode 100644 index 00000000000..be697aa298e --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Category.scala @@ -0,0 +1,24 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * A category for a pet + * @param id + * @param name + */ +case class Category(id: Option[Long], + name: Option[String] + ) + +object Category { + /** + * Creates the codec for converting Category from and to JSON. + */ + implicit val decoder: Decoder[Category] = deriveDecoder + implicit val encoder: ObjectEncoder[Category] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Order.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Order.scala new file mode 100644 index 00000000000..2934ee921b3 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Order.scala @@ -0,0 +1,33 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ +import java.time.LocalDateTime + +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +case class Order(id: Option[Long], + petId: Option[Long], + quantity: Option[Int], + shipDate: Option[LocalDateTime], + status: Option[String], + complete: Option[Boolean] + ) + +object Order { + /** + * Creates the codec for converting Order from and to JSON. + */ + implicit val decoder: Decoder[Order] = deriveDecoder + implicit val encoder: ObjectEncoder[Order] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Pet.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Pet.scala new file mode 100644 index 00000000000..e78617c7db8 --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Pet.scala @@ -0,0 +1,35 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ +import io.swagger.models.Category +import io.swagger.models.Tag +import scala.collection.immutable.Seq + +/** + * A pet for sale in the pet store + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ +case class Pet(id: Option[Long], + category: Option[Category], + name: String, + photoUrls: Seq[String], + tags: Option[Seq[Tag]], + status: Option[String] + ) + +object Pet { + /** + * Creates the codec for converting Pet from and to JSON. + */ + implicit val decoder: Decoder[Pet] = deriveDecoder + implicit val encoder: ObjectEncoder[Pet] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/Tag.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Tag.scala new file mode 100644 index 00000000000..242ffcfc86e --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/Tag.scala @@ -0,0 +1,24 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * A tag for a pet + * @param id + * @param name + */ +case class Tag(id: Option[Long], + name: Option[String] + ) + +object Tag { + /** + * Creates the codec for converting Tag from and to JSON. + */ + implicit val decoder: Decoder[Tag] = deriveDecoder + implicit val encoder: ObjectEncoder[Tag] = deriveEncoder +} diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/models/User.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/models/User.scala new file mode 100644 index 00000000000..18253b5deae --- /dev/null +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/models/User.scala @@ -0,0 +1,36 @@ +package io.swagger.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import io.swagger._ + +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +case class User(id: Option[Long], + username: Option[String], + firstName: Option[String], + lastName: Option[String], + email: Option[String], + password: Option[String], + phone: Option[String], + userStatus: Option[Int] + ) + +object User { + /** + * Creates the codec for converting User from and to JSON. + */ + implicit val decoder: Decoder[User] = deriveDecoder + implicit val encoder: ObjectEncoder[User] = deriveEncoder +} diff --git a/samples/server/petstore/flaskConnexion-python2/README.md b/samples/server/petstore/flaskConnexion-python2/README.md index 5352812b279..7e38f10f770 100644 --- a/samples/server/petstore/flaskConnexion-python2/README.md +++ b/samples/server/petstore/flaskConnexion-python2/README.md @@ -7,6 +7,10 @@ is an example of building a swagger-enabled Flask server. This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. +## Requirements +Python 2.7+ + +## Usage To run the server, please execute the following from the root directory: ``` diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml index 92590b31bc1..a12fa87d872 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" responses: 200: diff --git a/samples/server/petstore/flaskConnexion/README.md b/samples/server/petstore/flaskConnexion/README.md index 32f6b03b0e0..9effb404b08 100644 --- a/samples/server/petstore/flaskConnexion/README.md +++ b/samples/server/petstore/flaskConnexion/README.md @@ -7,6 +7,10 @@ is an example of building a swagger-enabled Flask server. This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. +## Requirements +Python 3.5.2+ + +## Usage To run the server, please execute the following from the root directory: ``` diff --git a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml index 92590b31bc1..a12fa87d872 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" responses: 200: diff --git a/samples/server/petstore/go-api-server/go/README.md b/samples/server/petstore/go-api-server/go/README.md index b8846a07424..acae960902e 100644 --- a/samples/server/petstore/go-api-server/go/README.md +++ b/samples/server/petstore/go-api-server/go/README.md @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 -- Build date: 2017-03-13T18:03:25.386+01:00 +- Build date: 2017-03-13T21:03:08.652+01:00 ### Running the server diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java index f3a2e55988b..0ef6feff4a4 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/handler/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.handler; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index e332b1d757f..6c3a35fa9fd 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,7 +13,7 @@ import java.util.Map; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class AdditionalPropertiesClass { @JsonProperty("map_property") private Map mapProperty = new HashMap(); @@ -29,7 +29,7 @@ public class AdditionalPropertiesClass { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("map_property") public Map getMapProperty() { return mapProperty; @@ -46,7 +46,7 @@ public class AdditionalPropertiesClass { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("map_of_map_property") public Map> getMapOfMapProperty() { return mapOfMapProperty; @@ -57,7 +57,7 @@ public class AdditionalPropertiesClass { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -89,7 +89,7 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java index 7191d6af011..79ea4119367 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Animal.java @@ -12,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Animal { @JsonProperty("className") private String className = null; @@ -28,7 +28,7 @@ public class Animal { } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("className") public String getClassName() { return className; @@ -45,7 +45,7 @@ public class Animal { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("color") public String getColor() { return color; @@ -56,7 +56,7 @@ public class Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -88,7 +88,7 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java index a50abc9fa32..534b8facf3a 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/AnimalFarm.java @@ -9,11 +9,11 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class AnimalFarm extends ArrayList { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -42,7 +42,7 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 58ba3280abf..2f4bb390579 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList>(); @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; @@ -37,7 +37,7 @@ public class ArrayOfArrayOfNumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -67,7 +67,7 @@ public class ArrayOfArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 4934e000ba5..470a4b7b74c 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") private List arrayNumber = new ArrayList(); @@ -26,7 +26,7 @@ public class ArrayOfNumberOnly { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; @@ -37,7 +37,7 @@ public class ArrayOfNumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -67,7 +67,7 @@ public class ArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java index 8b8e800e2a5..b541649810d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class ArrayTest { @JsonProperty("array_of_string") private List arrayOfString = new ArrayList(); @@ -32,7 +32,7 @@ public class ArrayTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; @@ -49,7 +49,7 @@ public class ArrayTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; @@ -66,7 +66,7 @@ public class ArrayTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; @@ -77,7 +77,7 @@ public class ArrayTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -111,7 +111,7 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java index 724f25fdb98..8aa6135053f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Capitalization.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; @@ -38,7 +38,7 @@ public class Capitalization { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; @@ -55,7 +55,7 @@ public class Capitalization { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; @@ -72,7 +72,7 @@ public class Capitalization { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; @@ -89,7 +89,7 @@ public class Capitalization { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; @@ -106,7 +106,7 @@ public class Capitalization { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; @@ -124,7 +124,7 @@ public class Capitalization { } - @ApiModelProperty(example = "null", value = "Name of the pet ") + @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; @@ -135,7 +135,7 @@ public class Capitalization { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -175,7 +175,7 @@ public class Capitalization { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java index c7c2d011cb8..96c7697990d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Cat.java @@ -11,7 +11,7 @@ import io.swagger.model.Animal; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; @@ -24,7 +24,7 @@ public class Cat extends Animal { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; @@ -35,7 +35,7 @@ public class Cat extends Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java index bc62b1ab97a..08a80055ff5 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Category.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Category { @JsonProperty("id") private Long id = null; @@ -26,7 +26,7 @@ public class Category { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("id") public Long getId() { return id; @@ -43,7 +43,7 @@ public class Category { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("name") public String getName() { return name; @@ -54,7 +54,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java index f7ed1ac7e5b..d20b67fc179 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ClassModel.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; @@ -26,7 +26,7 @@ public class ClassModel { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("_class") public String getPropertyClass() { return propertyClass; @@ -37,7 +37,7 @@ public class ClassModel { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -67,7 +67,7 @@ public class ClassModel { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java index 63ee0a947c5..17e4f9b950f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Client.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Client { @JsonProperty("client") private String client = null; @@ -23,7 +23,7 @@ public class Client { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("client") public String getClient() { return client; @@ -34,7 +34,7 @@ public class Client { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -64,7 +64,7 @@ public class Client { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java index 50d4a2f84c7..11d9c9ccf3b 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Dog.java @@ -11,7 +11,7 @@ import io.swagger.model.Animal; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; @@ -24,7 +24,7 @@ public class Dog extends Animal { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("breed") public String getBreed() { return breed; @@ -35,7 +35,7 @@ public class Dog extends Animal { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java index 1cd3e6f4806..a8c7712db75 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumArrays.java @@ -13,7 +13,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class EnumArrays { /** * Gets or Sets justSymbol @@ -91,7 +91,7 @@ public class EnumArrays { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; @@ -108,7 +108,7 @@ public class EnumArrays { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; @@ -119,7 +119,7 @@ public class EnumArrays { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -151,7 +151,7 @@ public class EnumArrays { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java index 889ade1d844..b810a573a9f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/EnumTest.java @@ -12,7 +12,7 @@ import io.swagger.model.OuterEnum; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class EnumTest { /** * Gets or Sets enumString @@ -129,7 +129,7 @@ public class EnumTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; @@ -146,7 +146,7 @@ public class EnumTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; @@ -163,7 +163,7 @@ public class EnumTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; @@ -180,7 +180,7 @@ public class EnumTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; @@ -191,7 +191,7 @@ public class EnumTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -227,7 +227,7 @@ public class EnumTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java index 176e8f01701..920dd05e5c5 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/FormatTest.java @@ -13,7 +13,7 @@ import java.util.UUID; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class FormatTest { @JsonProperty("integer") private Integer integer = null; @@ -64,7 +64,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("integer") public Integer getInteger() { return integer; @@ -83,7 +83,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("int32") public Integer getInt32() { return int32; @@ -100,7 +100,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("int64") public Long getInt64() { return int64; @@ -119,7 +119,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("number") public BigDecimal getNumber() { return number; @@ -138,7 +138,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("float") public Float getFloat() { return _float; @@ -157,7 +157,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("double") public Double getDouble() { return _double; @@ -174,7 +174,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("string") public String getString() { return string; @@ -191,7 +191,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("byte") public byte[] getByte() { return _byte; @@ -208,7 +208,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("binary") public byte[] getBinary() { return binary; @@ -225,7 +225,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("date") public Date getDate() { return date; @@ -242,7 +242,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("dateTime") public Date getDateTime() { return dateTime; @@ -259,7 +259,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -276,7 +276,7 @@ public class FormatTest { } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("password") public String getPassword() { return password; @@ -287,7 +287,7 @@ public class FormatTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -341,7 +341,7 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index d0a419d5919..0e3740f02dc 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; @@ -26,7 +26,7 @@ public class HasOnlyReadOnly { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("bar") public String getBar() { return bar; @@ -43,7 +43,7 @@ public class HasOnlyReadOnly { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("foo") public String getFoo() { return foo; @@ -54,7 +54,7 @@ public class HasOnlyReadOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class HasOnlyReadOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java index f9c6ac48d2a..3072665e463 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MapTest.java @@ -14,7 +14,7 @@ import java.util.Map; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class MapTest { @JsonProperty("map_map_of_string") private Map> mapMapOfString = new HashMap>(); @@ -61,7 +61,7 @@ public class MapTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; @@ -78,7 +78,7 @@ public class MapTest { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; @@ -89,7 +89,7 @@ public class MapTest { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -121,7 +121,7 @@ public class MapTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index b8fd7ecf936..06343b0b0a1 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -16,7 +16,7 @@ import java.util.UUID; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; @@ -35,7 +35,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -52,7 +52,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("dateTime") public Date getDateTime() { return dateTime; @@ -69,7 +69,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("map") public Map getMap() { return map; @@ -80,7 +80,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -114,7 +114,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java index c1a85d6c280..4fd3d092af6 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Model200Response.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Model200Response { @JsonProperty("name") private Integer name = null; @@ -29,7 +29,7 @@ public class Model200Response { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("name") public Integer getName() { return name; @@ -46,7 +46,7 @@ public class Model200Response { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("class") public String getPropertyClass() { return propertyClass; @@ -57,7 +57,7 @@ public class Model200Response { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -89,7 +89,7 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java index 2864f30ac5c..5ac1e316581 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; @@ -29,7 +29,7 @@ public class ModelApiResponse { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("code") public Integer getCode() { return code; @@ -46,7 +46,7 @@ public class ModelApiResponse { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("type") public String getType() { return type; @@ -63,7 +63,7 @@ public class ModelApiResponse { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("message") public String getMessage() { return message; @@ -74,7 +74,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -108,7 +108,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java index de51ec1f8ce..afb7202fe71 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class ModelReturn { @JsonProperty("return") private Integer _return = null; @@ -26,7 +26,7 @@ public class ModelReturn { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("return") public Integer getReturn() { return _return; @@ -37,7 +37,7 @@ public class ModelReturn { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -67,7 +67,7 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java index c2ae0fd1bcd..85ef0f0c267 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Name.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; **/ @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Name { @JsonProperty("name") private Integer name = null; @@ -35,7 +35,7 @@ public class Name { } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("name") public Integer getName() { return name; @@ -52,7 +52,7 @@ public class Name { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; @@ -69,7 +69,7 @@ public class Name { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("property") public String getProperty() { return property; @@ -86,7 +86,7 @@ public class Name { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("123Number") public Integer get123Number() { return _123Number; @@ -97,7 +97,7 @@ public class Name { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -133,7 +133,7 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java index bf36acc7e2d..7a83d647280 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/NumberOnly.java @@ -11,7 +11,7 @@ import java.math.BigDecimal; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; @@ -24,7 +24,7 @@ public class NumberOnly { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; @@ -35,7 +35,7 @@ public class NumberOnly { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class NumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java index 4585652bbba..324a686eb8b 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Order.java @@ -12,7 +12,7 @@ import java.util.Date; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Order { @JsonProperty("id") private Long id = null; @@ -73,7 +73,7 @@ public class Order { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("id") public Long getId() { return id; @@ -90,7 +90,7 @@ public class Order { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("petId") public Long getPetId() { return petId; @@ -107,7 +107,7 @@ public class Order { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("quantity") public Integer getQuantity() { return quantity; @@ -124,7 +124,7 @@ public class Order { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("shipDate") public Date getShipDate() { return shipDate; @@ -142,7 +142,7 @@ public class Order { } - @ApiModelProperty(example = "null", value = "Order Status") + @ApiModelProperty(value = "Order Status") @JsonProperty("status") public StatusEnum getStatus() { return status; @@ -159,7 +159,7 @@ public class Order { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("complete") public Boolean getComplete() { return complete; @@ -170,7 +170,7 @@ public class Order { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -210,7 +210,7 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java index 282a93c779a..59740a6add7 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Pet.java @@ -15,7 +15,7 @@ import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Pet { @JsonProperty("id") private Long id = null; @@ -76,7 +76,7 @@ public class Pet { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("id") public Long getId() { return id; @@ -93,7 +93,7 @@ public class Pet { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("category") public Category getCategory() { return category; @@ -127,7 +127,7 @@ public class Pet { } - @ApiModelProperty(example = "null", required = true, value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; @@ -144,7 +144,7 @@ public class Pet { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("tags") public List getTags() { return tags; @@ -162,7 +162,7 @@ public class Pet { } - @ApiModelProperty(example = "null", value = "pet status in the store") + @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") public StatusEnum getStatus() { return status; @@ -173,7 +173,7 @@ public class Pet { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -213,7 +213,7 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java index ae5d108890a..736b7b7acc5 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; @@ -26,7 +26,7 @@ public class ReadOnlyFirst { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("bar") public String getBar() { return bar; @@ -43,7 +43,7 @@ public class ReadOnlyFirst { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("baz") public String getBaz() { return baz; @@ -54,7 +54,7 @@ public class ReadOnlyFirst { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java index 7aee673c8eb..ce1dfecab01 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/SpecialModelName.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; @@ -23,7 +23,7 @@ public class SpecialModelName { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") public Long getSpecialPropertyName() { return specialPropertyName; @@ -34,7 +34,7 @@ public class SpecialModelName { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -64,7 +64,7 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java index eb8aec2f998..3e0ca356763 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/Tag.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class Tag { @JsonProperty("id") private Long id = null; @@ -26,7 +26,7 @@ public class Tag { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("id") public Long getId() { return id; @@ -43,7 +43,7 @@ public class Tag { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("name") public String getName() { return name; @@ -54,7 +54,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -86,7 +86,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java index d84a524fdab..4addb9c0238 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/java-inflector/src/gen/java/io/swagger/model/User.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class User { @JsonProperty("id") private Long id = null; @@ -44,7 +44,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("id") public Long getId() { return id; @@ -61,7 +61,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("username") public String getUsername() { return username; @@ -78,7 +78,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("firstName") public String getFirstName() { return firstName; @@ -95,7 +95,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("lastName") public String getLastName() { return lastName; @@ -112,7 +112,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("email") public String getEmail() { return email; @@ -129,7 +129,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("password") public String getPassword() { return password; @@ -146,7 +146,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "") + @ApiModelProperty(value = "") @JsonProperty("phone") public String getPhone() { return phone; @@ -164,7 +164,7 @@ public class User { } - @ApiModelProperty(example = "null", value = "User Status") + @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; @@ -175,7 +175,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -219,7 +219,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeClassnameTestController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeClassnameTestController.java index edf91a55c73..9dcbf722e8a 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeClassnameTestController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeClassnameTestController.java @@ -12,7 +12,7 @@ import io.swagger.model.*; import io.swagger.model.Client; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class FakeClassnameTestController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java index e78c37e781e..3c339e8d641 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/FakeController.java @@ -14,7 +14,7 @@ import java.math.BigDecimal; import io.swagger.model.Client; import java.util.Date; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class FakeController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java index 495665cfeec..ac2b651ce5f 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/PetController.java @@ -14,7 +14,7 @@ import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class PetController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java index bc452a3b63f..58711922a6d 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/StoreController.java @@ -13,7 +13,7 @@ import io.swagger.model.*; import java.util.Map; import io.swagger.model.Order; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class StoreController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java index 51319e23ce4..c269add7cdc 100644 --- a/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/io/swagger/handler/UserController.java @@ -13,7 +13,7 @@ import io.swagger.model.*; import java.util.List; import io.swagger.model.User; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2017-03-13T18:03:34.096+01:00") + public class UserController { /** * Uncomment and implement as you see fit. These operations will map diff --git a/samples/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index b7c61004bac..d25dba1ac73 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -1,17 +1,14 @@ - - org.wso2.msf4j msf4j-service -2.0.0 + 2.0.0 - 4.0.0 io.swagger - swagger-jaxrs-server + swagger-msf4j-server jar - swagger-jaxrs-server + swagger-msf4j-server 1.0.0 src/main/java @@ -81,7 +78,7 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index cdf3a68ed8f..b12ecaa443f 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -1,9 +1,9 @@ 4.0.0 io.swagger - swagger-cxf-server + swagger-cxf-annotated-basepath war - swagger-cxf-server + swagger-cxf-annotated-basepath 1.0.0 src/main/java diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java index 0308c93eaf6..deaf2da1115 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java @@ -70,7 +70,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java index 512f77e3c5a..d8074c75102 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -90,7 +90,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java index fd7aaf2729e..18ede7173c2 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java @@ -183,7 +183,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java index b4e4cab2fe7..bb02aa5ea2c 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java @@ -199,7 +199,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java index 0db61292657..caf601e42cf 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java @@ -70,7 +70,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java index 355c1ef9a42..5cfc2944314 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java @@ -190,7 +190,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index fee23f1bfaf..6359d8b0df5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -57,7 +57,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -89,7 +89,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index 39d83d433e5..d8495139bb3 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -75,7 +75,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -109,7 +109,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index 21e1acca64d..1351a2a8fad 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -163,7 +163,7 @@ public enum StatusEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -203,7 +203,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index c346608f0c8..284fc469e8e 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -169,7 +169,7 @@ public enum StatusEnum { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -209,7 +209,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index f60b51d5397..0efd1fee3f2 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -57,7 +57,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -89,7 +89,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index 2548a22c89c..935f0b642eb 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -166,7 +166,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -210,7 +210,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index cdf3a68ed8f..d2fcf897e07 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -1,9 +1,9 @@ 4.0.0 io.swagger - swagger-cxf-server + swagger-cxf-server-non-spring war - swagger-cxf-server + swagger-cxf-non-spring 1.0.0 src/main/java diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java index 0308c93eaf6..deaf2da1115 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java @@ -70,7 +70,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java index 512f77e3c5a..d8074c75102 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -90,7 +90,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java index fd7aaf2729e..18ede7173c2 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java @@ -183,7 +183,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java index b4e4cab2fe7..bb02aa5ea2c 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java @@ -199,7 +199,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java index 0db61292657..caf601e42cf 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java @@ -70,7 +70,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java index 355c1ef9a42..5cfc2944314 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java @@ -190,7 +190,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index cdf3a68ed8f..59b8b3545d8 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -112,6 +112,13 @@ ${junit-version} test + + + javax.validation + validation-api + ${beanvalidation-version} + provided + org.apache.cxf @@ -151,6 +158,18 @@ ${cxf-version} compile + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + compile + @@ -165,13 +184,15 @@ 1.7 ${java.version} ${java.version} - 1.5.10 + 1.5.12 9.2.9.v20150224 2.22.2 4.12 1.1.7 2.5 + 1.1.0.Final 3.1.8 + 2.8.4 UTF-8
diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java index f75305e19f0..4059c84a622 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java @@ -15,6 +15,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -27,6 +29,8 @@ public interface FakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @ApiOperation(value = "To test \"client\" model", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Client testClientModel(Client body); @POST @@ -34,13 +38,19 @@ public interface FakeApi { @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) - public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "_double") Double _double, @Multipart(value = "patternWithoutDelimiter") String patternWithoutDelimiter, @Multipart(value = "_byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "_float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "paramCallback", required = false) String paramCallback); + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) + public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback); @GET @Path("/fake") @Consumes({ "*/*" }) @Produces({ "*/*" }) @ApiOperation(value = "To test enum parameters", tags={ "fake" }) - public void testEnumParameters(@Multipart(value = "enumFormStringArray", required = false) List enumFormStringArray, @Multipart(value = "enumFormString", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enumQueryDouble", required = false) Double enumQueryDouble); + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") }) + public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java index d42bf02c74f..68701e28cc2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java @@ -15,6 +15,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -27,30 +29,44 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Add a new pet to the store", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(Pet body); @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Deletes a pet", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find pet by ID", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) public Pet getPetById(@PathParam("petId") Long petId); @PUT @@ -58,6 +74,10 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Update an existing pet", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) public void updatePet(Pet body); @POST @@ -65,6 +85,8 @@ public interface PetApi { @Consumes({ "application/x-www-form-urlencoded" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); @POST @@ -72,6 +94,8 @@ public interface PetApi { @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @ApiOperation(value = "uploads an image", tags={ "pet" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index 4a3ffd1020b..f6f1b34c243 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -25,24 +27,36 @@ public interface StoreApi { @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete purchase order by ID", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("orderId") String orderId); @GET @Path("/store/inventory") @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); @GET @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", tags={ "store", }) - public Order getOrderById(@PathParam("orderId") Long orderId); + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) + public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", tags={ "store" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) public Order placeOrder(Order body); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java index a28cc95b58d..172b6938f1d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java @@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; import javax.validation.constraints.*; @@ -25,48 +27,69 @@ public interface UserApi { @Path("/user") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Create user", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void createUser(User body); @POST @Path("/user/createWithArray") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(List body); @POST @Path("/user/createWithList") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(List body); @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete user", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Get user by user name", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs user into the system", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs out current logged in user session", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", tags={ "user" }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) public void updateUser(@PathParam("username") String username, User body); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 556e9e1d61a..b19a90cbc3f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -81,7 +81,7 @@ public class AdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java index 08ed3535947..36c52fa27aa 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java @@ -71,7 +71,7 @@ public class Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java index 93ad619c46c..b9ceb010054 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java @@ -31,7 +31,7 @@ public class AnimalFarm extends ArrayList { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 681f477f8e8..4d994a64f4c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -56,7 +56,7 @@ public class ArrayOfArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 8e06ba9fd53..45348bd5bab 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -56,7 +56,7 @@ public class ArrayOfNumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java index bab67b5f1ac..48a352899b8 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java @@ -106,7 +106,7 @@ public class ArrayTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java index 9c96e900b7f..2dc50b68a86 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java @@ -148,7 +148,7 @@ public class Capitalization { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java index 12ff2e0743f..a44b4c3474e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java @@ -49,7 +49,7 @@ public class Cat extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java index c4de6207ff9..206fb962639 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java @@ -68,7 +68,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java index d924d868929..522a5f5c835 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java @@ -50,7 +50,7 @@ public class ClassModel { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java index cde45a9e668..effac40b532 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java @@ -48,7 +48,7 @@ public class Client { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java index 79f363fd80e..c33b9754f29 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java @@ -49,7 +49,7 @@ public class Dog extends Animal { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java index 31adcdc2086..1f72d296c0f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java @@ -141,7 +141,7 @@ public enum ArrayEnumEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java index b6e382ed1f6..550742ed624 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java @@ -208,7 +208,7 @@ public enum EnumNumberEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java index d544cfa112f..1b8717f6ebc 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -49,9 +49,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -70,9 +68,7 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -109,9 +105,7 @@ public class FormatTest { * @return number **/ @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -130,9 +124,7 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -151,9 +143,7 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -170,8 +160,7 @@ public class FormatTest { * Get string * @return string **/ - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -276,8 +265,7 @@ public class FormatTest { * @return password **/ @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } @@ -317,7 +305,7 @@ public class FormatTest { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 8acb48cf2cb..e775fe7aab3 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -52,7 +52,7 @@ public class HasOnlyReadOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java index 3c1e80e9d83..f851274f064 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java @@ -114,7 +114,7 @@ public enum InnerEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2dcc59c4803..e22fda79803 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -98,7 +98,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java index 4a2183a1ca6..5d7bf7f6a12 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java @@ -70,7 +70,7 @@ public class Model200Response { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java index e25bfd0dbdf..ddf2aa0b5a5 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -88,7 +88,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java index cf9cb2cc74d..f1fd55b763b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java @@ -50,7 +50,7 @@ public class ModelReturn { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java index 90deb77334d..1365022268b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java @@ -95,7 +95,7 @@ public class Name { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java index 219cf8612ff..203830ffd01 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java @@ -49,7 +49,7 @@ public class NumberOnly { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java index 4a7622e7948..83e24c1ffe9 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java @@ -181,7 +181,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java index 3046295eeaf..41c96154a4b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java @@ -197,7 +197,7 @@ public enum StatusEnum { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java index f870573ac4d..769ab0a7c48 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -60,7 +60,7 @@ public class ReadOnlyFirst { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java index b3decaa2221..a4b52b3bfe2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java @@ -48,7 +48,7 @@ public class SpecialModelName { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java index 9a2ffa38409..de1cd154399 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java @@ -68,7 +68,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java index e25dba5282e..9c4b9d9ae7d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java @@ -188,7 +188,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java index 5e8dae654a4..7d926943bd2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java @@ -80,7 +80,7 @@ public class FakeApiTest { @Test public void testClientModelTest() { Client body = null; - //Client response = api.testClientModel(body); + //Client response = api.testClientModel(body); //assertNotNull(response); // TODO: test validations @@ -111,7 +111,7 @@ public class FakeApiTest { javax.xml.datatype.XMLGregorianCalendar dateTime = null; String password = null; String paramCallback = null; - //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); // TODO: test validations @@ -136,7 +136,7 @@ public class FakeApiTest { String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - //api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + //api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java index 44cf564dec1..188fdb7b5cf 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -25,9 +25,9 @@ package io.swagger.api; -import io.swagger.model.Pet; -import io.swagger.model.ModelApiResponse; import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -117,7 +117,7 @@ public class PetApiTest { @Test public void findPetsByStatusTest() { List status = null; - //Pet response = api.findPetsByStatus(status); + //List response = api.findPetsByStatus(status); //assertNotNull(response); // TODO: test validations @@ -135,7 +135,7 @@ public class PetApiTest { @Test public void findPetsByTagsTest() { List tags = null; - //Pet response = api.findPetsByTags(tags); + //List response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java index e54e33f0fbc..aa476b0cf0f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -96,7 +96,7 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - //Integer response = api.getInventory(); + //Map response = api.getInventory(); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java index 2285f3c70cf..76bb7fa5578 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java @@ -1,6 +1,6 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -25,8 +25,8 @@ package io.swagger.api; -import io.swagger.model.User; import java.util.List; +import io.swagger.model.User; import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java index caf0d5f1631..6794ae0da5a 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java @@ -41,7 +41,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java index ac14219acb6..2de59f1191e 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -54,7 +54,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -88,7 +88,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java index b1870b87340..4e9acd44a95 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java @@ -119,7 +119,7 @@ public class Order { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -159,7 +159,7 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java index 5dbbc692373..81ea1ca0b24 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java @@ -123,7 +123,7 @@ public class Pet { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -163,7 +163,7 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java index 43ea83e43fc..f6894199956 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java @@ -41,7 +41,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java index f238a851d7c..0c2be106305 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java @@ -120,7 +120,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -164,7 +164,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md b/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md new file mode 100644 index 00000000000..cc011c37ee5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md @@ -0,0 +1,23 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. + +To run the server, please execute the following: + +``` +mvn clean package jetty:run +``` + +You can then view the swagger listing here: + +``` +http://localhost:8080/v2/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle new file mode 100644 index 00000000000..ed888aecd20 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle @@ -0,0 +1,30 @@ +apply plugin: 'war' + +project.version = "1.0.0" +project.group = "io.swagger" + +repositories { + mavenCentral() +} + +dependencies { + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'javax.annotation:javax.annotation-api:1.2' + providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' + compile 'joda-time:joda-time:2.7' + testCompile 'junit:junit:4.12', + 'org.hamcrest:hamcrest-core:1.3' +} + +sourceSets { + main { + java { + srcDir 'src/gen/java' + } + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml new file mode 100644 index 00000000000..3e75cf3b537 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -0,0 +1,173 @@ + + 4.0.0 + io.swagger + swagger-jaxrs-resteasy-eap-server + war + swagger-jaxrs-resteasy-eap-server + 1.0.0 + + src/main/java + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + + src/gen/java + + + + + + + + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.jboss.resteasy + resteasy-jaxrs + ${resteasy-version} + provided + + + org.jboss.resteasy + jaxrs-api + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-validator-provider-11 + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy-version} + provided + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.4.1 + + + joda-time + joda-time + 2.7 + + + io.swagger + swagger-jaxrs + ${swagger-core-version} + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.1.1 + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.5.9 + 9.2.9.v20150224 + 3.0.11.Final + 1.6.3 + 4.8.1 + 2.5 + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/settings.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/settings.gradle new file mode 100644 index 00000000000..1bd07384c31 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "swagger-jaxrs-resteasy-eap-server" \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..22a0cb0a5ca --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java @@ -0,0 +1,143 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + +@Path("/pet") + + +@io.swagger.annotations.Api(description = "the pet API") + +public interface PetApi { + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @DELETE + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + @GET + @Path("/findByStatus") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); + @GET + @Path("/findByTags") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); + @GET + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext); + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..2d23dba5649 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java @@ -0,0 +1,70 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/store") + + +@io.swagger.annotations.Api(description = "the store API") + +public interface StoreApi { + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext); + @GET + @Path("/inventory") + + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory(@Context SecurityContext securityContext); + @GET + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); + @POST + @Path("/order") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..5909038e544 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java @@ -0,0 +1,102 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/user") + + +@io.swagger.annotations.Api(description = "the user API") + +public interface UserApi { + + @POST + + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext); + @POST + @Path("/createWithArray") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @POST + @Path("/createWithList") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @DELETE + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/login") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); + @GET + @Path("/logout") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response logoutUser(@Context SecurityContext securityContext); + @PUT + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..caf0d5f1631 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A category for a pet") + +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..ac14219acb6 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,98 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="Describes the result of uploading an image resource") + +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..0099184b5ae --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java @@ -0,0 +1,169 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import org.joda.time.DateTime; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="An order for a pets from the pet store") + +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private DateTime shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + private Boolean complete = false; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") + public DateTime getShipDate() { + return shipDate; + } + public void setShipDate(DateTime shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..5dbbc692373 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java @@ -0,0 +1,173 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.List; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A pet for sale in the pet store") + +public class Pet { + + private Long id = null; + private Category category = null; + private String name = null; + private List photoUrls = new ArrayList(); + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..43ea83e43fc --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A tag for a pet") + +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java new file mode 100644 index 00000000000..f238a851d7c --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java @@ -0,0 +1,174 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A User who is purchasing from the pet store") + +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java new file mode 100644 index 00000000000..2cf35d3d1e6 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java @@ -0,0 +1,34 @@ +package io.swagger.api; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.joda.JodaModule; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class JacksonConfig implements ContextResolver { + + private static final Logger LOG = LoggerFactory.getLogger(JacksonConfig.class); + + private ObjectMapper objectMapper; + + public JacksonConfig() throws Exception { + this.objectMapper = new ObjectMapper(); + + this.objectMapper.registerModule(new JodaModule()); + + // sample to convert any DateTime to readable timestamps + //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); + } + + public ObjectMapper getContext(Class objectType) { + return objectMapper; + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java new file mode 100644 index 00000000000..cb15c187c32 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java @@ -0,0 +1,31 @@ +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import java.util.Set; +import java.util.HashSet; + +import io.swagger.api.impl.PetApiServiceImpl; +import io.swagger.api.impl.StoreApiServiceImpl; +import io.swagger.api.impl.UserApiServiceImpl; + +@ApplicationPath("/") +public class RestApplication extends Application { + + public Set> getClasses() { + Set> resources = new HashSet>(); + resources.add(PetApiServiceImpl.class); + resources.add(StoreApiServiceImpl.class); + resources.add(UserApiServiceImpl.class); + + //resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); + //resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); + + return resources; + } + + + + +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java new file mode 100644 index 00000000000..eb3e35b8280 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -0,0 +1,53 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class PetApiServiceImpl implements PetApi { + public Response addPet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByStatus(List status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByTags(List tags,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getPetById(Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java new file mode 100644 index 00000000000..1de821ace75 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -0,0 +1,35 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class StoreApiServiceImpl implements StoreApi { + public Response deleteOrder(String orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getInventory(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getOrderById(Long orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response placeOrder(Order body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java new file mode 100644 index 00000000000..67f74c66cb0 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -0,0 +1,51 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class UserApiServiceImpl implements UserApi { + public Response createUser(User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithListInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deleteUser(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getUserByName(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response loginUser(String username,String password,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response logoutUser(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updateUser(String username,User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/jboss-web.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 00000000000..9c05ed07b78 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,3 @@ + + /v2 + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..889fb80870a --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,9 @@ + + + + resteasy.providers + io.swagger.api.JacksonConfig + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-resteasy/eap/README.md b/samples/server/petstore/jaxrs-resteasy/eap/README.md new file mode 100644 index 00000000000..cc011c37ee5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/README.md @@ -0,0 +1,23 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. + +To run the server, please execute the following: + +``` +mvn clean package jetty:run +``` + +You can then view the swagger listing here: + +``` +http://localhost:8080/v2/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle new file mode 100644 index 00000000000..879fe11de18 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle @@ -0,0 +1,28 @@ +apply plugin: 'war' + +project.version = "1.0.0" +project.group = "io.swagger" + +repositories { + mavenCentral() +} + +dependencies { + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'javax.annotation:javax.annotation-api:1.2' + providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + testCompile 'junit:junit:4.12', + 'org.hamcrest:hamcrest-core:1.3' +} + +sourceSets { + main { + java { + srcDir 'src/gen/java' + } + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml new file mode 100644 index 00000000000..c82aa0de05d --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -0,0 +1,168 @@ + + 4.0.0 + io.swagger + swagger-jaxrs-resteasy-eap-server + war + swagger-jaxrs-resteasy-eap-server + 1.0.0 + + src/main/java + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + + src/gen/java + + + + + + + + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.jboss.resteasy + resteasy-jaxrs + ${resteasy-version} + provided + + + org.jboss.resteasy + jaxrs-api + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-validator-provider-11 + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy-version} + provided + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.4.1 + + + joda-time + joda-time + 2.7 + + + io.swagger + swagger-jaxrs + ${swagger-core-version} + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.5.9 + 9.2.9.v20150224 + 3.0.11.Final + 1.6.3 + 4.8.1 + 2.5 + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/settings.gradle b/samples/server/petstore/jaxrs-resteasy/eap/settings.gradle new file mode 100644 index 00000000000..1bd07384c31 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "swagger-jaxrs-resteasy-eap-server" \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..22a0cb0a5ca --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java @@ -0,0 +1,143 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + +@Path("/pet") + + +@io.swagger.annotations.Api(description = "the pet API") + +public interface PetApi { + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @DELETE + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + @GET + @Path("/findByStatus") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); + @GET + @Path("/findByTags") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) + public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); + @GET + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext); + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { + @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..2d23dba5649 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java @@ -0,0 +1,70 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/store") + + +@io.swagger.annotations.Api(description = "the store API") + +public interface StoreApi { + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext); + @GET + @Path("/inventory") + + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @io.swagger.annotations.Authorization(value = "api_key") + }, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory(@Context SecurityContext securityContext); + @GET + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); + @POST + @Path("/order") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..5909038e544 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java @@ -0,0 +1,102 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/user") + + +@io.swagger.annotations.Api(description = "the user API") + +public interface UserApi { + + @POST + + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext); + @POST + @Path("/createWithArray") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @POST + @Path("/createWithList") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @DELETE + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) + public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET + @Path("/login") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), + + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); + @GET + @Path("/logout") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response logoutUser(@Context SecurityContext securityContext); + @PUT + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..caf0d5f1631 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A category for a pet") + +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..ac14219acb6 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,98 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="Describes the result of uploading an image resource") + +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..b1870b87340 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java @@ -0,0 +1,169 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import java.util.Date; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="An order for a pets from the pet store") + +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private Date shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + private Boolean complete = false; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..5dbbc692373 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java @@ -0,0 +1,173 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.List; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A pet for sale in the pet store") + +public class Pet { + + private Long id = null; + private Category category = null; + private String name = null; + private List photoUrls = new ArrayList(); + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..43ea83e43fc --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java @@ -0,0 +1,83 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A tag for a pet") + +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java new file mode 100644 index 00000000000..f238a851d7c --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java @@ -0,0 +1,174 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@ApiModel(description="A User who is purchasing from the pet store") + +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java new file mode 100644 index 00000000000..8b6f49d4345 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java @@ -0,0 +1,33 @@ +package io.swagger.api; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.joda.JodaModule; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class JacksonConfig implements ContextResolver { + + private static final Logger LOG = LoggerFactory.getLogger(JacksonConfig.class); + + private ObjectMapper objectMapper; + + public JacksonConfig() throws Exception { + this.objectMapper = new ObjectMapper(); + + + // sample to convert any DateTime to readable timestamps + //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); + } + + public ObjectMapper getContext(Class objectType) { + return objectMapper; + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java new file mode 100644 index 00000000000..74de91ef989 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java @@ -0,0 +1,45 @@ +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import java.util.Set; +import java.util.HashSet; +import io.swagger.jaxrs.config.BeanConfig; + +import io.swagger.api.impl.PetApiServiceImpl; +import io.swagger.api.impl.StoreApiServiceImpl; +import io.swagger.api.impl.UserApiServiceImpl; + +@ApplicationPath("/") +public class RestApplication extends Application { + + public RestApplication() { + super(); + // Customize the dynamic contract + BeanConfig beanConfig = new BeanConfig(); + beanConfig.setTitle("Swagger Petstore"); + beanConfig.setVersion("1.0.0"); + beanConfig.setSchemes(new String[] { "http" }); + beanConfig.setHost("petstore.swagger.io"); + beanConfig.setBasePath("/v2"); + beanConfig.setResourcePackage("io.swagger.api"); + beanConfig.setScan(true); + + } + + public Set> getClasses() { + Set> resources = new HashSet>(); + resources.add(PetApiServiceImpl.class); + resources.add(StoreApiServiceImpl.class); + resources.add(UserApiServiceImpl.class); + + resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); + resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); + return resources; + } + + + + +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java new file mode 100644 index 00000000000..eb3e35b8280 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -0,0 +1,53 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class PetApiServiceImpl implements PetApi { + public Response addPet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByStatus(List status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response findPetsByTags(List tags,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getPetById(Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePet(Pet body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java new file mode 100644 index 00000000000..1de821ace75 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -0,0 +1,35 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class StoreApiServiceImpl implements StoreApi { + public Response deleteOrder(String orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getInventory(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getOrderById(Long orderId,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response placeOrder(Order body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java new file mode 100644 index 00000000000..67f74c66cb0 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -0,0 +1,51 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.List; +import io.swagger.model.User; + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + + +public class UserApiServiceImpl implements UserApi { + public Response createUser(User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response createUsersWithListInput(List body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response deleteUser(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response getUserByName(String username,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response loginUser(String username,String password,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response logoutUser(SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } + public Response updateUser(String username,User body,SecurityContext securityContext) { + // do some magic! + return Response.ok().build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/jboss-web.xml b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 00000000000..9c05ed07b78 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,3 @@ + + /v2 + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..889fb80870a --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,9 @@ + + + + resteasy.providers + io.swagger.api.JacksonConfig + + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java index caf0d5f1631..6794ae0da5a 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java @@ -41,7 +41,7 @@ public class Category { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Category { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java index ac14219acb6..2de59f1191e 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -54,7 +54,7 @@ public class ModelApiResponse { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -88,7 +88,7 @@ public class ModelApiResponse { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java index 0099184b5ae..5d4300d15f4 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java @@ -119,7 +119,7 @@ public class Order { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -159,7 +159,7 @@ public class Order { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java index 5dbbc692373..81ea1ca0b24 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java @@ -123,7 +123,7 @@ public class Pet { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -163,7 +163,7 @@ public class Pet { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java index 43ea83e43fc..f6894199956 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java @@ -41,7 +41,7 @@ public class Tag { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -73,7 +73,7 @@ public class Tag { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java index f238a851d7c..0c2be106305 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java @@ -120,7 +120,7 @@ public class User { @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -164,7 +164,7 @@ public class User { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java index b11fec88aab..1afafe4bf20 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java @@ -37,9 +37,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } public void setInteger(Integer integer) { @@ -57,9 +55,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } public void setInt32(Integer int32) { @@ -94,9 +90,7 @@ public class FormatTest { @ApiModelProperty(example = "null", required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } public void setNumber(BigDecimal number) { @@ -114,9 +108,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } public void setFloat(Float _float) { @@ -134,9 +126,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } public void setDouble(Double _double) { @@ -152,8 +142,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } public void setString(String string) { @@ -252,8 +241,7 @@ public class FormatTest { @ApiModelProperty(example = "null", required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } public void setPassword(String password) { diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 21c139af649..bb2cd49f6a8 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -786,15 +786,15 @@ "description" : "None", "required" : true, "type" : "number", - "maximum" : 543.2, - "minimum" : 32.1 + "maximum" : 543.200000000000045474735088646411895751953125, + "minimum" : 32.10000000000000142108547152020037174224853515625 }, { "name" : "float", "in" : "formData", "description" : "None", "required" : false, "type" : "number", - "maximum" : 987.6, + "maximum" : 987.6000000000000227373675443232059478759765625, "format" : "float" }, { "name" : "double", @@ -802,8 +802,8 @@ "description" : "None", "required" : true, "type" : "number", - "maximum" : 123.4, - "minimum" : 67.8, + "maximum" : 123.400000000000005684341886080801486968994140625, + "minimum" : 67.7999999999999971578290569595992565155029296875, "format" : "double" }, { "name" : "string", diff --git a/samples/server/petstore/jaxrs/jersey1/pom.xml b/samples/server/petstore/jaxrs/jersey1/pom.xml index decbbd651d8..feaca47dd95 100644 --- a/samples/server/petstore/jaxrs/jersey1/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1/pom.xml @@ -138,6 +138,16 @@ ${jersey-version} test + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + org.testng testng @@ -179,9 +189,10 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 1.19.1 + 2.8.7 1.7.21 4.12 2.5 diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 18310a4ec6a..39125b0a9b2 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -133,7 +133,17 @@ jersey-media-multipart ${jersey2-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + com.brsanthu migbase64 @@ -163,9 +173,10 @@ 1.7 ${java.version} ${java.version} - 1.5.9 + 1.5.12 9.2.9.v20150224 2.22.2 + 2.8.7 4.12 1.1.7 2.5 diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java index eaba5daefe7..bdd53cb3e5d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java @@ -80,9 +80,7 @@ public class FormatTest { **/ @JsonProperty("integer") @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -103,9 +101,7 @@ public class FormatTest { **/ @JsonProperty("int32") @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -146,9 +142,7 @@ public class FormatTest { @JsonProperty("number") @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -169,9 +163,7 @@ public class FormatTest { **/ @JsonProperty("float") @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -192,9 +184,7 @@ public class FormatTest { **/ @JsonProperty("double") @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -213,8 +203,7 @@ public class FormatTest { **/ @JsonProperty("string") @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -331,8 +320,7 @@ public class FormatTest { @JsonProperty("password") @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/nancyfx/IO.Swagger.sln b/samples/server/petstore/nancyfx/IO.Swagger.sln index 19c39f00b32..6bf64a33d8c 100644 --- a/samples/server/petstore/nancyfx/IO.Swagger.sln +++ b/samples/server/petstore/nancyfx/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{919EE99D-6431-4ADA-AADF-E1F6D37925D3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{5D73FB08-180D-406F-BBBE-EE1E8BA73FEB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,10 +10,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{919EE99D-6431-4ADA-AADF-E1F6D37925D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{919EE99D-6431-4ADA-AADF-E1F6D37925D3}.Debug|Any CPU.Build.0 = Debug|Any CPU -{919EE99D-6431-4ADA-AADF-E1F6D37925D3}.Release|Any CPU.ActiveCfg = Release|Any CPU -{919EE99D-6431-4ADA-AADF-E1F6D37925D3}.Release|Any CPU.Build.0 = Release|Any CPU +{5D73FB08-180D-406F-BBBE-EE1E8BA73FEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{5D73FB08-180D-406F-BBBE-EE1E8BA73FEB}.Debug|Any CPU.Build.0 = Debug|Any CPU +{5D73FB08-180D-406F-BBBE-EE1E8BA73FEB}.Release|Any CPU.ActiveCfg = Release|Any CPU +{5D73FB08-180D-406F-BBBE-EE1E8BA73FEB}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj index 2af204e77f2..9b8ad39478e 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - {919EE99D-6431-4ADA-AADF-E1F6D37925D3} + {5D73FB08-180D-406F-BBBE-EE1E8BA73FEB} Library Properties IO.Swagger.v2 diff --git a/samples/server/petstore/nodejs/controllers/PetService.js b/samples/server/petstore/nodejs/controllers/PetService.js index f9c7f30378b..2adde2af85f 100644 --- a/samples/server/petstore/nodejs/controllers/PetService.js +++ b/samples/server/petstore/nodejs/controllers/PetService.js @@ -35,16 +35,16 @@ exports.findPetsByStatus = function(args, res, next) { examples['application/json'] = [ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 8, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 9 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 8 } ], - "status" : "aeiou" + "status" : "available" } ]; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -66,16 +66,16 @@ exports.findPetsByTags = function(args, res, next) { examples['application/json'] = [ { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 1, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 2 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 4 } ], - "status" : "aeiou" + "status" : "available" } ]; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -97,16 +97,16 @@ exports.getPetById = function(args, res, next) { examples['application/json'] = { "photoUrls" : [ "aeiou" ], "name" : "doggie", - "id" : 123456789, + "id" : 9, "category" : { "name" : "aeiou", - "id" : 123456789 + "id" : 5 }, "tags" : [ { "name" : "aeiou", - "id" : 123456789 + "id" : 2 } ], - "status" : "aeiou" + "status" : "available" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -152,7 +152,7 @@ exports.uploadFile = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "code" : 123, + "code" : 1, "type" : "aeiou", "message" : "aeiou" }; diff --git a/samples/server/petstore/nodejs/controllers/StoreService.js b/samples/server/petstore/nodejs/controllers/StoreService.js index d56502daf03..7d66d5ea705 100644 --- a/samples/server/petstore/nodejs/controllers/StoreService.js +++ b/samples/server/petstore/nodejs/controllers/StoreService.js @@ -20,7 +20,7 @@ exports.getInventory = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "key" : 123 + "key" : 0 }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -40,12 +40,12 @@ exports.getOrderById = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 7, + "quantity" : 3, + "id" : 4, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); @@ -65,12 +65,12 @@ exports.placeOrder = function(args, res, next) { **/ var examples = {}; examples['application/json'] = { - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, + "petId" : 5, + "quantity" : 7, + "id" : 9, "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "aeiou" + "complete" : false, + "status" : "placed" }; if (Object.keys(examples).length > 0) { res.setHeader('Content-Type', 'application/json'); diff --git a/samples/server/petstore/nodejs/controllers/UserService.js b/samples/server/petstore/nodejs/controllers/UserService.js index 5b4fe750d7d..056f7a3c1b9 100644 --- a/samples/server/petstore/nodejs/controllers/UserService.js +++ b/samples/server/petstore/nodejs/controllers/UserService.js @@ -57,9 +57,9 @@ exports.getUserByName = function(args, res, next) { "firstName" : "aeiou", "lastName" : "aeiou", "password" : "aeiou", - "userStatus" : 123, + "userStatus" : 4, "phone" : "aeiou", - "id" : 123456789, + "id" : 8, "email" : "aeiou", "username" : "aeiou" }; diff --git a/samples/server/petstore/silex/SwaggerServer/index.php b/samples/server/petstore/silex/SwaggerServer/index.php index 10b446e9974..ef5c65d8e73 100644 --- a/samples/server/petstore/silex/SwaggerServer/index.php +++ b/samples/server/petstore/silex/SwaggerServer/index.php @@ -9,141 +9,109 @@ $app = new Silex\Application(); $app->POST('/v2/pet', function(Application $app, Request $request) { - - return new Response('How about implementing addPet as a POST method ?'); }); -$app->DELETE('/v2/pet/{petId}', function(Application $app, Request $request, $pet_id) { - - +$app->DELETE('/v2/pet/{petId}', function(Application $app, Request $request, $petId) { return new Response('How about implementing deletePet as a DELETE method ?'); }); $app->GET('/v2/pet/findByStatus', function(Application $app, Request $request) { - $status = $request->get('status'); - + $status = $request->get('status'); return new Response('How about implementing findPetsByStatus as a GET method ?'); }); $app->GET('/v2/pet/findByTags', function(Application $app, Request $request) { - $tags = $request->get('tags'); - + $tags = $request->get('tags'); return new Response('How about implementing findPetsByTags as a GET method ?'); }); -$app->GET('/v2/pet/{petId}', function(Application $app, Request $request, $pet_id) { - - +$app->GET('/v2/pet/{petId}', function(Application $app, Request $request, $petId) { return new Response('How about implementing getPetById as a GET method ?'); }); $app->PUT('/v2/pet', function(Application $app, Request $request) { - - return new Response('How about implementing updatePet as a PUT method ?'); }); -$app->POST('/v2/pet/{petId}', function(Application $app, Request $request, $pet_id) { - - $name = $request->get('name'); $status = $request->get('status'); +$app->POST('/v2/pet/{petId}', function(Application $app, Request $request, $petId) { + $name = $request->get('name'); + $status = $request->get('status'); return new Response('How about implementing updatePetWithForm as a POST method ?'); }); -$app->POST('/v2/pet/{petId}/uploadImage', function(Application $app, Request $request, $pet_id) { - - $additional_metadata = $request->get('additional_metadata'); $file = $request->get('file'); +$app->POST('/v2/pet/{petId}/uploadImage', function(Application $app, Request $request, $petId) { + $additional_metadata = $request->get('additional_metadata'); + $file = $request->get('file'); return new Response('How about implementing uploadFile as a POST method ?'); }); -$app->DELETE('/v2/store/order/{orderId}', function(Application $app, Request $request, $order_id) { - - +$app->DELETE('/v2/store/order/{orderId}', function(Application $app, Request $request, $orderId) { return new Response('How about implementing deleteOrder as a DELETE method ?'); }); $app->GET('/v2/store/inventory', function(Application $app, Request $request) { - - return new Response('How about implementing getInventory as a GET method ?'); }); -$app->GET('/v2/store/order/{orderId}', function(Application $app, Request $request, $order_id) { - - +$app->GET('/v2/store/order/{orderId}', function(Application $app, Request $request, $orderId) { return new Response('How about implementing getOrderById as a GET method ?'); }); $app->POST('/v2/store/order', function(Application $app, Request $request) { - - return new Response('How about implementing placeOrder as a POST method ?'); }); $app->POST('/v2/user', function(Application $app, Request $request) { - - return new Response('How about implementing createUser as a POST method ?'); }); $app->POST('/v2/user/createWithArray', function(Application $app, Request $request) { - - return new Response('How about implementing createUsersWithArrayInput as a POST method ?'); }); $app->POST('/v2/user/createWithList', function(Application $app, Request $request) { - - return new Response('How about implementing createUsersWithListInput as a POST method ?'); }); $app->DELETE('/v2/user/{username}', function(Application $app, Request $request, $username) { - - return new Response('How about implementing deleteUser as a DELETE method ?'); }); $app->GET('/v2/user/{username}', function(Application $app, Request $request, $username) { - - return new Response('How about implementing getUserByName as a GET method ?'); }); $app->GET('/v2/user/login', function(Application $app, Request $request) { - $username = $request->get('username'); $password = $request->get('password'); - + $username = $request->get('username'); + $password = $request->get('password'); return new Response('How about implementing loginUser as a GET method ?'); }); $app->GET('/v2/user/logout', function(Application $app, Request $request) { - - return new Response('How about implementing logoutUser as a GET method ?'); }); $app->PUT('/v2/user/{username}', function(Application $app, Request $request, $username) { - - return new Response('How about implementing updateUser as a PUT method ?'); }); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index 9590001aab3..133c9906b51 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -27,6 +27,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -43,24 +44,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - default CompletableFuture> testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + default CompletableFuture> testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -70,18 +59,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - default CompletableFuture> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + default CompletableFuture> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index fd5b2c93f82..f3cef991920 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -31,6 +31,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -49,11 +50,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -68,6 +69,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -86,6 +88,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -102,6 +105,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -121,6 +125,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -139,13 +144,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -159,13 +163,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { + default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java index b99481c2aff..12bc5b40659 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java @@ -26,6 +26,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -40,6 +41,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -54,6 +56,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -67,6 +70,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index 2b539a21966..f1fd5b05460 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -25,6 +25,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -37,6 +38,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -49,6 +51,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -62,6 +65,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -76,6 +80,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -89,11 +94,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + default CompletableFuture> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -102,6 +107,7 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -115,11 +121,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { + default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java index fc491c68d6b..c6d568be7ed 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index 2feb92b12e5..2569d1d6289 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -25,6 +25,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -38,41 +39,23 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java index c984ea73b68..1a0867b554f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java @@ -32,31 +32,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java index bf962faa6fd..9bb5f61c0e3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -22,6 +22,7 @@ public interface FakeClassnameTestApi { @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java index dcd4a0f8b8c..3490fe19a63 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -44,11 +45,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -60,6 +61,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -75,6 +77,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,6 +91,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -104,6 +108,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -119,13 +124,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -136,12 +140,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java index 47c2c561ff1..7a756ae42b0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -35,6 +36,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -46,6 +48,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -56,6 +59,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java index 2d15d4b071a..3e21c92547f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -32,6 +33,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -41,6 +43,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -51,6 +54,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -62,6 +66,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -72,16 +77,17 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -92,10 +98,10 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java index 342ebe05be6..0f144806e9e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java index cbdd93952b8..40d9281a51a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java @@ -26,6 +26,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -42,24 +43,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -69,18 +58,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + default ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java index 6e162ee2183..9f5e48caec9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java @@ -26,7 +26,7 @@ public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - FakeApiController(FakeApiDelegate delegate) { + public FakeApiController(FakeApiDelegate delegate) { this.delegate = delegate; } @@ -37,31 +37,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java index 7ffb559205b..c387ea95877 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java @@ -30,6 +30,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -48,11 +49,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -67,6 +68,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -85,6 +87,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -101,6 +104,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -120,6 +124,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -138,13 +143,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -158,13 +162,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java index 03c23df7b47..c4099e569b4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java @@ -25,7 +25,7 @@ public class PetApiController implements PetApi { private final PetApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - PetApiController(PetApiDelegate delegate) { + public PetApiController(PetApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java index 2c1ad770b52..227c85b9e55 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java @@ -25,6 +25,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -39,6 +40,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -53,6 +55,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -66,6 +69,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java index 050a9d7de74..07ed22b7314 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java @@ -24,7 +24,7 @@ public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - StoreApiController(StoreApiDelegate delegate) { + public StoreApiController(StoreApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java index 384f944c78f..b01d889484a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java @@ -24,6 +24,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -36,6 +37,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -48,6 +50,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -61,6 +64,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -75,6 +79,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,11 +93,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -101,6 +106,7 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -114,11 +120,11 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { + default ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java index 785e28f4509..d1da3d48881 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java @@ -24,7 +24,7 @@ public class UserApiController implements UserApi { private final UserApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - UserApiController(UserApiDelegate delegate) { + public UserApiController(UserApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java index fc491c68d6b..c6d568be7ed 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java index 2feb92b12e5..2569d1d6289 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java @@ -25,6 +25,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -38,41 +39,23 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java index 1162a0ba093..3e374746c00 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java @@ -26,7 +26,7 @@ public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - FakeApiController(FakeApiDelegate delegate) { + public FakeApiController(FakeApiDelegate delegate) { this.delegate = delegate; } @@ -37,31 +37,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java index bf962faa6fd..9bb5f61c0e3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -22,6 +22,7 @@ public interface FakeClassnameTestApi { @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApiController.java index f336b2738f2..eb37354ecb8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApiController.java @@ -23,7 +23,7 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - FakeClassnameTestApiController(FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(FakeClassnameTestApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java index dcd4a0f8b8c..3490fe19a63 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -44,11 +45,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -60,6 +61,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -75,6 +77,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,6 +91,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -104,6 +108,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -119,13 +124,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -136,12 +140,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java index 03c23df7b47..c4099e569b4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java @@ -25,7 +25,7 @@ public class PetApiController implements PetApi { private final PetApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - PetApiController(PetApiDelegate delegate) { + public PetApiController(PetApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java index 47c2c561ff1..7a756ae42b0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -35,6 +36,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -46,6 +48,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -56,6 +59,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java index 050a9d7de74..07ed22b7314 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java @@ -24,7 +24,7 @@ public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - StoreApiController(StoreApiDelegate delegate) { + public StoreApiController(StoreApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java index 2d15d4b071a..3e21c92547f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -32,6 +33,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -41,6 +43,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -51,6 +54,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -62,6 +66,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -72,16 +77,17 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -92,10 +98,10 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java index 785e28f4509..d1da3d48881 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java @@ -24,7 +24,7 @@ public class UserApiController implements UserApi { private final UserApiDelegate delegate; @org.springframework.beans.factory.annotation.Autowired - UserApiController(UserApiDelegate delegate) { + public UserApiController(UserApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java index 342ebe05be6..0f144806e9e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen-ignore b/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/springboot-implicitHeaders/README.md b/samples/server/petstore/springboot-implicitHeaders/README.md new file mode 100644 index 00000000000..a2e8a9f7b84 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/README.md @@ -0,0 +1,18 @@ +# Swagger generated server + +Spring Boot Server + + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub. +This is an example of building a swagger-enabled server in Java using the SpringBoot framework. + +The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox) + +Start your server as an simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/ + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml new file mode 100644 index 00000000000..d777f7d31f1 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + io.swagger + swagger-spring + jar + swagger-spring + 1.0.0 + + 1.7 + ${java.version} + ${java.version} + 2.5.0 + + + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + io.springfox + springfox-swagger2 + ${springfox-version} + + + io.springfox + springfox-swagger-ui + ${springfox-version} + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + + + joda-time + joda-time + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/RFC3339DateFormat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/RFC3339DateFormat.java new file mode 100644 index 00000000000..0c3d276d2d4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/RFC3339DateFormat.java @@ -0,0 +1,20 @@ +package io.swagger; + +import com.fasterxml.jackson.databind.util.ISO8601DateFormat; +import com.fasterxml.jackson.databind.util.ISO8601Utils; + +import java.text.FieldPosition; +import java.util.Date; + + +public class RFC3339DateFormat extends ISO8601DateFormat { + + // Same as ISO8601DateFormat but serializing milliseconds. + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + String value = ISO8601Utils.format(date, true); + toAppendTo.append(value); + return toAppendTo; + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/Swagger2SpringBoot.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/Swagger2SpringBoot.java new file mode 100644 index 00000000000..c06fbae3c7a --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/Swagger2SpringBoot.java @@ -0,0 +1,36 @@ +package io.swagger; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.ExitCodeGenerator; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@EnableSwagger2 +@ComponentScan(basePackages = "io.swagger") +public class Swagger2SpringBoot implements CommandLineRunner { + + @Override + public void run(String... arg0) throws Exception { + if (arg0.length > 0 && arg0[0].equals("exitcode")) { + throw new ExitException(); + } + } + + public static void main(String[] args) throws Exception { + new SpringApplication(Swagger2SpringBoot.class).run(args); + } + + class ExitException extends RuntimeException implements ExitCodeGenerator { + private static final long serialVersionUID = 1L; + + @Override + public int getExitCode() { + return 10; + } + + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiException.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiException.java new file mode 100644 index 00000000000..7fa61c50d24 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + + +public class ApiException extends Exception{ + private int code; + public ApiException (int code, String msg) { + super(msg); + this.code = code; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiOriginFilter.java new file mode 100644 index 00000000000..f0f62dc7206 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiOriginFilter.java @@ -0,0 +1,27 @@ +package io.swagger.api; + +import java.io.IOException; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; + + +public class ApiOriginFilter implements javax.servlet.Filter { + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + @Override + public void destroy() { + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiResponseMessage.java new file mode 100644 index 00000000000..f03840f8e06 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/ApiResponseMessage.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import javax.xml.bind.annotation.XmlTransient; + + +@javax.xml.bind.annotation.XmlRootElement +public class ApiResponseMessage { + public static final int ERROR = 1; + public static final int WARNING = 2; + public static final int INFO = 3; + public static final int OK = 4; + public static final int TOO_BUSY = 5; + + int code; + String type; + String message; + + public ApiResponseMessage(){} + + public ApiResponseMessage(int code, String message){ + this.code = code; + switch(code){ + case ERROR: + setType("error"); + break; + case WARNING: + setType("warning"); + break; + case INFO: + setType("info"); + break; + case OK: + setType("ok"); + break; + case TOO_BUSY: + setType("too busy"); + break; + default: + setType("unknown"); + break; + } + this.message = message; + } + + @XmlTransient + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java new file mode 100644 index 00000000000..99a374eb894 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java @@ -0,0 +1,67 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "fake", description = "the fake API") +public interface FakeApi { + + @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/fake", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body); + + + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @Authorization(value = "http_basic_test") + }, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/fake", + produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, + consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, + method = RequestMethod.POST) + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + + + @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request", response = Void.class), + @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @ApiImplicitParams({ + @ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"),@ApiImplicitParam(name = "enumHeaderString", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") + }) + @RequestMapping(value = "/fake", + produces = { "*/*" }, + consumes = { "*/*" }, + method = RequestMethod.GET) + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java new file mode 100644 index 00000000000..01d1f359a60 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java @@ -0,0 +1,62 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class FakeApiController implements FakeApi { + + + + public ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, + @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, + @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, + @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, + @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, + @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, + @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, + @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, + @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, + @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/NotFoundException.java new file mode 100644 index 00000000000..295109d7fc4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/NotFoundException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + + +public class NotFoundException extends ApiException { + private int code; + public NotFoundException (int code, String msg) { + super(code, msg); + this.code = code; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..1ca26cba6a9 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java @@ -0,0 +1,166 @@ +package io.swagger.api; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "pet", description = "the pet API") +public interface PetApi { + + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @ApiImplicitParams({ + @ApiImplicitParam(name = "test", value = "Test header", required=true, dataType = "String", paramType = "header"),@ApiImplicitParam(name = "range", value = "range header", dataType = "Integer", paramType = "header") + }) + @RequestMapping(value = "/pet", + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" }, + method = RequestMethod.POST) + ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body); + + + @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @ApiImplicitParams({ + @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") + }) + @RequestMapping(value = "/pet/{petId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.DELETE) + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId); + + + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/findByStatus", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); + + + @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/findByTags", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags); + + + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @Authorization(value = "api_key") + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), + @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/{petId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId); + + + @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class), + @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet", + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" }, + method = RequestMethod.PUT) + ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body); + + + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/{petId}", + produces = { "application/xml", "application/json" }, + consumes = { "application/x-www-form-urlencoded" }, + method = RequestMethod.POST) + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + + + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/pet/{petId}/uploadImage", + produces = { "application/json" }, + consumes = { "multipart/form-data" }, + method = RequestMethod.POST) + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java new file mode 100644 index 00000000000..b7c01ba2f07 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java @@ -0,0 +1,72 @@ +package io.swagger.api; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class PetApiController implements PetApi { + + + + public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { + // do some magic! + return new ResponseEntity>(HttpStatus.OK); + } + + public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { + // do some magic! + return new ResponseEntity>(HttpStatus.OK); + } + + public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, + @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, + @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..b63234b59a4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java @@ -0,0 +1,76 @@ +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "store", description = "the store API") +public interface StoreApi { + + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/order/{orderId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.DELETE) + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); + + + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/inventory", + produces = { "application/json" }, + method = RequestMethod.GET) + ResponseEntity> getInventory(); + + + @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), + @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/order/{orderId}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); + + + @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/store/order", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java new file mode 100644 index 00000000000..97a1b7e5129 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java @@ -0,0 +1,47 @@ +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class StoreApiController implements StoreApi { + + + + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity> getInventory() { + // do some magic! + return new ResponseEntity>(HttpStatus.OK); + } + + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..d30ad1a33be --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java @@ -0,0 +1,123 @@ +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import javax.validation.constraints.*; + +@Api(value = "user", description = "the user API") +public interface UserApi { + + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body); + + + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/createWithArray", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body); + + + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/createWithList", + produces = { "application/xml", "application/json" }, + method = RequestMethod.POST) + ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body); + + + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/{username}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.DELETE) + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username); + + + @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), + @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/{username}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username); + + + @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/login", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + + + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/logout", + produces = { "application/xml", "application/json" }, + method = RequestMethod.GET) + ResponseEntity logoutUser(); + + + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/user/{username}", + produces = { "application/xml", "application/json" }, + method = RequestMethod.PUT) + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApiController.java new file mode 100644 index 00000000000..c321750e95e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApiController.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +import javax.validation.constraints.*; + +@Controller +public class UserApiController implements UserApi { + + + + public ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity logoutUser() { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + + public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, + @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/HomeController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/HomeController.java new file mode 100644 index 00000000000..d195523c1d3 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/HomeController.java @@ -0,0 +1,16 @@ +package io.swagger.configuration; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + @RequestMapping(value = "/") + public String index() { + System.out.println("swagger-ui.html"); + return "redirect:swagger-ui.html"; + } +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java new file mode 100644 index 00000000000..5658793e134 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -0,0 +1,40 @@ +package io.swagger.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; + + +@Configuration +public class SwaggerDocumentationConfig { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("Swagger Petstore") + .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\") + .license("Apache 2.0") + .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "apiteam@swagger.io")) + .build(); + } + + @Bean + public Docket customImplementation(){ + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("io.swagger.api")) + .build() + .directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..81535e041fa --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -0,0 +1,110 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesClass + */ + +public class AdditionalPropertiesClass { + @JsonProperty("map_property") + private Map mapProperty = new HashMap(); + + @JsonProperty("map_of_map_property") + private Map> mapOfMapProperty = new HashMap>(); + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @ApiModelProperty(value = "") + public Map getMapProperty() { + return mapProperty; + } + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @ApiModelProperty(value = "") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java new file mode 100644 index 00000000000..a218f0b5542 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java @@ -0,0 +1,105 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Animal + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), +}) + +public class Animal { + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java new file mode 100644 index 00000000000..33dc04699af --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java @@ -0,0 +1,50 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.model.Animal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * AnimalFarm + */ + +public class AnimalFarm extends ArrayList { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnimalFarm {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..3be691e4d95 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * ArrayOfArrayOfNumberOnly + */ + +public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") + private List> arrayArrayNumber = new ArrayList>(); + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..12196897345 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * ArrayOfNumberOnly + */ + +public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") + private List arrayNumber = new ArrayList(); + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @ApiModelProperty(value = "") + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java new file mode 100644 index 00000000000..a26a1600287 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java @@ -0,0 +1,138 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.ReadOnlyFirst; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * ArrayTest + */ + +public class ArrayTest { + @JsonProperty("array_of_string") + private List arrayOfString = new ArrayList(); + + @JsonProperty("array_array_of_integer") + private List> arrayArrayOfInteger = new ArrayList>(); + + @JsonProperty("array_array_of_model") + private List> arrayArrayOfModel = new ArrayList>(); + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @ApiModelProperty(value = "") + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java new file mode 100644 index 00000000000..d7ad5642ccf --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java @@ -0,0 +1,189 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Capitalization + */ + +public class Capitalization { + @JsonProperty("smallCamel") + private String smallCamel = null; + + @JsonProperty("CapitalCamel") + private String capitalCamel = null; + + @JsonProperty("small_Snake") + private String smallSnake = null; + + @JsonProperty("Capital_Snake") + private String capitalSnake = null; + + @JsonProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints = null; + + @JsonProperty("ATT_NAME") + private String ATT_NAME = null; + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @ApiModelProperty(value = "") + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @ApiModelProperty(value = "") + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @ApiModelProperty(value = "") + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @ApiModelProperty(value = "") + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java new file mode 100644 index 00000000000..747e5dc0c7e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java @@ -0,0 +1,76 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Animal; +import javax.validation.constraints.*; +/** + * Cat + */ + +public class Cat extends Animal { + @JsonProperty("declawed") + private Boolean declawed = null; + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @ApiModelProperty(value = "") + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..9629da6500e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Category + */ + +public class Category { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("name") + private String name = null; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..d69acffefa8 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java @@ -0,0 +1,75 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing model with \"_class\" property + */ +@ApiModel(description = "Model for testing model with \"_class\" property") + +public class ClassModel { + @JsonProperty("_class") + private String propertyClass = null; + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java new file mode 100644 index 00000000000..f9cec5a225e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java @@ -0,0 +1,74 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Client + */ + +public class Client { + @JsonProperty("client") + private String client = null; + + public Client client(String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @ApiModelProperty(value = "") + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java new file mode 100644 index 00000000000..9057e840fc3 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java @@ -0,0 +1,76 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Animal; +import javax.validation.constraints.*; +/** + * Dog + */ + +public class Dog extends Animal { + @JsonProperty("breed") + private String breed = null; + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @ApiModelProperty(value = "") + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java new file mode 100644 index 00000000000..97ab6f6410e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java @@ -0,0 +1,167 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * EnumArrays + */ + +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String text) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("just_symbol") + private JustSymbolEnum justSymbol = null; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("array_enum") + private List arrayEnum = new ArrayList(); + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + **/ + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @ApiModelProperty(value = "") + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumClass.java new file mode 100644 index 00000000000..cdfc0933c3e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumClass.java @@ -0,0 +1,41 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.validation.constraints.*; +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java new file mode 100644 index 00000000000..9f2a0275a6a --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java @@ -0,0 +1,240 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.OuterEnum; +import javax.validation.constraints.*; +/** + * EnumTest + */ + +public class EnumTest { + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String text) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string") + private EnumStringEnum enumString = null; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_integer") + private EnumIntegerEnum enumInteger = null; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(String text) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_number") + private EnumNumberEnum enumNumber = null; + + @JsonProperty("outerEnum") + private OuterEnum outerEnum = null; + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java new file mode 100644 index 00000000000..aed8db1ed96 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java @@ -0,0 +1,380 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +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 javax.validation.constraints.*; +/** + * FormatTest + */ + +public class FormatTest { + @JsonProperty("integer") + private Integer integer = null; + + @JsonProperty("int32") + private Integer int32 = null; + + @JsonProperty("int64") + private Long int64 = null; + + @JsonProperty("number") + private BigDecimal number = null; + + @JsonProperty("float") + private Float _float = null; + + @JsonProperty("double") + private Double _double = null; + + @JsonProperty("string") + private String string = null; + + @JsonProperty("byte") + private byte[] _byte = null; + + @JsonProperty("binary") + private byte[] binary = null; + + @JsonProperty("date") + private LocalDate date = null; + + @JsonProperty("dateTime") + private DateTime dateTime = null; + + @JsonProperty("uuid") + private UUID uuid = null; + + @JsonProperty("password") + private String password = null; + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @ApiModelProperty(value = "") + @Min(10) + @Max(100) + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @ApiModelProperty(value = "") + @Min(20) + @Max(200) + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @ApiModelProperty(value = "") + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @ApiModelProperty(value = "") + @DecimalMin("54.3") + @DecimalMax("987.6") + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @ApiModelProperty(value = "") + @DecimalMin("67.8") + @DecimalMax("123.4") + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @ApiModelProperty(value = "") + public byte[] getBinary() { + return binary; + } + + public void setBinary(byte[] binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(value = "") + public DateTime getDateTime() { + return dateTime; + } + + public void setDateTime(DateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + @Size(min=10,max=64) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Objects.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..a26492e4912 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * HasOnlyReadOnly + */ + +public class HasOnlyReadOnly { + @JsonProperty("bar") + private String bar = null; + + @JsonProperty("foo") + private String foo = null; + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(readOnly = true, value = "") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + /** + * Get foo + * @return foo + **/ + @ApiModelProperty(readOnly = true, value = "") + public String getFoo() { + return foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java new file mode 100644 index 00000000000..9a0566a8dd1 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java @@ -0,0 +1,142 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; +/** + * MapTest + */ + +public class MapTest { + @JsonProperty("map_map_of_string") + private Map> mapMapOfString = new HashMap>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String text) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("map_of_enum_string") + private Map mapOfEnumString = new HashMap(); + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..2cb9928d5fe --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,131 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Animal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.joda.time.DateTime; +import javax.validation.constraints.*; +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ + +public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") + private UUID uuid = null; + + @JsonProperty("dateTime") + private DateTime dateTime = null; + + @JsonProperty("map") + private Map map = new HashMap(); + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @ApiModelProperty(value = "") + public DateTime getDateTime() { + return dateTime; + } + + public void setDateTime(DateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + **/ + @ApiModelProperty(value = "") + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java new file mode 100644 index 00000000000..4d47f6c03c9 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java @@ -0,0 +1,98 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing model name starting with number + */ +@ApiModel(description = "Model for testing model name starting with number") + +public class Model200Response { + @JsonProperty("name") + private Integer name = null; + + @JsonProperty("class") + private String propertyClass = null; + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200Response = (Model200Response) o; + return Objects.equals(this.name, _200Response.name) && + Objects.equals(this.propertyClass, _200Response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..36da9b20d9d --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,120 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * ModelApiResponse + */ + +public class ModelApiResponse { + @JsonProperty("code") + private Integer code = null; + + @JsonProperty("type") + private String type = null; + + @JsonProperty("message") + private String message = null; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @ApiModelProperty(value = "") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(value = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @ApiModelProperty(value = "") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java new file mode 100644 index 00000000000..7ffc24a0144 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java @@ -0,0 +1,75 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing reserved words + */ +@ApiModel(description = "Model for testing reserved words") + +public class ModelReturn { + @JsonProperty("return") + private Integer _return = null; + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @ApiModelProperty(value = "") + public Integer getReturn() { + return _return; + } + + public void setReturn(Integer _return) { + this._return = _return; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java new file mode 100644 index 00000000000..953199166ff --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java @@ -0,0 +1,145 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Model for testing model name same as property name + */ +@ApiModel(description = "Model for testing model name same as property name") + +public class Name { + @JsonProperty("name") + private Integer name = null; + + @JsonProperty("snake_case") + private Integer snakeCase = null; + + @JsonProperty("property") + private String property = null; + + @JsonProperty("123Number") + private Integer _123Number = null; + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + @ApiModelProperty(readOnly = true, value = "") + public Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @ApiModelProperty(value = "") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + /** + * Get _123Number + * @return _123Number + **/ + @ApiModelProperty(readOnly = true, value = "") + public Integer get123Number() { + return _123Number; + } + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123Number, name._123Number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123Number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java new file mode 100644 index 00000000000..e6dbf3139e2 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java @@ -0,0 +1,75 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import javax.validation.constraints.*; +/** + * NumberOnly + */ + +public class NumberOnly { + @JsonProperty("JustNumber") + private BigDecimal justNumber = null; + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..41dec079587 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java @@ -0,0 +1,224 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +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 javax.validation.constraints.*; +/** + * Order + */ + +public class Order { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("petId") + private Long petId = null; + + @JsonProperty("quantity") + private Integer quantity = null; + + @JsonProperty("shipDate") + private DateTime shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("status") + private StatusEnum status = null; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @ApiModelProperty(value = "") + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @ApiModelProperty(value = "") + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(DateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @ApiModelProperty(value = "") + public DateTime getShipDate() { + return shipDate; + } + + public void setShipDate(DateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @ApiModelProperty(value = "") + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..5f0075e4457 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,41 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.validation.constraints.*; +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..9adc708de71 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java @@ -0,0 +1,239 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +/** + * Pet + */ + +public class Pet { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("category") + private Category category = null; + + @JsonProperty("name") + private String name = null; + + @JsonProperty("photoUrls") + private List photoUrls = new ArrayList(); + + @JsonProperty("tags") + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("status") + private StatusEnum status = null; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @ApiModelProperty(value = "") + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @ApiModelProperty(value = "") + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..47700659fd2 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * ReadOnlyFirst + */ + +public class ReadOnlyFirst { + @JsonProperty("bar") + private String bar = null; + + @JsonProperty("baz") + private String baz = null; + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @ApiModelProperty(readOnly = true, value = "") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @ApiModelProperty(value = "") + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java new file mode 100644 index 00000000000..880d70599b0 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java @@ -0,0 +1,74 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * SpecialModelName + */ + +public class SpecialModelName { + @JsonProperty("$special[property.name]") + private Long specialPropertyName = null; + + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + /** + * Get specialPropertyName + * @return specialPropertyName + **/ + @ApiModelProperty(value = "") + public Long getSpecialPropertyName() { + return specialPropertyName; + } + + public void setSpecialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash(specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..298085317a4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java @@ -0,0 +1,97 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * Tag + */ + +public class Tag { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("name") + private String name = null; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java new file mode 100644 index 00000000000..8e40f7e0594 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java @@ -0,0 +1,235 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +/** + * User + */ + +public class User { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("username") + private String username = null; + + @JsonProperty("firstName") + private String firstName = null; + + @JsonProperty("lastName") + private String lastName = null; + + @JsonProperty("email") + private String email = null; + + @JsonProperty("password") + private String password = null; + + @JsonProperty("phone") + private String phone = null; + + @JsonProperty("userStatus") + private Integer userStatus = null; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @ApiModelProperty(value = "") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @ApiModelProperty(value = "") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @ApiModelProperty(value = "") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @ApiModelProperty(value = "") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(value = "") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @ApiModelProperty(value = "") + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties new file mode 100644 index 00000000000..a2ef8627027 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties @@ -0,0 +1,5 @@ +springfox.documentation.swagger.v2.path=/api-docs +server.contextPath=/v2 +server.port=8080 +spring.jackson.date-format=io.swagger.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java index 2feb92b12e5..2569d1d6289 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java @@ -25,6 +25,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, @@ -38,41 +39,23 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @RequestMapping(value = "/fake", produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java index c984ea73b68..1a0867b554f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java @@ -32,31 +32,31 @@ public class FakeApiController implements FakeApi { } public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="_double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="_byte", required=true) byte[] _byte, + @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="_float", required=false) Float _float, + @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime, @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="paramCallback", required=false) String paramCallback) { + @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java index bf962faa6fd..9bb5f61c0e3 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -22,6 +22,7 @@ public interface FakeClassnameTestApi { @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java index dcd4a0f8b8c..3490fe19a63 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java @@ -29,6 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -44,11 +45,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -60,6 +61,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -75,6 +77,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -88,6 +91,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -104,6 +108,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @RequestMapping(value = "/pet", produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, @@ -119,13 +124,12 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -136,12 +140,11 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java index 47c2c561ff1..7a756ae42b0 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java @@ -24,6 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -35,6 +36,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) @@ -46,6 +48,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -56,6 +59,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java index 2d15d4b071a..3e21c92547f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java @@ -23,6 +23,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -32,6 +33,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -41,6 +43,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) @@ -51,6 +54,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) @@ -62,6 +66,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -72,16 +77,17 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) @@ -92,10 +98,10 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java index 342ebe05be6..0f144806e9e 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java @@ -66,9 +66,7 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") - @Min(10) - @Max(100) - public Integer getInteger() { + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -88,9 +86,7 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") - @Min(20) - @Max(200) - public Integer getInt32() { + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -129,9 +125,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - public BigDecimal getNumber() { + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -151,9 +145,7 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") - @DecimalMin("54.3") - @DecimalMax("987.6") - public Float getFloat() { + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -173,9 +165,7 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") - @DecimalMin("67.8") - @DecimalMax("123.4") - public Double getDouble() { + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -193,8 +183,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") - @Pattern(regexp="/[a-z]/i") - public String getString() { + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -305,8 +294,7 @@ public class FormatTest { **/ @ApiModelProperty(required = true, value = "") @NotNull - @Size(min=10,max=64) - public String getPassword() { + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/shippable.yml b/shippable.yml index 97ed4286983..0d4df63c067 100644 --- a/shippable.yml +++ b/shippable.yml @@ -1,8 +1,8 @@ language: java jdk: +- oraclejdk8 - openjdk7 -- openjdk8 build: cache: true