diff --git a/bin/android-petstore-volley.json b/bin/android-petstore-volley.json index 913ef5c0139..7366f4817c9 100644 --- a/bin/android-petstore-volley.json +++ b/bin/android-petstore-volley.json @@ -1,4 +1,4 @@ { "library": "volley", - "artifactId": "swagger-petstore-android-volley" + "artifactId": "petstore-android-volley" } diff --git a/bin/java-petstore-feign.json b/bin/java-petstore-feign.json index 5502ee3bbad..2b1db7d5f96 100644 --- a/bin/java-petstore-feign.json +++ b/bin/java-petstore-feign.json @@ -1,4 +1,4 @@ { "library": "feign", - "artifactId": "swagger-petstore-feign" + "artifactId": "petstore-feign" } diff --git a/bin/java-petstore-google-api-client.json b/bin/java-petstore-google-api-client.json index 66df1f8c601..c25698724b0 100644 --- a/bin/java-petstore-google-api-client.json +++ b/bin/java-petstore-google-api-client.json @@ -1,4 +1,4 @@ { "library": "google-api-client", - "artifactId": "swagger-petstore-google-api-client" + "artifactId": "petstore-google-api-client" } diff --git a/bin/java-petstore-jersey1.sh b/bin/java-petstore-jersey1.sh index 988ce6e4deb..19005ca2114 100755 --- a/bin/java-petstore-jersey1.sh +++ b/bin/java-petstore-jersey1.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/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -o samples/client/petstore/java/jersey1 -DhideGenerationTimestamp=true --library=jersey1" +ags="$@ generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -o samples/client/petstore/java/jersey1 -DhideGenerationTimestamp=true --library=jersey1" echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main" rm -rf samples/client/petstore/java/jersey1/src/main diff --git a/bin/java-petstore-jersey2.json b/bin/java-petstore-jersey2.json index 6efa52949a4..79ed4cbc2e1 100644 --- a/bin/java-petstore-jersey2.json +++ b/bin/java-petstore-jersey2.json @@ -1,4 +1,4 @@ { "library": "jersey2", - "artifactId": "swagger-petstore-jersey2" + "artifactId": "petstore-jersey2" } diff --git a/bin/java-petstore-okhttp-gson-parcelable.sh b/bin/java-petstore-okhttp-gson-parcelable.sh index 49f62b15c03..f6bad79d995 100755 --- a/bin/java-petstore-okhttp-gson-parcelable.sh +++ b/bin/java-petstore-okhttp-gson-parcelable.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/openapi-generator/src/main/resources/Java/libraries/okhttp-gson -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel -DhideGenerationTimestamp=true,parcelableModel=true" +ags="$@ generate --artifact-id petstore-okhttp-gson-parcelableModel -t modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel -DhideGenerationTimestamp=true,parcelableModel=true" rm -rf samples/client/petstore/java/okhttp-gson-parcelableModel/src/main find samples/client/petstore/java/okhttp-gson-parcelableModel -maxdepth 1 -type f ! -name "README.md" -exec rm {} + diff --git a/bin/java-petstore-okhttp-gson.json b/bin/java-petstore-okhttp-gson.json index b894d172630..8ee5473563b 100644 --- a/bin/java-petstore-okhttp-gson.json +++ b/bin/java-petstore-okhttp-gson.json @@ -1,4 +1,4 @@ { "library": "okhttp-gson", - "artifactId": "swagger-petstore-okhttp-gson" + "artifactId": "petstore-okhttp-gson" } diff --git a/bin/java-petstore-rest-assured.json b/bin/java-petstore-rest-assured.json index 0e56d218fa2..86e6216a23f 100644 --- a/bin/java-petstore-rest-assured.json +++ b/bin/java-petstore-rest-assured.json @@ -1,4 +1,4 @@ { "library": "rest-assured", - "artifactId": "swagger-petstore-rest-assured" + "artifactId": "petstore-rest-assured" } diff --git a/bin/java-petstore-resteasy.json b/bin/java-petstore-resteasy.json index 772ae582002..6998a56fd74 100644 --- a/bin/java-petstore-resteasy.json +++ b/bin/java-petstore-resteasy.json @@ -1,4 +1,4 @@ { "library": "resteasy", - "artifactId": "swagger-petstore-resteasy" + "artifactId": "petstore-resteasy" } diff --git a/bin/java-petstore-resttemplate.json b/bin/java-petstore-resttemplate.json index c5cfe6b2cdd..ab1bc1e4dd7 100644 --- a/bin/java-petstore-resttemplate.json +++ b/bin/java-petstore-resttemplate.json @@ -1,4 +1,4 @@ { "library": "resttemplate", - "artifactId": "swagger-petstore-resttemplate" + "artifactId": "petstore-resttemplate" } diff --git a/bin/java-petstore-retrofit.json b/bin/java-petstore-retrofit.json index 86da9d17099..34ca51f008b 100644 --- a/bin/java-petstore-retrofit.json +++ b/bin/java-petstore-retrofit.json @@ -1,4 +1,4 @@ { "library": "retrofit", - "artifactId": "swagger-petstore-retrofit" + "artifactId": "petstore-retrofit" } diff --git a/bin/java-petstore-retrofit2-play24.sh b/bin/java-petstore-retrofit2-play24.sh index 640f45d3aa3..eab84d44178 100755 --- a/bin/java-petstore-retrofit2-play24.sh +++ b/bin/java-petstore-retrofit2-play24.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 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play24.json -o samples/client/petstore/java/retrofit2-play24 -DhideGenerationTimestamp=true" +ags="$@ generate --artifact-id petstore-java-client-retrofit2-play24 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play24.json -o samples/client/petstore/java/retrofit2-play24 -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/retrofit2-play24/src/main" rm -rf samples/client/petstore/java/retrofit2-play24/src/main diff --git a/bin/java-petstore-retrofit2-play25.sh b/bin/java-petstore-retrofit2-play25.sh index 53f987f4b6c..7d6e3dabaef 100755 --- a/bin/java-petstore-retrofit2-play25.sh +++ b/bin/java-petstore-retrofit2-play25.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 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play25.json -o samples/client/petstore/java/retrofit2-play25 -DhideGenerationTimestamp=true" +ags="$@ generate --artifact-id petstore-java-client-retrofit2-play25 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play25.json -o samples/client/petstore/java/retrofit2-play25 -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/retrofit2-play25/src/main" rm -rf samples/client/petstore/java/retrofit2-play25/src/main diff --git a/bin/java-petstore-retrofit2.json b/bin/java-petstore-retrofit2.json index 4829fd6dd4b..dd835a73442 100644 --- a/bin/java-petstore-retrofit2.json +++ b/bin/java-petstore-retrofit2.json @@ -1,4 +1,4 @@ { "library": "retrofit2", - "artifactId": "swagger-petstore-retrofit2" + "artifactId": "petstore-retrofit2" } diff --git a/bin/java-petstore-retrofit2rx.json b/bin/java-petstore-retrofit2rx.json index c9e4301f2da..739b1ddd272 100644 --- a/bin/java-petstore-retrofit2rx.json +++ b/bin/java-petstore-retrofit2rx.json @@ -1,4 +1,4 @@ { "library": "retrofit2", - "artifactId": "swagger-petstore-retrofit2-rx" + "artifactId": "petstore-retrofit2-rx" } diff --git a/bin/java-petstore-retrofit2rx2.json b/bin/java-petstore-retrofit2rx2.json index 39e06109a62..1f4fb291897 100644 --- a/bin/java-petstore-retrofit2rx2.json +++ b/bin/java-petstore-retrofit2rx2.json @@ -1,4 +1,4 @@ { "library": "retrofit2", - "artifactId": "swagger-petstore-retrofit2-rx2" + "artifactId": "petstore-retrofit2-rx2" } diff --git a/bin/java-petstore-vertx.json b/bin/java-petstore-vertx.json index 9f979f78605..6fd532ccfe4 100644 --- a/bin/java-petstore-vertx.json +++ b/bin/java-petstore-vertx.json @@ -1,4 +1,4 @@ { "library": "vertx", - "artifactId": "swagger-petstore-vertx" + "artifactId": "petstore-vertx" } diff --git a/bin/java8-petstore-jersey2.json b/bin/java8-petstore-jersey2.json index 0b390ba2d67..2c5ee492f6c 100644 --- a/bin/java8-petstore-jersey2.json +++ b/bin/java8-petstore-jersey2.json @@ -1,5 +1,5 @@ { "library": "jersey2", - "artifactId": "swagger-petstore-jersey2", + "artifactId": "petstore-jersey2", "dateLibrary": "java8" } diff --git a/bin/java8-petstore-jersey2.sh b/bin/java8-petstore-jersey2.sh index 20bc858f101..1fc9be47fa0 100755 --- a/bin/java8-petstore-jersey2.sh +++ b/bin/java8-petstore-jersey2.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 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java8-petstore-jersey2.json -o samples/client/petstore/java/jersey2-java8 -DhideGenerationTimestamp=true" +ags="$@ generate --artifact-id petstore-jersey2-java8 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java8-petstore-jersey2.json -o samples/client/petstore/java/jersey2-java8 -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/jersey2-java8/src/main" rm -rf samples/client/petstore/java/jersey2-java8/src/main diff --git a/bin/spring-cloud-feign-petstore.json b/bin/spring-cloud-feign-petstore.json index 7425cee47f6..572f58c1c7e 100644 --- a/bin/spring-cloud-feign-petstore.json +++ b/bin/spring-cloud-feign-petstore.json @@ -1,4 +1,4 @@ { "library": "spring-cloud", - "artifactId": "swagger-petstore-spring-cloud" + "artifactId": "petstore-spring-cloud" } diff --git a/bin/spring-mvc-petstore-j8-async.json b/bin/spring-mvc-petstore-j8-async.json index 92baa989c36..b73cbb09fe4 100644 --- a/bin/spring-mvc-petstore-j8-async.json +++ b/bin/spring-mvc-petstore-j8-async.json @@ -2,5 +2,5 @@ "java8": true, "async": true, "library": "spring-mvc", - "artifactId": "swagger-spring-mvc-server-j8-async" + "artifactId": "spring-mvc-server-j8-async" } diff --git a/bin/spring-mvc-petstore-j8-localdatetime.json b/bin/spring-mvc-petstore-j8-localdatetime.json index 4fc23da84fd..6eeb5d21443 100644 --- a/bin/spring-mvc-petstore-j8-localdatetime.json +++ b/bin/spring-mvc-petstore-j8-localdatetime.json @@ -1,5 +1,5 @@ { "library": "spring-mvc", "dateLibrary": "java8-localdatetime", - "artifactId": "swagger-spring-mvc-j8-localdatetime" + "artifactId": "spring-mvc-j8-localdatetime" } diff --git a/bin/spring-mvc-petstore-server.json b/bin/spring-mvc-petstore-server.json index 4642abf8015..d07026ffcbc 100644 --- a/bin/spring-mvc-petstore-server.json +++ b/bin/spring-mvc-petstore-server.json @@ -1,4 +1,4 @@ { "library": "spring-mvc", - "artifactId": "swagger-spring-mvc-server" + "artifactId": "spring-mvc-server" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache index 6538ed53d2f..9d43d64d78a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache @@ -8,6 +8,8 @@ import {{invokerPackage}}.CollectionFormats.*; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache index 51b1812b49e..32de090e435 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache @@ -8,6 +8,8 @@ import {{invokerPackage}}.CollectionFormats.*; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} diff --git a/samples/client/petstore/java/feign/.openapi-generator-ignore b/samples/client/petstore/java/feign/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/feign/.openapi-generator-ignore +++ b/samples/client/petstore/java/feign/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/feign/README.md b/samples/client/petstore/java/feign/README.md index d5d447e2865..3bad98d153e 100644 --- a/samples/client/petstore/java/feign/README.md +++ b/samples/client/petstore/java/feign/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-feign +# petstore-feign ## Requirements @@ -24,8 +24,8 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-petstore-feign + org.openapitools + petstore-feign 1.0.0 compile @@ -34,7 +34,7 @@ After the client library is installed/deployed, you can use it in your Maven pro ## Recommendation -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. ## Author diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index bacb0517115..b4d7da79267 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-feign' + pom.artifactId = 'petstore-feign' } } diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index fac8ce229a7..0b09ff26bd1 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-feign", + organization := "org.openapitools", + name := "petstore-feign", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 0437c4dd8cc..00000000000 --- a/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ - -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **Map<String, String>** | | [optional] -**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Animal.md b/samples/client/petstore/java/feign/docs/Animal.md deleted file mode 100644 index b3f325c3524..00000000000 --- a/samples/client/petstore/java/feign/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 77292549927..00000000000 --- a/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md deleted file mode 100644 index e8cc4cd36dc..00000000000 --- a/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ArrayTest.md b/samples/client/petstore/java/feign/docs/ArrayTest.md deleted file mode 100644 index 9feee16427f..00000000000 --- a/samples/client/petstore/java/feign/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **List<String>** | | [optional] -**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] -**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Cat.md b/samples/client/petstore/java/feign/docs/Cat.md deleted file mode 100644 index be6e56fa8ce..00000000000 --- a/samples/client/petstore/java/feign/docs/Cat.md +++ /dev/null @@ -1,12 +0,0 @@ - -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] -**declawed** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Category.md b/samples/client/petstore/java/feign/docs/Category.md deleted file mode 100644 index e2df0803278..00000000000 --- a/samples/client/petstore/java/feign/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Dog.md b/samples/client/petstore/java/feign/docs/Dog.md deleted file mode 100644 index 71a7dbe809e..00000000000 --- a/samples/client/petstore/java/feign/docs/Dog.md +++ /dev/null @@ -1,12 +0,0 @@ - -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] -**breed** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/EnumClass.md b/samples/client/petstore/java/feign/docs/EnumClass.md deleted file mode 100644 index c746edc3cb1..00000000000 --- a/samples/client/petstore/java/feign/docs/EnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ - -# EnumClass - -## Enum - - -* `_ABC` (value: `"_abc"`) - -* `_EFG` (value: `"-efg"`) - -* `_XYZ_` (value: `"(xyz)"`) - - - diff --git a/samples/client/petstore/java/feign/docs/EnumTest.md b/samples/client/petstore/java/feign/docs/EnumTest.md deleted file mode 100644 index deb1951c552..00000000000 --- a/samples/client/petstore/java/feign/docs/EnumTest.md +++ /dev/null @@ -1,36 +0,0 @@ - -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] -**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] -**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] - - - -## Enum: EnumStringEnum -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" - - - -## Enum: EnumIntegerEnum -Name | Value ----- | ----- -NUMBER_1 | 1 -NUMBER_MINUS_1 | -1 - - - -## Enum: EnumNumberEnum -Name | Value ----- | ----- -NUMBER_1_DOT_1 | 1.1 -NUMBER_MINUS_1_DOT_2 | -1.2 - - - diff --git a/samples/client/petstore/java/feign/docs/FakeApi.md b/samples/client/petstore/java/feign/docs/FakeApi.md deleted file mode 100644 index 21a4db7c377..00000000000 --- a/samples/client/petstore/java/feign/docs/FakeApi.md +++ /dev/null @@ -1,122 +0,0 @@ -# FakeApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters - - - -# **testEndpointParameters** -> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -BigDecimal number = new BigDecimal(); // BigDecimal | None -Double _double = 3.4D; // Double | None -String string = "string_example"; // String | None -byte[] _byte = B; // byte[] | None -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -DateTime dateTime = new DateTime(); // DateTime | None -String password = "password_example"; // String | None -try { - apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **string** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 - - -# **testEnumQueryParameters** -> testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble) - -To test enum query parameters - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -String enumQueryString = "-efg"; // String | Query parameter enum test (string) -BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double) -Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) -try { - apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEnumQueryParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/feign/docs/FormatTest.md b/samples/client/petstore/java/feign/docs/FormatTest.md deleted file mode 100644 index 44de7d9511a..00000000000 --- a/samples/client/petstore/java/feign/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ - -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | | [optional] -**int32** | **Integer** | | [optional] -**int64** | **Long** | | [optional] -**number** | [**BigDecimal**](BigDecimal.md) | | -**_float** | **Float** | | [optional] -**_double** | **Double** | | [optional] -**string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] -**date** | [**LocalDate**](LocalDate.md) | | -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | - - - diff --git a/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md deleted file mode 100644 index c1d0aac5672..00000000000 --- a/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ - -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/MapTest.md b/samples/client/petstore/java/feign/docs/MapTest.md deleted file mode 100644 index c671e97ffbc..00000000000 --- a/samples/client/petstore/java/feign/docs/MapTest.md +++ /dev/null @@ -1,17 +0,0 @@ - -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] -**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] - - - -## Enum: Map<String, InnerEnum> -Name | Value ----- | ----- - - - diff --git a/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index e3487bcc501..00000000000 --- a/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ - -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**map** | [**Map<String, Animal>**](Animal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Model200Response.md b/samples/client/petstore/java/feign/docs/Model200Response.md deleted file mode 100644 index b47618b28cc..00000000000 --- a/samples/client/petstore/java/feign/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | [optional] -**PropertyClass** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ModelApiResponse.md b/samples/client/petstore/java/feign/docs/ModelApiResponse.md deleted file mode 100644 index 3eec8686cc9..00000000000 --- a/samples/client/petstore/java/feign/docs/ModelApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ModelApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Name.md b/samples/client/petstore/java/feign/docs/Name.md deleted file mode 100644 index ce2fb4dee50..00000000000 --- a/samples/client/petstore/java/feign/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | -**snakeCase** | **Integer** | | [optional] -**property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/NumberOnly.md b/samples/client/petstore/java/feign/docs/NumberOnly.md deleted file mode 100644 index a3feac7fadc..00000000000 --- a/samples/client/petstore/java/feign/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Order.md b/samples/client/petstore/java/feign/docs/Order.md deleted file mode 100644 index a1089f5384e..00000000000 --- a/samples/client/petstore/java/feign/docs/Order.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**petId** | **Long** | | [optional] -**quantity** | **Integer** | | [optional] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] -**complete** | **Boolean** | | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" - - - diff --git a/samples/client/petstore/java/feign/docs/Pet.md b/samples/client/petstore/java/feign/docs/Pet.md deleted file mode 100644 index 5b63109ef92..00000000000 --- a/samples/client/petstore/java/feign/docs/Pet.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **List<String>** | | -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -AVAILABLE | "available" -PENDING | "pending" -SOLD | "sold" - - - diff --git a/samples/client/petstore/java/feign/docs/PetApi.md b/samples/client/petstore/java/feign/docs/PetApi.md deleted file mode 100644 index e0314e20e51..00000000000 --- a/samples/client/petstore/java/feign/docs/PetApi.md +++ /dev/null @@ -1,448 +0,0 @@ -# PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **addPet** -> addPet(body) - -Add a new pet to the store - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.addPet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete -String apiKey = "apiKey_example"; // String | -try { - apiInstance.deletePet(petId, apiKey); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByStatus** -> List<Pet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter -try { - List result = apiInstance.findPetsByStatus(status); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List tags = Arrays.asList("tags_example"); // List | Tags to filter by -try { - List result = apiInstance.findPetsByTags(tags); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return -try { - Pet result = apiInstance.getPetById(petId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(body) - -Update an existing pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.updatePet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated -String name = "name_example"; // String | Updated name of the pet -String status = "status_example"; // String | Updated status of the pet -try { - apiInstance.updatePetWithForm(petId, name, status); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json - - -# **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update -String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload -try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md b/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md deleted file mode 100644 index 426b7cde95a..00000000000 --- a/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ - -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/SpecialModelName.md b/samples/client/petstore/java/feign/docs/SpecialModelName.md deleted file mode 100644 index c2c6117c552..00000000000 --- a/samples/client/petstore/java/feign/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ - -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/StoreApi.md b/samples/client/petstore/java/feign/docs/StoreApi.md deleted file mode 100644 index 0b30791725a..00000000000 --- a/samples/client/petstore/java/feign/docs/StoreApi.md +++ /dev/null @@ -1,197 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted -try { - apiInstance.deleteOrder(orderId); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#deleteOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getInventory** -> Map<String, Integer> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.StoreApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -StoreApi apiInstance = new StoreApi(); -try { - Map result = apiInstance.getInventory(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getInventory"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Map<String, Integer>**](Map.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched -try { - Order result = apiInstance.getOrderById(orderId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getOrderById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet -try { - Order result = apiInstance.placeOrder(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#placeOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/feign/docs/Tag.md b/samples/client/petstore/java/feign/docs/Tag.md deleted file mode 100644 index de6814b55d5..00000000000 --- a/samples/client/petstore/java/feign/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/User.md b/samples/client/petstore/java/feign/docs/User.md deleted file mode 100644 index 8b6753dd284..00000000000 --- a/samples/client/petstore/java/feign/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ - -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Integer** | User Status | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/UserApi.md b/samples/client/petstore/java/feign/docs/UserApi.md deleted file mode 100644 index 8cdc15992ee..00000000000 --- a/samples/client/petstore/java/feign/docs/UserApi.md +++ /dev/null @@ -1,370 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(body) - -Create user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object -try { - apiInstance.createUser(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithArrayInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithListInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithListInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted -try { - apiInstance.deleteUser(username); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. -try { - User result = apiInstance.getUserByName(username); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserByName"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The user name for login -String password = "password_example"; // String | The password for login in clear text -try { - String result = apiInstance.loginUser(username, password); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#loginUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -try { - apiInstance.logoutUser(); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#logoutUser"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object -try { - apiInstance.updateUser(username, body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 12c6e74e6ed..ce837265abd 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-feign + org.openapitools + petstore-feign jar - swagger-petstore-feign + petstore-feign 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/feign/settings.gradle b/samples/client/petstore/java/feign/settings.gradle index a25109c126e..56240d66842 100644 --- a/samples/client/petstore/java/feign/settings.gradle +++ b/samples/client/petstore/java/feign/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-feign" \ No newline at end of file +rootProject.name = "petstore-feign" \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 6cef5dde04d..80a9ad82788 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -18,7 +18,7 @@ public interface AnotherFakeApi extends ApiClient.Api { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client */ @RequestLine("PATCH /another-fake/dummy") @@ -26,5 +26,5 @@ public interface AnotherFakeApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - Client testSpecialTags(Client body); + Client testSpecialTags(Client client); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java index 613e8a22fe6..24ab4157c1e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java @@ -5,9 +5,11 @@ import io.swagger.client.EncodingUtils; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -22,28 +24,28 @@ public interface FakeApi extends ApiClient.Api { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean */ @RequestLine("POST /fake/outer/boolean") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: */*", }) - Boolean fakeOuterBooleanSerialize(Boolean body); + Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody); /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite */ @RequestLine("POST /fake/outer/composite") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: */*", }) - OuterComposite fakeOuterCompositeSerialize(OuterComposite body); + OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite); /** * @@ -53,8 +55,8 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("POST /fake/outer/number") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: */*", }) BigDecimal fakeOuterNumberSerialize(BigDecimal body); @@ -66,15 +68,61 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("POST /fake/outer/string") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: */*", }) String fakeOuterStringSerialize(String body); + /** + * + * + * @param query (required) + * @param user (required) + */ + @RequestLine("PUT /fake/body-with-query-params?query={query}") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + void testBodyWithQueryParams(@Param("query") String query, User user); + + /** + * + * + * Note, this is equivalent to the other testBodyWithQueryParams method, + * but with the query parameters collected into a single Map parameter. This + * is convenient for services with optional query parameters, especially when + * used with the {@link TestBodyWithQueryParamsQueryParams} class that allows for + * building up this map in a fluent style. + * @param user (required) + * @param queryParams Map of query parameters as name-value pairs + *

The following elements may be specified in the query map:

+ *
    + *
  • query - (required)
  • + *
+ */ + @RequestLine("PUT /fake/body-with-query-params?query={query}") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + void testBodyWithQueryParams(User user, @QueryMap(encoded=true) Map queryParams); + + /** + * A convenience class for generating query parameters for the + * testBodyWithQueryParams method in a fluent style. + */ + public static class TestBodyWithQueryParamsQueryParams extends HashMap { + public TestBodyWithQueryParamsQueryParams query(final String value) { + put("query", EncodingUtils.encode(value)); + return this; + } + } + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client */ @RequestLine("PATCH /fake") @@ -82,7 +130,7 @@ public interface FakeApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - Client testClientModel(Client body); + Client testClientModel(Client client); /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -104,32 +152,32 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("POST /fake") @Headers({ - "Content-Type: application/xml; charset=utf-8", - "Accept: application/xml; charset=utf-8,application/json; charset=utf-8", + "Content-Type: application/x-www-form-urlencoded", + "Accept: application/json", }) - void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("patternWithoutDelimiter") String patternWithoutDelimiter, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("string") String string, @Param("binary") byte[] binary, @Param("date") LocalDate date, @Param("dateTime") OffsetDateTime dateTime, @Param("password") String password, @Param("paramCallback") String paramCallback); + void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("patternWithoutDelimiter") String patternWithoutDelimiter, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("string") String string, @Param("binary") File binary, @Param("date") LocalDate date, @Param("dateTime") OffsetDateTime dateTime, @Param("password") String password, @Param("paramCallback") String paramCallback); /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) */ - @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}") + @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}&enum_query_double={enumQueryDouble}") @Headers({ - "Content-Type: */*", - "Accept: */*", + "Content-Type: application/x-www-form-urlencoded", + "Accept: application/json", "enum_header_string_array: {enumHeaderStringArray}", "enum_header_string: {enumHeaderString}" }) - void testEnumParameters(@Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryStringArray") List enumQueryStringArray, @Param("enumQueryString") String enumQueryString, @Param("enumQueryInteger") Integer enumQueryInteger, @Param("enumQueryDouble") Double enumQueryDouble); + void testEnumParameters(@Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryStringArray") List enumQueryStringArray, @Param("enumQueryString") String enumQueryString, @Param("enumQueryInteger") Integer enumQueryInteger, @Param("enumQueryDouble") Double enumQueryDouble, @Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString); /** * To test enum parameters @@ -139,28 +187,28 @@ public interface FakeApi extends ApiClient.Api { * is convenient for services with optional query parameters, especially when * used with the {@link TestEnumParametersQueryParams} class that allows for * building up this map in a fluent style. - * @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 enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @param queryParams Map of query parameters as name-value pairs *

The following elements may be specified in the query map:

*
    *
  • enumQueryStringArray - Query parameter enum test (string array) (optional)
  • *
  • enumQueryString - Query parameter enum test (string) (optional, default to -efg)
  • *
  • enumQueryInteger - Query parameter enum test (double) (optional)
  • + *
  • enumQueryDouble - Query parameter enum test (double) (optional)
  • *
*/ - @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}") + @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}&enum_query_double={enumQueryDouble}") @Headers({ - "Content-Type: */*", - "Accept: */*", + "Content-Type: application/x-www-form-urlencoded", + "Accept: application/json", "enum_header_string_array: {enumHeaderStringArray}", "enum_header_string: {enumHeaderString}" }) - void testEnumParameters(@Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap(encoded=true) Map queryParams); + void testEnumParameters(@Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the @@ -179,19 +227,23 @@ public interface FakeApi extends ApiClient.Api { put("enum_query_integer", EncodingUtils.encode(value)); return this; } + public TestEnumParametersQueryParams enumQueryDouble(final Double value) { + put("enum_query_double", EncodingUtils.encode(value)); + return this; + } } /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) */ @RequestLine("POST /fake/inline-additionalProperties") @Headers({ "Content-Type: application/json", "Accept: application/json", }) - void testInlineAdditionalProperties(Object param); + void testInlineAdditionalProperties(String requestBody); /** * test json serialization of form data @@ -201,7 +253,7 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("GET /fake/jsonFormData") @Headers({ - "Content-Type: application/json", + "Content-Type: application/x-www-form-urlencoded", "Accept: application/json", }) void testJsonFormData(@Param("param") String param, @Param("param2") String param2); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index efc51ae9b3a..d2ed35d88b5 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -18,7 +18,7 @@ public interface FakeClassnameTags123Api extends ApiClient.Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client */ @RequestLine("PATCH /fake_classname_test") @@ -26,5 +26,5 @@ public interface FakeClassnameTags123Api extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - Client testClassname(Client body); + Client testClassname(Client client); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index 70fbb3b6710..c3332266c24 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -20,14 +20,14 @@ public interface PetApi extends ApiClient.Api { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) */ @RequestLine("POST /pet") @Headers({ "Content-Type: application/json", "Accept: application/json", }) - void addPet(Pet body); + void addPet(Pet pet); /** * Deletes a pet @@ -145,14 +145,14 @@ public interface PetApi extends ApiClient.Api { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) */ @RequestLine("PUT /pet") @Headers({ "Content-Type: application/json", "Accept: application/json", }) - void updatePet(Pet body); + void updatePet(Pet pet); /** * Updates a pet in the store with form data diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index 42aaf047b73..8d79ef8ef26 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -52,13 +52,13 @@ public interface StoreApi extends ApiClient.Api { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order */ @RequestLine("POST /store/order") @Headers({ - "Content-Type: application/json", + "Content-Type: */*", "Accept: application/json", }) - Order placeOrder(Order body); + Order placeOrder(Order order); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index cc174ebb548..73897a3e60e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -18,38 +18,38 @@ public interface UserApi extends ApiClient.Api { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) */ @RequestLine("POST /user") @Headers({ - "Content-Type: application/json", + "Content-Type: */*", "Accept: application/json", }) - void createUser(User body); + void createUser(User user); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) */ @RequestLine("POST /user/createWithArray") @Headers({ - "Content-Type: application/json", + "Content-Type: */*", "Accept: application/json", }) - void createUsersWithArrayInput(List body); + void createUsersWithArrayInput(List user); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) */ @RequestLine("POST /user/createWithList") @Headers({ - "Content-Type: application/json", + "Content-Type: */*", "Accept: application/json", }) - void createUsersWithListInput(List body); + void createUsersWithListInput(List user); /** * Delete user @@ -138,12 +138,12 @@ public interface UserApi extends ApiClient.Api { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) */ @RequestLine("PUT /user/{username}") @Headers({ - "Content-Type: application/json", + "Content-Type: */*", "Accept: application/json", }) - void updateUser(@Param("username") String username, User body); + void updateUser(@Param("username") String username, User user); } 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 193d7f101db..2bb7dd17d43 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 @@ -67,6 +67,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -164,6 +204,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -229,6 +287,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -236,7 +295,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -246,6 +305,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 67879022f96..5f601300b95 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 @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -55,7 +56,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -223,7 +224,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -233,11 +234,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -331,7 +332,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -340,7 +341,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 38fb1481a3d..46fb5650ff0 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 @@ -78,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 a62db5e76e6..e12c1072478 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 @@ -37,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -85,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -106,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -123,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 209b4263f7e..3676b70365a 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 @@ -27,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -56,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -71,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/StringUtilTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/StringUtilTest.java deleted file mode 100644 index c93908b8482..00000000000 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/StringUtilTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); - } -} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index 05d765039a2..0e664bde73b 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -30,8 +30,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - // Client response = api.testSpecialTags(body); + Client client = null; + // Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeApiTest.java index bc6cb13b3b2..9544ce55753 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -3,9 +3,11 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; @@ -34,8 +36,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - // Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + // Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -48,8 +50,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -83,6 +85,38 @@ public class FakeApiTest { } + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + // api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + + /** + * + * + * + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ + @Test + public void testBodyWithQueryParamsTestQueryMap() { + User user = null; + FakeApi.TestBodyWithQueryParamsQueryParams queryParams = new FakeApi.TestBodyWithQueryParamsQueryParams() + .query(null); + // api.testBodyWithQueryParams(user, queryParams); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -90,8 +124,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client body = null; - // Client response = api.testClientModel(body); + Client client = null; + // Client response = api.testClientModel(client); // TODO: test validations } @@ -113,7 +147,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -131,15 +165,15 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - // api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } @@ -154,18 +188,47 @@ public class FakeApiTest { */ @Test public void testEnumParametersTestQueryMap() { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; - Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; FakeApi.TestEnumParametersQueryParams queryParams = new FakeApi.TestEnumParametersQueryParams() .enumQueryStringArray(null) .enumQueryString(null) - .enumQueryInteger(null); - // api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryDouble, queryParams); + .enumQueryInteger(null) + .enumQueryDouble(null); + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumFormStringArray, enumFormString, queryParams); // TODO: test validations } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + // api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + // api.testJsonFormData(param, param2); + + // TODO: test validations + } + + } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 77930522c3c..5cf35ba5e6b 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -26,14 +26,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case */ @Test public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + Client client = null; + // Client response = api.testClassname(client); // TODO: test validations } + } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java index c27524de1f6..cdbfd3f32eb 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,251 +1,177 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.model.*; - -import java.io.BufferedWriter; import java.io.File; -import java.io.FileWriter; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Before; +import org.junit.Test; + import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.*; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.*; - +/** + * API tests for PetApi + */ public class PetApiTest { - ApiClient apiClient; - PetApi api; - MockWebServer localServer; - ApiClient localClient; + + private PetApi api; @Before public void setup() { - apiClient = new ApiClient(); - api = apiClient.buildClient(PetApi.class); - localServer = new MockWebServer(); - localClient = new ApiClient(); + api = new ApiClient().buildClient(PetApi.class); } + + /** + * Add a new pet to the store + * + * + */ @Test - public void testApiClient() { - // the default api client is used - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); + public void addPetTest() { + Pet pet = null; + // api.addPet(pet); - ApiClient newClient = new ApiClient(); - newClient.setBasePath("http://example.com"); - - assertEquals("http://example.com", newClient.getBasePath()); + // TODO: test validations } + + /** + * Deletes a pet + * + * + */ @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); + public void deletePetTest() { + Long petId = null; + String apiKey = null; + // api.deletePet(petId, apiKey); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); + public void findPetsByStatusTest() { + List status = null; + // List response = api.findPetsByStatus(status); - api.updatePet(pet); - - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - api.updatePet(pet); - - List pets = api.findPetsByStatus(Collections.singletonList("available")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); - + public void findPetsByStatusTestQueryMap() { PetApi.FindPetsByStatusQueryParams queryParams = new PetApi.FindPetsByStatusQueryParams() - .status(Arrays.asList(new String[]{"available"})); - pets = api.findPetsByStatus(queryParams); - assertNotNull(pets); + .status(null); + // List response = api.findPetsByStatus(queryParams); - found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ + @Test + public void findPetsByTagsTest() { + List tags = null; + // List response = api.findPetsByTags(tags); - assertTrue(found); + // TODO: test validations } + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ @Test - public void testFindPetsByTags() throws Exception { - Pet pet = createRandomPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - List tags = new ArrayList<>(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet); - - List pets = api.findPetsByTags(Collections.singletonList("friendly")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); - + public void findPetsByTagsTestQueryMap() { PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams() - .tags(Arrays.asList(new String[]{"friendly"})); - pets = api.findPetsByTags(queryParams); - assertNotNull(pets); + .tags(null); + // List response = api.findPetsByTags(queryParams); - found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); + // TODO: test validations } - + + /** + * Find pet by ID + * + * Returns a single pet + */ @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet); + public void getPetByIdTest() { + Long petId = null; + // Pet response = api.getPetById(petId); - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); + // TODO: test validations } + + /** + * Update an existing pet + * + * + */ @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); + public void updatePetTest() { + Pet pet = null; + // api.updatePet(pet); - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(fetched.getId(), null); - - try { - api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (Exception e) { -// assertEquals(404, e.getCode()); - } + // TODO: test validations } + + /** + * Updates a pet in the store with form data + * + * + */ @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); + public void updatePetWithFormTest() { + Long petId = null; + String name = null; + String status = null; + // api.updatePetWithForm(petId, name, status); - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); + // TODO: test validations } + + /** + * uploads an image + * + * + */ @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); + public void uploadFileTest() { + Long petId = null; + String additionalMetadata = null; + File file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); + // TODO: test validations } - @Test - public void testCSVDelimitedArray() throws Exception { - localServer.enqueue(new MockResponse().setBody("[{\"id\":5,\"name\":\"rocky\"}]")); - localServer.start(); - PetApi api = localClient.setBasePath(localServer.url("/").toString()).buildClient(PetApi.class); - PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams() - .tags(Arrays.asList("friendly","energetic")); - List pets = api.findPetsByTags(queryParams); - assertNotNull(pets); - RecordedRequest request = localServer.takeRequest(); - assertThat(request.getPath()).contains("tags=friendly,energetic"); - localServer.shutdown(); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"); - pet.setPhotoUrls(photos); - - return pet; - } + } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java index 5492695f8aa..a0376818af8 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,82 +1,81 @@ package io.swagger.client.api; -import feign.FeignException; - -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.model.*; +import io.swagger.client.model.Order; +import org.junit.Before; +import org.junit.Test; -import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; -import org.junit.*; -import org.threeten.bp.OffsetDateTime; - -import static org.junit.Assert.*; - +/** + * API tests for StoreApi + */ public class StoreApiTest { + private StoreApi api; @Before public void setup() { - ApiClient apiClient = new ApiClient(); - api = apiClient.buildClient(StoreApi.class); + api = new ApiClient().buildClient(StoreApi.class); } + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory(); - assertTrue(inventory.keySet().size() > 0); + public void deleteOrderTest() { + String orderId = null; + // api.deleteOrder(orderId); + + // TODO: test validations } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + */ @Test - public void testPlaceOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getInventoryTest() { + // Map response = api.getInventory(); - Order fetched = api.getOrderById(order.getId()); - assertEquals(order.getId(), fetched.getId()); - assertEquals(order.getPetId(), fetched.getPetId()); - assertEquals(order.getQuantity(), fetched.getQuantity()); - assertTrue(order.getShipDate().isEqual(fetched.getShipDate())); + // TODO: test validations } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getOrderByIdTest() { + Long orderId = null; + // Order response = api.getOrderById(orderId); - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); - - api.deleteOrder(order.getId().toString()); - - try { - api.getOrderById(order.getId()); - fail("expected an error"); - } catch (FeignException e) { - assertTrue(e.getMessage().startsWith("status 404 ")); - } + // TODO: test validations } - private Order createOrder() { - Order order = new Order(); - order.setPetId(200L); - order.setQuantity(13); - //Ensure 3 fractional digits because of a bug in the petstore server - order.setShipDate(OffsetDateTime.now().withNano(123000000)); - order.setStatus(Order.StatusEnum.PLACED); - order.setComplete(true); + + /** + * Place an order for a pet + * + * + */ + @Test + public void placeOrderTest() { + Order order = null; + // Order response = api.placeOrder(order); - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, TestUtils.nextId()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; + // TODO: test validations } + + } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java index d1c9b67f722..953bb19fa1e 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,93 +1,156 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.model.*; +import io.swagger.client.model.User; +import org.junit.Before; +import org.junit.Test; -import java.util.Arrays; - -import org.junit.*; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * API tests for UserApi + */ public class UserApiTest { + private UserApi api; @Before public void setup() { - ApiClient apiClient = new ApiClient(); - api = apiClient.buildClient(UserApi.class); + api = new ApiClient().buildClient(UserApi.class); } + + /** + * Create user + * + * This can only be done by the logged in user. + */ @Test - public void testCreateUser() throws Exception { - User user = createUser(); + public void createUserTest() { + User user = null; + // api.createUser(user); - api.createUser(user); - - User fetched = api.getUserByName(user.getUsername()); - assertEquals(user.getId(), fetched.getId()); + // TODO: test validations } + + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithArray() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithArrayInputTest() { + List user = null; + // api.createUsersWithArrayInput(user); - api.createUsersWithArrayInput(Arrays.asList(user1, user2)); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } + + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithList() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithListInputTest() { + List user = null; + // api.createUsersWithListInput(user); - api.createUsersWithListInput(Arrays.asList(user1, user2)); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - // ignore for the time being, please refer to the following for more info: - // https://github.com/swagger-api/swagger-codegen/issues/1660 - @Ignore @Test - public void testLoginUser() throws Exception { - User user = createUser(); - api.createUser(user); + + /** + * Delete user + * + * This can only be done by the logged in user. + */ + @Test + public void deleteUserTest() { + String username = null; + // api.deleteUser(username); - String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + // TODO: test validations + } + + /** + * Get user by user name + * + * + */ + @Test + public void getUserByNameTest() { + String username = null; + // User response = api.getUserByName(username); + + // TODO: test validations + } + + + /** + * Logs user into the system + * + * + */ + @Test + public void loginUserTest() { + String username = null; + String password = null; + // String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ + @Test + public void loginUserTestQueryMap() { UserApi.LoginUserQueryParams queryParams = new UserApi.LoginUserQueryParams() - .username(user.getUsername()) - .password(user.getPassword()); - token = api.loginUser(queryParams); - assertTrue(token.startsWith("logged in user session:")); - } + .username(null) + .password(null); + // String response = api.loginUser(queryParams); + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + */ @Test - public void logoutUser() throws Exception { - api.logoutUser(); + public void logoutUserTest() { + // api.logoutUser(); + + // TODO: test validations } - private User createUser() { - User user = new User(); - user.setId(TestUtils.nextId()); - user.setUsername("fred" + user.getId()); - user.setFirstName("Fred"); - user.setLastName("Meyer"); - user.setEmail("fred@fredmeyer.com"); - user.setPassword("xxXXxx"); - user.setPhone("408-867-5309"); - user.setUserStatus(123); + + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + String username = null; + User user = null; + // api.updateUser(username, user); - return user; + // TODO: test validations } + + } diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator-ignore b/samples/client/petstore/java/google-api-client/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator-ignore +++ b/samples/client/petstore/java/google-api-client/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/google-api-client/README.md b/samples/client/petstore/java/google-api-client/README.md index 336f86aa4f9..98ae25b2972 100644 --- a/samples/client/petstore/java/google-api-client/README.md +++ b/samples/client/petstore/java/google-api-client/README.md @@ -1,24 +1,35 @@ -# swagger-petstore-google-api-client +# petstore-google-api-client + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-google-api-client - 1.0.0 - compile + org.openapitools + petstore-google-api-client + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-google-api-client:1.0.0" +compile "org.openapitools:petstore-google-api-client:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-google-api-client-1.0.0.jar -* target/lib/*.jar +* `target/petstore-google-api-client-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -71,9 +84,9 @@ public class AnotherFakeApiExample { public static void main(String[] args) { AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -95,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -132,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -148,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index 5bd193c6ed2..d66603375ad 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-google-api-client' + pom.artifactId = 'petstore-google-api-client' } } diff --git a/samples/client/petstore/java/google-api-client/build.sbt b/samples/client/petstore/java/google-api-client/build.sbt index 44619712462..92a0aabedde 100644 --- a/samples/client/petstore/java/google-api-client/build.sbt +++ b/samples/client/petstore/java/google-api-client/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-google-api-client", + organization := "org.openapitools", + name := "petstore-google-api-client", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md b/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/google-api-client/docs/EnumTest.md b/samples/client/petstore/java/google-api-client/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/google-api-client/docs/EnumTest.md +++ b/samples/client/petstore/java/google-api-client/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/google-api-client/docs/FakeApi.md b/samples/client/petstore/java/google-api-client/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/google-api-client/docs/FakeApi.md +++ b/samples/client/petstore/java/google-api-client/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/google-api-client/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/google-api-client/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/google-api-client/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/google-api-client/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/google-api-client/docs/FormatTest.md b/samples/client/petstore/java/google-api-client/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/google-api-client/docs/FormatTest.md +++ b/samples/client/petstore/java/google-api-client/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/google-api-client/docs/Name.md b/samples/client/petstore/java/google-api-client/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/google-api-client/docs/Name.md +++ b/samples/client/petstore/java/google-api-client/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/feign/docs/ModelReturn.md b/samples/client/petstore/java/google-api-client/docs/OuterBoolean.md similarity index 66% rename from samples/client/petstore/java/feign/docs/ModelReturn.md rename to samples/client/petstore/java/google-api-client/docs/OuterBoolean.md index a679b04953e..0c792032f84 100644 --- a/samples/client/petstore/java/feign/docs/ModelReturn.md +++ b/samples/client/petstore/java/google-api-client/docs/OuterBoolean.md @@ -1,10 +1,9 @@ -# ModelReturn +# OuterBoolean ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_return** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/feign/docs/AnimalFarm.md b/samples/client/petstore/java/google-api-client/docs/OuterNumber.md similarity index 89% rename from samples/client/petstore/java/feign/docs/AnimalFarm.md rename to samples/client/petstore/java/google-api-client/docs/OuterNumber.md index c7c7f1ddcce..ab7613b1810 100644 --- a/samples/client/petstore/java/feign/docs/AnimalFarm.md +++ b/samples/client/petstore/java/google-api-client/docs/OuterNumber.md @@ -1,5 +1,5 @@ -# AnimalFarm +# OuterNumber ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/java/retrofit/docs/AnimalFarm.md b/samples/client/petstore/java/google-api-client/docs/OuterString.md similarity index 89% rename from samples/client/petstore/java/retrofit/docs/AnimalFarm.md rename to samples/client/petstore/java/google-api-client/docs/OuterString.md index c7c7f1ddcce..3079fce4a0d 100644 --- a/samples/client/petstore/java/retrofit/docs/AnimalFarm.md +++ b/samples/client/petstore/java/google-api-client/docs/OuterString.md @@ -1,5 +1,5 @@ -# AnimalFarm +# OuterString ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/java/google-api-client/docs/PetApi.md b/samples/client/petstore/java/google-api-client/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/google-api-client/docs/PetApi.md +++ b/samples/client/petstore/java/google-api-client/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/google-api-client/docs/SpecialModelName.md b/samples/client/petstore/java/google-api-client/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/google-api-client/docs/SpecialModelName.md +++ b/samples/client/petstore/java/google-api-client/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/google-api-client/docs/StoreApi.md b/samples/client/petstore/java/google-api-client/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/google-api-client/docs/StoreApi.md +++ b/samples/client/petstore/java/google-api-client/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/google-api-client/docs/UserApi.md b/samples/client/petstore/java/google-api-client/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/google-api-client/docs/UserApi.md +++ b/samples/client/petstore/java/google-api-client/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index cbdb05f2ef1..02d40660155 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-google-api-client + org.openapitools + petstore-google-api-client jar - swagger-petstore-google-api-client + petstore-google-api-client 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org @@ -139,8 +139,7 @@ maven-compiler-plugin 3.6.1 - - 1.7 + 1.7 1.7 diff --git a/samples/client/petstore/java/google-api-client/settings.gradle b/samples/client/petstore/java/google-api-client/settings.gradle index 35a7b0d0442..196a3235093 100644 --- a/samples/client/petstore/java/google-api-client/settings.gradle +++ b/samples/client/petstore/java/google-api-client/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-google-api-client" \ No newline at end of file +rootProject.name = "petstore-google-api-client" \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/AnotherFakeApi.java index ac669657974..dccc835d72f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -44,12 +44,12 @@ public class AnotherFakeApi { * To test special tags * To test special tags *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testSpecialTags(Client body) throws IOException { - HttpResponse response = testSpecialTagsForHttpResponse(body); + public Client testSpecialTags(Client client) throws IOException { + HttpResponse response = testSpecialTagsForHttpResponse(client); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } @@ -58,51 +58,51 @@ public class AnotherFakeApi { * To test special tags * To test special tags *

200 - successful operation - * @param body client model + * @param client client model * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testSpecialTags(Client body, Map params) throws IOException { - HttpResponse response = testSpecialTagsForHttpResponse(body, params); + public Client testSpecialTags(Client client, Map params) throws IOException { + HttpResponse response = testSpecialTagsForHttpResponse(client, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse testSpecialTagsForHttpResponse(Client body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags"); + public HttpResponse testSpecialTagsForHttpResponse(Client client) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testSpecialTags"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testSpecialTagsForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags"); + public HttpResponse testSpecialTagsForHttpResponse(java.io.InputStream client, String mediaType) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testSpecialTags"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = client == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testSpecialTagsForHttpResponse(Client body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags"); + public HttpResponse testSpecialTagsForHttpResponse(Client client, Map params) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testSpecialTags"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); @@ -127,7 +127,7 @@ public class AnotherFakeApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeApi.java index 013833c1181..f967d24645a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeApi.java @@ -4,9 +4,11 @@ import io.swagger.client.ApiClient; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; import com.google.api.client.http.GenericUrl; @@ -47,12 +49,12 @@ public class FakeApi { /** * Test serialization of outer boolean types *

200 - Output boolean - * @param body Input boolean as post body + * @param booleanPostBody Input boolean as post body * @return Boolean * @throws IOException if an error occurs while attempting to invoke the API **/ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws IOException { - HttpResponse response = fakeOuterBooleanSerializeForHttpResponse(body); + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws IOException { + HttpResponse response = fakeOuterBooleanSerializeForHttpResponse(booleanPostBody); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } @@ -64,37 +66,37 @@ public class FakeApi { * @return Boolean * @throws IOException if an error occurs while attempting to invoke the API **/ - public Boolean fakeOuterBooleanSerialize(Boolean body, Map params) throws IOException { - HttpResponse response = fakeOuterBooleanSerializeForHttpResponse(body, params); + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody, Map params) throws IOException { + HttpResponse response = fakeOuterBooleanSerializeForHttpResponse(booleanPostBody, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean body) throws IOException { + public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean booleanPostBody) throws IOException { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(booleanPostBody); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse fakeOuterBooleanSerializeForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { + public HttpResponse fakeOuterBooleanSerializeForHttpResponse(java.io.InputStream booleanPostBody, String mediaType) throws IOException { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = booleanPostBody == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, booleanPostBody); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean body, Map params) throws IOException { + public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean booleanPostBody, Map params) throws IOException { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean"); @@ -119,7 +121,7 @@ public class FakeApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(booleanPostBody); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -127,12 +129,12 @@ public class FakeApi { /** * Test serialization of object with outer number type *

200 - Output composite - * @param body Input composite as post body + * @param outerComposite Input composite as post body * @return OuterComposite * @throws IOException if an error occurs while attempting to invoke the API **/ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws IOException { - HttpResponse response = fakeOuterCompositeSerializeForHttpResponse(body); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws IOException { + HttpResponse response = fakeOuterCompositeSerializeForHttpResponse(outerComposite); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } @@ -144,37 +146,37 @@ public class FakeApi { * @return OuterComposite * @throws IOException if an error occurs while attempting to invoke the API **/ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body, Map params) throws IOException { - HttpResponse response = fakeOuterCompositeSerializeForHttpResponse(body, params); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite, Map params) throws IOException { + HttpResponse response = fakeOuterCompositeSerializeForHttpResponse(outerComposite, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite body) throws IOException { + public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite outerComposite) throws IOException { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(outerComposite); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse fakeOuterCompositeSerializeForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { + public HttpResponse fakeOuterCompositeSerializeForHttpResponse(java.io.InputStream outerComposite, String mediaType) throws IOException { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = outerComposite == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, outerComposite); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite body, Map params) throws IOException { + public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite outerComposite, Map params) throws IOException { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite"); @@ -199,7 +201,7 @@ public class FakeApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(outerComposite); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -364,16 +366,133 @@ public class FakeApi { } + /** + *

200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public void testBodyWithQueryParams(String query, User user) throws IOException { + testBodyWithQueryParamsForHttpResponse(query, user); + } + + /** + *

200 - Success + * @param query The query parameter + * @param user The user parameter + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public void testBodyWithQueryParams(String query, User user, Map params) throws IOException { + testBodyWithQueryParamsForHttpResponse(query, user, params); + } + + public HttpResponse testBodyWithQueryParamsForHttpResponse(String query, User user) throws IOException { + // verify the required parameter 'query' is set + if (query == null) { + throw new IllegalArgumentException("Missing the required parameter 'query' when calling testBodyWithQueryParams"); + }// verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-query-params"); + if (query != null) { + String key = "query"; + Object value = query; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(user); + return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); + } + + public HttpResponse testBodyWithQueryParamsForHttpResponse(String query, java.io.InputStream user, String mediaType) throws IOException { + // verify the required parameter 'query' is set + if (query == null) { + throw new IllegalArgumentException("Missing the required parameter 'query' when calling testBodyWithQueryParams"); + }// verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-query-params"); + if (query != null) { + String key = "query"; + Object value = query; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = user == null ? + apiClient.new JacksonJsonHttpContent(null) : + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, user); + return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); + } + + public HttpResponse testBodyWithQueryParamsForHttpResponse(String query, User user, Map params) throws IOException { + // verify the required parameter 'query' is set + if (query == null) { + throw new IllegalArgumentException("Missing the required parameter 'query' when calling testBodyWithQueryParams"); + }// verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-query-params"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'query' to the map of query params + allParams.put("query", query); + + for (Map.Entry entry: allParams.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(user); + return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); + } + + /** * To test \"client\" model * To test \"client\" model *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testClientModel(Client body) throws IOException { - HttpResponse response = testClientModelForHttpResponse(body); + public Client testClientModel(Client client) throws IOException { + HttpResponse response = testClientModelForHttpResponse(client); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } @@ -382,51 +501,51 @@ public class FakeApi { * To test \"client\" model * To test \"client\" model *

200 - successful operation - * @param body client model + * @param client client model * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testClientModel(Client body, Map params) throws IOException { - HttpResponse response = testClientModelForHttpResponse(body, params); + public Client testClientModel(Client client, Map params) throws IOException { + HttpResponse response = testClientModelForHttpResponse(client, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse testClientModelForHttpResponse(Client body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel"); + public HttpResponse testClientModelForHttpResponse(Client client) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testClientModel"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testClientModelForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel"); + public HttpResponse testClientModelForHttpResponse(java.io.InputStream client, String mediaType) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testClientModel"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = client == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testClientModelForHttpResponse(Client body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel"); + public HttpResponse testClientModelForHttpResponse(Client client, Map params) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testClientModel"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); @@ -451,7 +570,7 @@ public class FakeApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } @@ -477,7 +596,7 @@ public class FakeApi { * @param paramCallback None * @throws IOException if an error occurs while attempting to invoke the API **/ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws IOException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws IOException { testEndpointParametersForHttpResponse(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -497,7 +616,7 @@ public class FakeApi { testEndpointParametersForHttpResponse(number, _double, patternWithoutDelimiter, _byte, params); } - public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws IOException { + public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws IOException { // verify the required parameter 'number' is set if (number == null) { throw new IllegalArgumentException("Missing the required parameter 'number' when calling testEndpointParameters"); @@ -567,18 +686,18 @@ public class FakeApi { * To test enum parameters *

400 - Invalid request *

404 - Not found - * @param enumFormStringArray Form parameter enum test (string array) - * @param enumFormString Form parameter enum test (string) * @param enumHeaderStringArray Header parameter enum test (string array) * @param enumHeaderString Header parameter enum test (string) * @param enumQueryStringArray Query parameter enum test (string array) * @param enumQueryString Query parameter enum test (string) * @param enumQueryInteger Query parameter enum test (double) * @param enumQueryDouble Query parameter enum test (double) + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) * @throws IOException if an error occurs while attempting to invoke the API **/ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws IOException { - testEnumParametersForHttpResponse(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws IOException { + testEnumParametersForHttpResponse(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } /** @@ -593,7 +712,7 @@ public class FakeApi { testEnumParametersForHttpResponse(params); } - public HttpResponse testEnumParametersForHttpResponse(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws IOException { + public HttpResponse testEnumParametersForHttpResponse(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws IOException { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); if (enumQueryStringArray != null) { @@ -626,6 +745,16 @@ public class FakeApi { } else { uriBuilder = uriBuilder.queryParam(key, value); } + } if (enumQueryDouble != null) { + String key = "enum_query_double"; + Object value = enumQueryDouble; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } } String url = uriBuilder.build().toString(); @@ -667,61 +796,59 @@ public class FakeApi { /** * test inline additionalProperties - * *

200 - successful operation - * @param param request body + * @param requestBody request body * @throws IOException if an error occurs while attempting to invoke the API **/ - public void testInlineAdditionalProperties(Object param) throws IOException { - testInlineAdditionalPropertiesForHttpResponse(param); + public void testInlineAdditionalProperties(String requestBody) throws IOException { + testInlineAdditionalPropertiesForHttpResponse(requestBody); } /** * test inline additionalProperties - * *

200 - successful operation - * @param param request body + * @param requestBody request body * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void testInlineAdditionalProperties(Object param, Map params) throws IOException { - testInlineAdditionalPropertiesForHttpResponse(param, params); + public void testInlineAdditionalProperties(String requestBody, Map params) throws IOException { + testInlineAdditionalPropertiesForHttpResponse(requestBody, params); } - public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param) throws IOException { - // verify the required parameter 'param' is set - if (param == null) { - throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + public HttpResponse testInlineAdditionalPropertiesForHttpResponse(String requestBody) throws IOException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new IllegalArgumentException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(param); + HttpContent content = apiClient.new JacksonJsonHttpContent(requestBody); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse testInlineAdditionalPropertiesForHttpResponse(java.io.InputStream param, String mediaType) throws IOException { - // verify the required parameter 'param' is set - if (param == null) { - throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + public HttpResponse testInlineAdditionalPropertiesForHttpResponse(java.io.InputStream requestBody, String mediaType) throws IOException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new IllegalArgumentException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = param == null ? + HttpContent content = requestBody == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, param); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, requestBody); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param, Map params) throws IOException { - // verify the required parameter 'param' is set - if (param == null) { - throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + public HttpResponse testInlineAdditionalPropertiesForHttpResponse(String requestBody, Map params) throws IOException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new IllegalArgumentException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties"); @@ -746,14 +873,13 @@ public class FakeApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(param); + HttpContent content = apiClient.new JacksonJsonHttpContent(requestBody); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } /** * test json serialization of form data - * *

200 - successful operation * @param param field1 * @param param2 field2 @@ -765,7 +891,6 @@ public class FakeApi { /** * test json serialization of form data - * *

200 - successful operation * @param param field1 * @param param2 field2 diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index a0fa9bdbb35..fb186b6e564 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -44,12 +44,12 @@ public class FakeClassnameTags123Api { * To test class name in snake case * To test class name in snake case *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testClassname(Client body) throws IOException { - HttpResponse response = testClassnameForHttpResponse(body); + public Client testClassname(Client client) throws IOException { + HttpResponse response = testClassnameForHttpResponse(client); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } @@ -58,51 +58,51 @@ public class FakeClassnameTags123Api { * To test class name in snake case * To test class name in snake case *

200 - successful operation - * @param body client model + * @param client client model * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testClassname(Client body, Map params) throws IOException { - HttpResponse response = testClassnameForHttpResponse(body, params); + public Client testClassname(Client client, Map params) throws IOException { + HttpResponse response = testClassnameForHttpResponse(client, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse testClassnameForHttpResponse(Client body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname"); + public HttpResponse testClassnameForHttpResponse(Client client) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testClassname"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testClassnameForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname"); + public HttpResponse testClassnameForHttpResponse(java.io.InputStream client, String mediaType) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testClassname"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = client == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testClassnameForHttpResponse(Client body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname"); + public HttpResponse testClassnameForHttpResponse(Client client, Map params) throws IOException { + // verify the required parameter 'client' is set + if (client == null) { + throw new IllegalArgumentException("Missing the required parameter 'client' when calling testClassname"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); @@ -127,7 +127,7 @@ public class FakeClassnameTags123Api { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(client); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/PetApi.java index bf870700694..086f3fb6fec 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/PetApi.java @@ -44,61 +44,59 @@ public class PetApi { /** * Add a new pet to the store - * *

405 - Invalid input - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @throws IOException if an error occurs while attempting to invoke the API **/ - public void addPet(Pet body) throws IOException { - addPetForHttpResponse(body); + public void addPet(Pet pet) throws IOException { + addPetForHttpResponse(pet); } /** * Add a new pet to the store - * *

405 - Invalid input - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void addPet(Pet body, Map params) throws IOException { - addPetForHttpResponse(body, params); + public void addPet(Pet pet, Map params) throws IOException { + addPetForHttpResponse(pet, params); } - public HttpResponse addPetForHttpResponse(Pet body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling addPet"); + public HttpResponse addPetForHttpResponse(Pet pet) throws IOException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new IllegalArgumentException("Missing the required parameter 'pet' when calling addPet"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(pet); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse addPetForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling addPet"); + public HttpResponse addPetForHttpResponse(java.io.InputStream pet, String mediaType) throws IOException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new IllegalArgumentException("Missing the required parameter 'pet' when calling addPet"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = pet == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, pet); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse addPetForHttpResponse(Pet body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling addPet"); + public HttpResponse addPetForHttpResponse(Pet pet, Map params) throws IOException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new IllegalArgumentException("Missing the required parameter 'pet' when calling addPet"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); @@ -123,14 +121,13 @@ public class PetApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(pet); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } /** * Deletes a pet - * *

400 - Invalid pet value * @param petId Pet id to delete * @param apiKey The apiKey parameter @@ -142,7 +139,6 @@ public class PetApi { /** * Deletes a pet - * *

400 - Invalid pet value * @param petId Pet id to delete * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. @@ -475,65 +471,63 @@ public class PetApi { /** * Update an existing pet - * *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @throws IOException if an error occurs while attempting to invoke the API **/ - public void updatePet(Pet body) throws IOException { - updatePetForHttpResponse(body); + public void updatePet(Pet pet) throws IOException { + updatePetForHttpResponse(pet); } /** * Update an existing pet - * *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void updatePet(Pet body, Map params) throws IOException { - updatePetForHttpResponse(body, params); + public void updatePet(Pet pet, Map params) throws IOException { + updatePetForHttpResponse(pet, params); } - public HttpResponse updatePetForHttpResponse(Pet body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePet"); + public HttpResponse updatePetForHttpResponse(Pet pet) throws IOException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new IllegalArgumentException("Missing the required parameter 'pet' when calling updatePet"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(pet); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); } - public HttpResponse updatePetForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePet"); + public HttpResponse updatePetForHttpResponse(java.io.InputStream pet, String mediaType) throws IOException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new IllegalArgumentException("Missing the required parameter 'pet' when calling updatePet"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = pet == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, pet); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); } - public HttpResponse updatePetForHttpResponse(Pet body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePet"); + public HttpResponse updatePetForHttpResponse(Pet pet, Map params) throws IOException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new IllegalArgumentException("Missing the required parameter 'pet' when calling updatePet"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); @@ -558,14 +552,13 @@ public class PetApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(pet); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); } /** * Updates a pet in the store with form data - * *

405 - Invalid input * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -578,7 +571,6 @@ public class PetApi { /** * Updates a pet in the store with form data - * *

405 - Invalid input * @param petId ID of pet that needs to be updated * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. @@ -643,7 +635,6 @@ public class PetApi { /** * uploads an image - * *

200 - successful operation * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -659,7 +650,6 @@ public class PetApi { /** * uploads an image - * *

200 - successful operation * @param petId ID of pet to update * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/StoreApi.java index dc407a874f1..3294d9295d3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/StoreApi.java @@ -274,69 +274,67 @@ public class StoreApi { /** * Place an order for a pet - * *

200 - successful operation *

400 - Invalid Order - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order * @throws IOException if an error occurs while attempting to invoke the API **/ - public Order placeOrder(Order body) throws IOException { - HttpResponse response = placeOrderForHttpResponse(body); + public Order placeOrder(Order order) throws IOException { + HttpResponse response = placeOrderForHttpResponse(order); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * Place an order for a pet - * *

200 - successful operation *

400 - Invalid Order - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return Order * @throws IOException if an error occurs while attempting to invoke the API **/ - public Order placeOrder(Order body, Map params) throws IOException { - HttpResponse response = placeOrderForHttpResponse(body, params); + public Order placeOrder(Order order, Map params) throws IOException { + HttpResponse response = placeOrderForHttpResponse(order, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse placeOrderForHttpResponse(Order body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling placeOrder"); + public HttpResponse placeOrderForHttpResponse(Order order) throws IOException { + // verify the required parameter 'order' is set + if (order == null) { + throw new IllegalArgumentException("Missing the required parameter 'order' when calling placeOrder"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(order); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse placeOrderForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling placeOrder"); + public HttpResponse placeOrderForHttpResponse(java.io.InputStream order, String mediaType) throws IOException { + // verify the required parameter 'order' is set + if (order == null) { + throw new IllegalArgumentException("Missing the required parameter 'order' when calling placeOrder"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = order == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, order); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse placeOrderForHttpResponse(Order body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling placeOrder"); + public HttpResponse placeOrderForHttpResponse(Order order, Map params) throws IOException { + // verify the required parameter 'order' is set + if (order == null) { + throw new IllegalArgumentException("Missing the required parameter 'order' when calling placeOrder"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order"); @@ -361,7 +359,7 @@ public class StoreApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(order); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/UserApi.java index c45c1374514..56cce7ba571 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/api/UserApi.java @@ -44,59 +44,59 @@ public class UserApi { * Create user * This can only be done by the logged in user. *

0 - successful operation - * @param body Created user object + * @param user Created user object * @throws IOException if an error occurs while attempting to invoke the API **/ - public void createUser(User body) throws IOException { - createUserForHttpResponse(body); + public void createUser(User user) throws IOException { + createUserForHttpResponse(user); } /** * Create user * This can only be done by the logged in user. *

0 - successful operation - * @param body Created user object + * @param user Created user object * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void createUser(User body, Map params) throws IOException { - createUserForHttpResponse(body, params); + public void createUser(User user, Map params) throws IOException { + createUserForHttpResponse(user, params); } - public HttpResponse createUserForHttpResponse(User body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUser"); + public HttpResponse createUserForHttpResponse(User user) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUser"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse createUserForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUser"); + public HttpResponse createUserForHttpResponse(java.io.InputStream user, String mediaType) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUser"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = user == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse createUserForHttpResponse(User body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUser"); + public HttpResponse createUserForHttpResponse(User user, Map params) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUser"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); @@ -121,68 +121,66 @@ public class UserApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } /** * Creates list of users with given input array - * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @throws IOException if an error occurs while attempting to invoke the API **/ - public void createUsersWithArrayInput(List body) throws IOException { - createUsersWithArrayInputForHttpResponse(body); + public void createUsersWithArrayInput(List user) throws IOException { + createUsersWithArrayInputForHttpResponse(user); } /** * Creates list of users with given input array - * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void createUsersWithArrayInput(List body, Map params) throws IOException { - createUsersWithArrayInputForHttpResponse(body, params); + public void createUsersWithArrayInput(List user, Map params) throws IOException { + createUsersWithArrayInputForHttpResponse(user, params); } - public HttpResponse createUsersWithArrayInputForHttpResponse(List body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithArrayInput"); + public HttpResponse createUsersWithArrayInputForHttpResponse(List user) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUsersWithArrayInput"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse createUsersWithArrayInputForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithArrayInput"); + public HttpResponse createUsersWithArrayInputForHttpResponse(java.io.InputStream user, String mediaType) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUsersWithArrayInput"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = user == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse createUsersWithArrayInputForHttpResponse(List body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithArrayInput"); + public HttpResponse createUsersWithArrayInputForHttpResponse(List user, Map params) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUsersWithArrayInput"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); @@ -207,68 +205,66 @@ public class UserApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } /** * Creates list of users with given input array - * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @throws IOException if an error occurs while attempting to invoke the API **/ - public void createUsersWithListInput(List body) throws IOException { - createUsersWithListInputForHttpResponse(body); + public void createUsersWithListInput(List user) throws IOException { + createUsersWithListInputForHttpResponse(user); } /** * Creates list of users with given input array - * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void createUsersWithListInput(List body, Map params) throws IOException { - createUsersWithListInputForHttpResponse(body, params); + public void createUsersWithListInput(List user, Map params) throws IOException { + createUsersWithListInputForHttpResponse(user, params); } - public HttpResponse createUsersWithListInputForHttpResponse(List body) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithListInput"); + public HttpResponse createUsersWithListInputForHttpResponse(List user) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUsersWithListInput"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse createUsersWithListInputForHttpResponse(java.io.InputStream body, String mediaType) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithListInput"); + public HttpResponse createUsersWithListInputForHttpResponse(java.io.InputStream user, String mediaType) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUsersWithListInput"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = user == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } - public HttpResponse createUsersWithListInputForHttpResponse(List body, Map params) throws IOException { - // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithListInput"); + public HttpResponse createUsersWithListInputForHttpResponse(List user, Map params) throws IOException { + // verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling createUsersWithListInput"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); @@ -293,7 +289,7 @@ public class UserApi { String url = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -378,7 +374,6 @@ public class UserApi { /** * Get user by user name - * *

200 - successful operation *

400 - Invalid username supplied *

404 - User not found @@ -394,7 +389,6 @@ public class UserApi { /** * Get user by user name - * *

200 - successful operation *

400 - Invalid username supplied *

404 - User not found @@ -464,7 +458,6 @@ public class UserApi { /** * Logs user into the system - * *

200 - successful operation *

400 - Invalid username/password supplied * @param username The user name for login @@ -480,7 +473,6 @@ public class UserApi { /** * Logs user into the system - * *

200 - successful operation *

400 - Invalid username/password supplied * @param username The user name for login @@ -575,7 +567,6 @@ public class UserApi { /** * Logs out current logged in user session - * *

0 - successful operation * @throws IOException if an error occurs while attempting to invoke the API **/ @@ -585,7 +576,6 @@ public class UserApi { /** * Logs out current logged in user session - * *

0 - successful operation * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API @@ -641,11 +631,11 @@ public class UserApi { *

400 - Invalid user supplied *

404 - User not found * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @throws IOException if an error occurs while attempting to invoke the API **/ - public void updateUser(String username, User body) throws IOException { - updateUserForHttpResponse(username, body); + public void updateUser(String username, User user) throws IOException { + updateUserForHttpResponse(username, user); } /** @@ -654,21 +644,21 @@ public class UserApi { *

400 - Invalid user supplied *

404 - User not found * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void updateUser(String username, User body, Map params) throws IOException { - updateUserForHttpResponse(username, body, params); + public void updateUser(String username, User user, Map params) throws IOException { + updateUserForHttpResponse(username, user, params); } - public HttpResponse updateUserForHttpResponse(String username, User body) throws IOException { + public HttpResponse updateUserForHttpResponse(String username, User user) throws IOException { // verify the required parameter 'username' is set if (username == null) { throw new IllegalArgumentException("Missing the required parameter 'username' when calling updateUser"); - }// verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateUser"); + }// verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling updateUser"); } // create a map of path variables final Map uriVariables = new HashMap(); @@ -678,17 +668,17 @@ public class UserApi { String url = uriBuilder.buildFromMap(uriVariables).toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); } - public HttpResponse updateUserForHttpResponse(String username, java.io.InputStream body, String mediaType) throws IOException { + public HttpResponse updateUserForHttpResponse(String username, java.io.InputStream user, String mediaType) throws IOException { // verify the required parameter 'username' is set if (username == null) { throw new IllegalArgumentException("Missing the required parameter 'username' when calling updateUser"); - }// verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateUser"); + }// verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling updateUser"); } // create a map of path variables final Map uriVariables = new HashMap(); @@ -698,19 +688,19 @@ public class UserApi { String url = uriBuilder.buildFromMap(uriVariables).toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = body == null ? + HttpContent content = user == null ? apiClient.new JacksonJsonHttpContent(null) : - new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body); + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); } - public HttpResponse updateUserForHttpResponse(String username, User body, Map params) throws IOException { + public HttpResponse updateUserForHttpResponse(String username, User user, Map params) throws IOException { // verify the required parameter 'username' is set if (username == null) { throw new IllegalArgumentException("Missing the required parameter 'username' when calling updateUser"); - }// verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateUser"); + }// verify the required parameter 'user' is set + if (user == null) { + throw new IllegalArgumentException("Missing the required parameter 'user' when calling updateUser"); } // create a map of path variables final Map uriVariables = new HashMap(); @@ -738,7 +728,7 @@ public class UserApi { String url = uriBuilder.buildFromMap(uriVariables).toString(); GenericUrl genericUrl = new GenericUrl(url); - HttpContent content = apiClient.new JacksonJsonHttpContent(body); + HttpContent content = apiClient.new JacksonJsonHttpContent(user); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java index 193d7f101db..2bb7dd17d43 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java @@ -67,6 +67,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -164,6 +204,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -229,6 +287,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -236,7 +295,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -246,6 +305,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java index 67879022f96..5f601300b95 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -55,7 +56,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -223,7 +224,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -233,11 +234,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -331,7 +332,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -340,7 +341,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java index 38fb1481a3d..46fb5650ff0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java @@ -78,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java index a62db5e76e6..e12c1072478 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java @@ -37,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -85,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -106,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -123,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java index 209b4263f7e..3676b70365a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -27,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -56,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -71,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index 109ff063df5..5c506a31879 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws IOException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeApiTest.java index 55ae5bb2a13..d068c43fe0c 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -15,9 +15,11 @@ package io.swagger.client.api; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -46,8 +48,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws IOException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -62,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() throws IOException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -100,6 +102,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws IOException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws IOException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -110,8 +129,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() throws IOException { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -135,7 +154,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -155,15 +174,15 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() throws IOException { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } @@ -178,8 +197,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() throws IOException { - Object param = null; - api.testInlineAdditionalProperties(param); + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 9564580b31b..11af1751598 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,15 +35,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws IOException * if the Api call fails */ @Test public void testClassnameTest() throws IOException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/PetApiTest.java index 4547bcb8576..fa5e91d042a 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/PetApiTest.java @@ -44,8 +44,8 @@ public class PetApiTest { */ @Test public void addPetTest() throws IOException { - Pet body = null; - api.addPet(body); + Pet pet = null; + api.addPet(pet); // TODO: test validations } @@ -125,8 +125,8 @@ public class PetApiTest { */ @Test public void updatePetTest() throws IOException { - Pet body = null; - api.updatePet(body); + Pet pet = null; + api.updatePet(pet); // TODO: test validations } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/StoreApiTest.java index 927e3693a09..edf04387009 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -89,8 +89,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() throws IOException { - Order body = null; - Order response = api.placeOrder(body); + Order order = null; + Order response = api.placeOrder(order); // TODO: test validations } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/UserApiTest.java index 6d89cc2a831..d2325171563 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/io/swagger/client/api/UserApiTest.java @@ -42,8 +42,8 @@ public class UserApiTest { */ @Test public void createUserTest() throws IOException { - User body = null; - api.createUser(body); + User user = null; + api.createUser(user); // TODO: test validations } @@ -58,8 +58,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() throws IOException { - List body = null; - api.createUsersWithArrayInput(body); + List user = null; + api.createUsersWithArrayInput(user); // TODO: test validations } @@ -74,8 +74,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() throws IOException { - List body = null; - api.createUsersWithListInput(body); + List user = null; + api.createUsersWithListInput(user); // TODO: test validations } @@ -155,8 +155,8 @@ public class UserApiTest { @Test public void updateUserTest() throws IOException { String username = null; - User body = null; - api.updateUser(username, body); + User user = null; + api.updateUser(username, user); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey1/.openapi-generator-ignore b/samples/client/petstore/java/jersey1/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator-ignore +++ b/samples/client/petstore/java/jersey1/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/jersey1/README.md b/samples/client/petstore/java/jersey1/README.md index 264fe34c81a..395cdb929ba 100644 --- a/samples/client/petstore/java/jersey1/README.md +++ b/samples/client/petstore/java/jersey1/README.md @@ -1,24 +1,35 @@ -# swagger-java-client +# petstore-java-client-jersey1 + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-java-client - 1.0.0 - compile + org.openapitools + petstore-java-client-jersey1 + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-java-client:1.0.0" +compile "org.openapitools:petstore-java-client-jersey1:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-java-client-1.0.0.jar -* target/lib/*.jar +* `target/petstore-java-client-jersey1-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -61,32 +74,22 @@ Please follow the [installation](#installation) instruction and execute the foll import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; -import io.swagger.client.api.FakeApi; +import io.swagger.client.api.AnotherFakeApi; import java.io.File; import java.util.*; -public class FakeApiExample { +public class AnotherFakeApiExample { public static void main(String[] args) { - FakeApi apiInstance = new FakeApi(); - BigDecimal number = new BigDecimal(); // BigDecimal | None - Double _double = 3.4D; // Double | None - String string = "string_example"; // String | None - byte[] _byte = B; // byte[] | None - Integer integer = 56; // Integer | None - Integer int32 = 56; // Integer | None - Long int64 = 789L; // Long | None - Float _float = 3.4F; // Float | None - byte[] binary = B; // byte[] | None - LocalDate date = new LocalDate(); // LocalDate | None - DateTime dateTime = new DateTime(); // DateTime | None - String password = "password_example"; // String | None + AnotherFakeApi apiInstance = new AnotherFakeApi(); + Client client = new Client(); // Client | client model try { - apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + Client result = apiInstance.testSpecialTags(client); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); e.printStackTrace(); } } @@ -96,12 +99,22 @@ public class FakeApiExample { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**testEnumQueryParameters**](docs/FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -110,9 +123,9 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array @@ -132,9 +145,13 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) - [Dog](docs/Dog.md) + - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FormatTest](docs/FormatTest.md) @@ -147,6 +164,11 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) @@ -163,6 +185,16 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + ### petstore_auth - **Type**: OAuth @@ -175,7 +207,7 @@ Authentication schemes defined for the API: ## Recommendation -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. ## Author diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index e9643f8935c..92175ba04f8 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-java-client' + pom.artifactId = 'petstore-java-client-jersey1' } } @@ -109,7 +109,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" - compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version", + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version" compile "com.brsanthu:migbase64:2.2" testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey1/docs/EnumTest.md b/samples/client/petstore/java/jersey1/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/jersey1/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey1/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey1/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/jersey1/docs/Fake_classname_tags123Api.md deleted file mode 100644 index 56f7c9ea1ff..00000000000 --- a/samples/client/petstore/java/jersey1/docs/Fake_classname_tags123Api.md +++ /dev/null @@ -1,52 +0,0 @@ -# Fake_classname_tags123Api - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.Fake_classname_tags123Api; - - -Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling Fake_classname_tags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey1/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/jersey1/docs/FakeclassnametagsApi.md deleted file mode 100644 index f8ec0768e1f..00000000000 --- a/samples/client/petstore/java/jersey1/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey1/docs/FormatTest.md b/samples/client/petstore/java/jersey1/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/jersey1/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey1/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/jersey1/docs/Name.md b/samples/client/petstore/java/jersey1/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/jersey1/docs/Name.md +++ b/samples/client/petstore/java/jersey1/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/retrofit/docs/ModelReturn.md b/samples/client/petstore/java/jersey1/docs/OuterBoolean.md similarity index 66% rename from samples/client/petstore/java/retrofit/docs/ModelReturn.md rename to samples/client/petstore/java/jersey1/docs/OuterBoolean.md index a679b04953e..0c792032f84 100644 --- a/samples/client/petstore/java/retrofit/docs/ModelReturn.md +++ b/samples/client/petstore/java/jersey1/docs/OuterBoolean.md @@ -1,10 +1,9 @@ -# ModelReturn +# OuterBoolean ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_return** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/jersey1/docs/OuterNumber.md b/samples/client/petstore/java/jersey1/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey1/docs/OuterString.md b/samples/client/petstore/java/jersey1/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey1/docs/PetApi.md b/samples/client/petstore/java/jersey1/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/jersey1/docs/PetApi.md +++ b/samples/client/petstore/java/jersey1/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/jersey1/docs/SpecialModelName.md b/samples/client/petstore/java/jersey1/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/jersey1/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey1/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/jersey1/docs/StoreApi.md b/samples/client/petstore/java/jersey1/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/jersey1/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey1/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/jersey1/docs/UserApi.md b/samples/client/petstore/java/jersey1/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/jersey1/docs/UserApi.md +++ b/samples/client/petstore/java/jersey1/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 5b0aa55e110..397958485ba 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-java-client + org.openapitools + petstore-java-client-jersey1 jar - swagger-java-client + petstore-java-client-jersey1 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org @@ -139,8 +139,7 @@ maven-compiler-plugin 3.6.1 - - 1.7 + 1.7 1.7 diff --git a/samples/client/petstore/java/jersey1/settings.gradle b/samples/client/petstore/java/jersey1/settings.gradle index 55640f75122..ec7f7828bd6 100644 --- a/samples/client/petstore/java/jersey1/settings.gradle +++ b/samples/client/petstore/java/jersey1/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-java-client" \ No newline at end of file +rootProject.name = "petstore-java-client-jersey1" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java index b271ac74462..66221f286ec 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -51,16 +51,16 @@ public class AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client body) throws ApiException { - Object localVarPostBody = body; + public Client testSpecialTags(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); } // create path and map variables 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 267fd5c8bda..db7546d4630 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 @@ -22,9 +22,11 @@ import io.swagger.client.Pair; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; @@ -55,12 +57,12 @@ public class FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean * @throws ApiException if fails to make API call */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - Object localVarPostBody = body; + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws ApiException { + Object localVarPostBody = booleanPostBody; // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -75,7 +77,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -92,12 +94,12 @@ public class FakeApi { /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException if fails to make API call */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - Object localVarPostBody = body; + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + Object localVarPostBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -112,7 +114,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -149,7 +151,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -186,7 +188,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -200,19 +202,67 @@ public class FakeApi { GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + // query params + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("query", query)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClientModel(Client body) throws ApiException { - Object localVarPostBody = body; + public Client testClientModel(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); } // create path and map variables @@ -261,7 +311,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'number' is set @@ -325,12 +375,12 @@ if (paramCallback != null) localVarFormParams.put("callback", paramCallback); final String[] localVarAccepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -342,17 +392,17 @@ if (paramCallback != null) /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException if fails to make API call */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -367,6 +417,7 @@ if (paramCallback != null) localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); @@ -377,16 +428,14 @@ if (enumHeaderString != null) localVarFormParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); -if (enumQueryDouble != null) - localVarFormParams.put("enum_query_double", enumQueryDouble); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -398,15 +447,15 @@ if (enumQueryDouble != null) /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - Object localVarPostBody = param; + public void testInlineAdditionalProperties(String requestBody) throws ApiException { + Object localVarPostBody = requestBody; - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -478,7 +527,7 @@ if (param2 != null) final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); 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 16e52ea7a02..adad1c5323e 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 @@ -51,16 +51,16 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClassname(Client body) throws ApiException { - Object localVarPostBody = body; + public Client testClassname(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); } // create path and map variables 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 edd3fb24885..94528e186d3 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 @@ -53,15 +53,15 @@ public class PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void addPet(Pet body) throws ApiException { - Object localVarPostBody = body; + public void addPet(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } // create path and map variables @@ -77,7 +77,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -122,7 +122,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -270,15 +270,15 @@ public class PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void updatePet(Pet body) throws ApiException { - Object localVarPostBody = body; + public void updatePet(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } // create path and map variables @@ -294,7 +294,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -342,7 +342,7 @@ if (status != null) localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); 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 0c8a68f5d21..4271802d18d 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 @@ -76,7 +76,7 @@ public class StoreApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -172,16 +172,16 @@ public class StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException if fails to make API call */ - public Order placeOrder(Order body) throws ApiException { - Object localVarPostBody = body; + public Order placeOrder(Order order) throws ApiException { + Object localVarPostBody = order; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } // create path and map variables 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 5d44eb9cd82..7f21395e283 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 @@ -51,15 +51,15 @@ public class UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException if fails to make API call */ - public void createUser(User body) throws ApiException { - Object localVarPostBody = body; + public void createUser(User user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } // create path and map variables @@ -75,7 +75,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -92,15 +92,15 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithArrayInput(List body) throws ApiException { - Object localVarPostBody = body; + public void createUsersWithArrayInput(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } // create path and map variables @@ -116,7 +116,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -133,15 +133,15 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithListInput(List body) throws ApiException { - Object localVarPostBody = body; + public void createUsersWithListInput(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } // create path and map variables @@ -157,7 +157,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -199,7 +199,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -327,7 +327,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -345,20 +345,20 @@ public class UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException if fails to make API call */ - public void updateUser(String username, User body) throws ApiException { - Object localVarPostBody = body; + public void updateUser(String username, User user) throws ApiException { + Object localVarPostBody = user; // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables @@ -375,7 +375,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); 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 193d7f101db..2bb7dd17d43 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 @@ -67,6 +67,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -164,6 +204,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -229,6 +287,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -236,7 +295,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -246,6 +305,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 67879022f96..5f601300b95 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 @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -55,7 +56,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -223,7 +224,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -233,11 +234,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -331,7 +332,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -340,7 +341,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 38fb1481a3d..46fb5650ff0 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 @@ -78,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 a62db5e76e6..e12c1072478 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 @@ -37,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -85,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -106,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -123,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 209b4263f7e..3676b70365a 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 @@ -27,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -56,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -71,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/PetstoreProfiling.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/PetstoreProfiling.java deleted file mode 100644 index d0be1523e45..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/PetstoreProfiling.java +++ /dev/null @@ -1,106 +0,0 @@ -package io.swagger; - -import java.io.*; -import java.util.*; - -import io.swagger.client.*; -import io.swagger.client.api.*; -import io.swagger.client.model.*; - -public class PetstoreProfiling { - public int total = 5; - public Long newPetId = 50003L; - public String outputFile = "./petstore_profiling.output"; - - public void callApis(int index, List> results) { - long start; - - try { - PetApi petApi = new PetApi(); - - /* ADD PET */ - Pet pet = new Pet(); - pet.setId(newPetId); - pet.setName("profiler"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - pet.setPhotoUrls(Arrays.asList("http://profiler.com")); - // new tag - Tag tag = new Tag(); - tag.setId(newPetId); // use the same id as pet - tag.setName("profile tag 1"); - // new category - Category category = new Category(); - category.setId(newPetId); // use the same id as pet - category.setName("profile category 1"); - - pet.setTags(Arrays.asList(tag)); - pet.setCategory(category); - - /* ADD PET */ - start = System.nanoTime(); - petApi.addPet(pet); - results.add(buildResult(index, "ADD PET", System.nanoTime() - start)); - - /* GET PET */ - start = System.nanoTime(); - pet = petApi.getPetById(newPetId); - results.add(buildResult(index, "GET PET", System.nanoTime() - start)); - - /* UPDATE PET WITH FORM */ - start = System.nanoTime(); - petApi.updatePetWithForm(newPetId, "new profiler", "sold"); - results.add(buildResult(index, "UPDATE PET", System.nanoTime() - start)); - - /* DELETE PET */ - start = System.nanoTime(); - petApi.deletePet(newPetId, "special-key"); - results.add(buildResult(index, "DELETE PET", System.nanoTime() - start)); - } catch (ApiException e) { - System.out.println("Caught error: " + e.getMessage()); - System.out.println("HTTP response headers: " + e.getResponseHeaders()); - System.out.println("HTTP response body: " + e.getResponseBody()); - System.out.println("HTTP status code: " + e.getCode()); - } - } - - public void run() { - System.out.printf("Running profiling... (total: %s)\n", total); - - List> results = new ArrayList>(); - for (int i = 0; i < total; i++) { - callApis(i, results); - } - writeResultsToFile(results); - - System.out.printf("Profiling results written to %s\n", outputFile); - } - - private Map buildResult(int index, String name, long time) { - Map result = new HashMap(); - result.put("index", String.valueOf(index)); - result.put("name", name); - result.put("time", String.valueOf(time / 1000000000.0)); - return result; - } - - private void writeResultsToFile(List> results) { - try { - java.io.File file = new java.io.File(outputFile); - PrintWriter writer = new PrintWriter(file); - String command = "mvn compile test-compile exec:java -Dexec.classpathScope=test -Dexec.mainClass=\"io.swagger.PetstoreProfiling\""; - writer.println("# To run the profiling:"); - writer.printf("# %s\n\n", command); - for (Map result : results) { - writer.printf("%s: %s => %s\n", result.get("index"), result.get("name"), result.get("time")); - } - writer.close(); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - - public static void main(String[] args) { - final PetstoreProfiling profiling = new PetstoreProfiling(); - profiling.run(); - } -} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/ApiClientTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/ApiClientTest.java deleted file mode 100644 index 02a895dd092..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/ApiClientTest.java +++ /dev/null @@ -1,292 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - } - - @Test - public void testParseAndFormatDate() { - // default date format - String dateStr = "2015-11-07T03:49:09.356Z"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); - - // custom date format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - dateStr = "2015-11-07T13:49:09+10:00"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - @Ignore("There is no more basic auth in petstore security definitions") - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testParameterToPairWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPair(null, new Integer(1)); - List pairs_b = apiClient.parameterToPair("", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPair("param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsEmptyString() throws Exception { - // single empty string - List pairs = apiClient.parameterToPair("param-a", " "); - assertEquals(1, pairs.size()); - } - - @Test - public void testParameterToPairWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPair(name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairWhenValueIsCollection() throws Exception { - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - List pairs = apiClient.parameterToPair("param-a", values); - assertEquals(0, pairs.size()); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List objects = new ArrayList(); - objects.add(new Integer(1)); - - List pairs_a = apiClient.parameterToPairs("csv", null, objects); - List pairs_b = apiClient.parameterToPairs("csv", "", objects); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); - } - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - if (!delimiter.equals(",")) { - // commas are not escaped because they are reserved characters in URIs - delimiter = apiClient.escapeString(delimiter); - } - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); - } - } - } -} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/ConfigurationTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/ConfigurationTest.java deleted file mode 100644 index ccdf25feb30..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/ConfigurationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ConfigurationTest { - @Test - public void testDefaultApiClient() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); - assertFalse(apiClient.isDebugging()); - } -} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/StringUtilTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/StringUtilTest.java deleted file mode 100644 index 4b03c7a9812..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/StringUtilTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); - } -} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..0c06fbf57ca 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeApiTest.java index c564001ad70..7de631a091e 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -1,9 +1,28 @@ +/* + * 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.api; import io.swagger.client.ApiException; import java.math.BigDecimal; -import java.util.Date; +import io.swagger.client.model.Client; +import java.io.File; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -13,11 +32,109 @@ import java.util.Map; /** * API tests for FakeApi */ +@Ignore public class FakeApiTest { private final FakeApi api = new FakeApi(); + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + Client client = null; + Client response = api.testClientModel(client); + + // TODO: test validations + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -30,17 +147,75 @@ public class FakeApiTest { public void testEndpointParametersTest() throws ApiException { BigDecimal number = null; Double _double = null; - String string = null; + String patternWithoutDelimiter = null; byte[] _byte = null; Integer integer = null; Integer int32 = null; Long int64 = null; Float _float = null; - byte[] binary = null; - Date date = null; - Date dateTime = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; String password = null; - // api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + String paramCallback = null; + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws ApiException { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + String param = null; + String param2 = null; + api.testJsonFormData(param, param2); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..7b603d245c1 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,15 +35,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/PetApiTest.java index fe6424a3f9e..1801332c609 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,301 +1,170 @@ +/* + * 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.api; -import com.fasterxml.jackson.annotation.*; -import com.fasterxml.jackson.databind.*; - -import io.swagger.TestUtils; - -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.io.BufferedWriter; +import io.swagger.client.ApiException; import java.io.File; -import java.io.FileWriter; -import java.util.*; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Test; +import org.junit.Ignore; -import org.junit.*; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * API tests for PetApi + */ +@Ignore public class PetApiTest { - private PetApi api; - private ObjectMapper mapper; - @Before - public void setup() { - api = new PetApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } + private final PetApi api = new PetApi(); + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testApiClient() { - // the default api client is used - assertEquals(Configuration.getDefaultApiClient(), api.getApiClient()); - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - - ApiClient oldClient = api.getApiClient(); - - ApiClient newClient = new ApiClient(); - newClient.setBasePath("http://example.com"); - newClient.setDebugging(true); - - // set api client via constructor - api = new PetApi(newClient); - assertNotNull(api.getApiClient()); - assertEquals("http://example.com", api.getApiClient().getBasePath()); - assertTrue(api.getApiClient().isDebugging()); - - // set api client via setter method - api.setApiClient(oldClient); - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - } - - @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createRandomPet(); + public void addPetTest() throws ApiException { + Pet pet = null; api.addPet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - - /* + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateAndGetPetWithByteArray() throws Exception { - Pet pet = createRandomPet(); - byte[] bytes = serializeJson(pet).getBytes(); - api.addPetUsingByteArray(bytes); + public void deletePetTest() throws ApiException { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); - byte[] fetchedBytes = api.petPetIdtestingByteArraytrueGet(pet.getId()); - Pet fetched = deserializeJson(new String(fetchedBytes), Pet.class); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetPetByIdInObject() throws Exception { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("pet " + pet.getId()); + public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); - Category category = new Category(); - category.setId(TestUtils.nextId()); - category.setName("category " + category.getId()); - pet.setCategory(category); - - pet.setStatus(Pet.StatusEnum.PENDING); - List photos = Arrays.asList(new String[]{"http://foo.bar.com/1"}); - pet.setPhotoUrls(photos); - - api.addPet(pet); - - InlineResponse200 fetched = api.getPetByIdInObject(pet.getId()); - assertEquals(pet.getId(), fetched.getId()); - assertEquals(pet.getName(), fetched.getName()); - - Object categoryObj = fetched.getCategory(); - assertNotNull(categoryObj); - assertTrue(categoryObj instanceof Map); - - Map categoryMap = (Map) categoryObj; - Object categoryIdObj = categoryMap.get("id"); - assertTrue(categoryIdObj instanceof Integer); - Integer categoryIdInt = (Integer) categoryIdObj; - assertEquals(category.getId(), Long.valueOf(categoryIdInt)); - assertEquals(category.getName(), categoryMap.get("name")); + // TODO: test validations } - */ - + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); + public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + Long petId = null; + Pet response = api.getPetById(petId); + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + Pet pet = null; api.updatePet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void updatePetWithFormTest() throws ApiException { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); - api.updatePet(pet); - - List pets = api.findPetsByStatus(Collections.singletonList("available")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); + // TODO: test validations } - + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testFindPetsByTags() throws Exception { - Pet pet = createRandomPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void uploadFileTest() throws ApiException { + Long petId = null; + String additionalMetadata = null; + File file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - List tags = new ArrayList(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet); - - List pets = api.findPetsByTags(Collections.singletonList("friendly")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); + // TODO: test validations } - - @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); - } - - @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(fetched.getId(), null); - - try { - fetched = api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (ApiException e) { - assertEquals(404, e.getCode()); - } - } - - @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); - } - - @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"); - pet.setPhotoUrls(photos); - - return pet; - } - - /*private String serializeJson(Object o) { - if (mapper == null) { - mapper = createObjectMapper(); - } - try { - return mapper.writeValueAsString(o); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private T deserializeJson(String json, Class klass) { - if (mapper == null) { - mapper = createObjectMapper(); - } - try { - return mapper.readValue(json, klass); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private ObjectMapper createObjectMapper() { - ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.registerModule(new JodaModule()); - return mapper; - }*/ + } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/StoreApiTest.java index 215b06feff8..956978b470c 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,102 +1,98 @@ +/* + * 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.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiException; +import io.swagger.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; -import java.text.SimpleDateFormat; - -import org.junit.*; -import org.threeten.bp.OffsetDateTime; - -import static org.junit.Assert.*; +/** + * API tests for StoreApi + */ +@Ignore public class StoreApiTest { - private StoreApi api = null; - @Before - public void setup() { - api = new StoreApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - // set custom date format that is used by the petstore server - api.getApiClient().setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")); - } + private final StoreApi api = new StoreApi(); + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory(); - assertTrue(inventory.keySet().size() > 0); - } + public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); - /* + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetInventoryInObject() throws Exception { - Object inventoryObj = api.getInventoryInObject(); - assertTrue(inventoryObj instanceof Map); + public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); - Map inventoryMap = (Map) inventoryObj; - assertTrue(inventoryMap.keySet().size() > 0); - - Map.Entry firstEntry = (Map.Entry) inventoryMap.entrySet().iterator().next(); - assertTrue(firstEntry.getKey() instanceof String); - assertTrue(firstEntry.getValue() instanceof Integer); + // TODO: test validations } - */ - + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testPlaceOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getOrderByIdTest() throws ApiException { + Long orderId = null; + Order response = api.getOrderById(orderId); - Order fetched = api.getOrderById(order.getId()); - assertEquals(order.getId(), fetched.getId()); - assertEquals(order.getPetId(), fetched.getPetId()); - assertEquals(order.getQuantity(), fetched.getQuantity()); - assertTrue(order.getShipDate().isEqual(fetched.getShipDate())); + // TODO: test validations } - + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void placeOrderTest() throws ApiException { + Order order = null; + Order response = api.placeOrder(order); - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); - - api.deleteOrder(String.valueOf(order.getId())); - - try { - api.getOrderById(order.getId()); - // fail("expected an error"); - } catch (ApiException e) { - // ok - } - } - - private Order createOrder() { - Order order = new Order(); - order.setPetId(200L); - order.setQuantity(13); - //Ensure 3 fractional digits because of a bug in the petstore server - order.setShipDate(OffsetDateTime.now().withNano(123000000)); - order.setStatus(Order.StatusEnum.PLACED); - order.setComplete(true); - - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, TestUtils.nextId()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; + // TODO: test validations } + } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java index c7fb92d2552..411e031d0d3 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,88 +1,164 @@ +/* + * 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.api; -import io.swagger.TestUtils; +import io.swagger.client.ApiException; +import io.swagger.client.model.User; +import org.junit.Test; +import org.junit.Ignore; -import io.swagger.client.api.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.util.Arrays; - -import org.junit.*; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * API tests for UserApi + */ +@Ignore public class UserApiTest { - UserApi api = null; - @Before - public void setup() { - api = new UserApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } + private final UserApi api = new UserApi(); + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUser() throws Exception { - User user = createUser(); - + public void createUserTest() throws ApiException { + User user = null; api.createUser(user); - User fetched = api.getUserByName(user.getUsername()); - assertEquals(user.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUsersWithArray() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithArrayInputTest() throws ApiException { + List user = null; + api.createUsersWithArrayInput(user); - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUsersWithList() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithListInputTest() throws ApiException { + List user = null; + api.createUsersWithListInput(user); - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testLoginUser() throws Exception { - User user = createUser(); - api.createUser(user); + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); - String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + // TODO: test validations } - + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void logoutUser() throws Exception { + public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { api.logoutUser(); - } - private User createUser() { - User user = new User(); - user.setId(TestUtils.nextId()); - user.setUsername("fred" + user.getId()); - user.setFirstName("Fred"); - user.setLastName("Meyer"); - user.setEmail("fred@fredmeyer.com"); - user.setPassword("xxXXxx"); - user.setPhone("408-867-5309"); - user.setUserStatus(123); - - return user; + // TODO: test validations } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User user = null; + api.updateUser(username, user); + + // TODO: test validations + } + } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java deleted file mode 100644 index 5bdb4fb78fb..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header parameters - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } -} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java deleted file mode 100644 index 52c5497ba83..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - } -} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/model/EnumValueTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/model/EnumValueTest.java deleted file mode 100644 index e2ce8e1f1e5..00000000000 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/model/EnumValueTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package io.swagger.client.model; - -import org.junit.Test; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - try { - // test serialization (object => json) - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - ObjectWriter ow = mapper.writer(); - String json = ow.writeValueAsString(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); - - // test deserialization (json => object) - EnumTest fromString = mapper.readValue(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - - } catch (Exception e) { - fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); - } - } -} diff --git a/samples/client/petstore/java/jersey2-java6/.openapi-generator-ignore b/samples/client/petstore/java/jersey2-java6/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/jersey2-java6/.openapi-generator-ignore +++ b/samples/client/petstore/java/jersey2-java6/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/jersey2-java6/README.md b/samples/client/petstore/java/jersey2-java6/README.md index b53485ad7d9..a338324895f 100644 --- a/samples/client/petstore/java/jersey2-java6/README.md +++ b/samples/client/petstore/java/jersey2-java6/README.md @@ -1,24 +1,35 @@ -# swagger-petstore-jersey2-java6 +# petstore-jersey2-java6 + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-jersey2-java6 - 1.0.0 - compile + org.openapitools + petstore-jersey2-java6 + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-jersey2-java6:1.0.0" +compile "org.openapitools:petstore-jersey2-java6:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-jersey2-java6-1.0.0.jar -* target/lib/*.jar +* `target/petstore-jersey2-java6-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -71,9 +84,9 @@ public class AnotherFakeApiExample { public static void main(String[] args) { AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -95,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -132,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -148,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/jersey2-java6/build.gradle b/samples/client/petstore/java/jersey2-java6/build.gradle index 6f54775fc64..2676ce5ac1e 100644 --- a/samples/client/petstore/java/jersey2-java6/build.gradle +++ b/samples/client/petstore/java/jersey2-java6/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -82,7 +82,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-jersey2-java6' + pom.artifactId = 'petstore-jersey2-java6' } } diff --git a/samples/client/petstore/java/jersey2-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt index 2e7737c2d69..43d1633ed87 100644 --- a/samples/client/petstore/java/jersey2-java6/build.sbt +++ b/samples/client/petstore/java/jersey2-java6/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-jersey2-java6", + organization := "org.openapitools", + name := "petstore-jersey2-java6", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md b/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2-java6/docs/Name.md b/samples/client/petstore/java/jersey2-java6/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Name.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/jersey2-java6/docs/OuterBoolean.md b/samples/client/petstore/java/jersey2-java6/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2-java6/docs/OuterNumber.md b/samples/client/petstore/java/jersey2-java6/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2-java6/docs/OuterString.md b/samples/client/petstore/java/jersey2-java6/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index bd6f5cdcb96..a61c7c12307 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger + org.openapitools petstore-jersey2-java6 jar petstore-jersey2-java6 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org @@ -139,8 +139,7 @@ maven-compiler-plugin 3.6.1 - - 1.7 + 1.7 1.7 diff --git a/samples/client/petstore/java/jersey2-java6/settings.gradle b/samples/client/petstore/java/jersey2-java6/settings.gradle index 4449df58659..e127b58b3ee 100644 --- a/samples/client/petstore/java/jersey2-java6/settings.gradle +++ b/samples/client/petstore/java/jersey2-java6/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-jersey2-java6" \ No newline at end of file +rootProject.name = "petstore-jersey2-java6" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java index a4201c9391b..2bb8cbbadfe 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -38,27 +38,27 @@ public class AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client body) throws ApiException { - return testSpecialTagsWithHttpInfo(body).getData(); + public Client testSpecialTags(Client client) throws ApiException { + return testSpecialTagsWithHttpInfo(client).getData(); } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); } // create path and map variables diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java index 293591710ea..52ec7d2a664 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java @@ -10,9 +10,11 @@ import javax.ws.rs.core.GenericType; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -42,23 +44,23 @@ public class FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean * @throws ApiException if fails to make API call */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - return fakeOuterBooleanSerializeWithHttpInfo(body).getData(); + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws ApiException { + return fakeOuterBooleanSerializeWithHttpInfo(booleanPostBody).getData(); } /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return ApiResponse<Boolean> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean booleanPostBody) throws ApiException { + Object localVarPostBody = booleanPostBody; // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -72,7 +74,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -89,23 +91,23 @@ public class FakeApi { /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException if fails to make API call */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - return fakeOuterCompositeSerializeWithHttpInfo(body).getData(); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + return fakeOuterCompositeSerializeWithHttpInfo(outerComposite).getData(); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { + Object localVarPostBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -119,7 +121,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -166,7 +168,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -213,7 +215,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -227,30 +229,89 @@ public class FakeApi { GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + + testBodyWithQueryParamsWithHttpInfo(query, user); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClientModel(Client body) throws ApiException { - return testClientModelWithHttpInfo(body).getData(); + public Client testClientModel(Client client) throws ApiException { + return testClientModelWithHttpInfo(client).getData(); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); } // create path and map variables @@ -298,7 +359,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -322,7 +383,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'number' is set @@ -385,12 +446,12 @@ if (paramCallback != null) localVarFormParams.put("callback", paramCallback); final String[] localVarAccepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -402,35 +463,35 @@ if (paramCallback != null) /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException if fails to make API call */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException if fails to make API call */ - public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { + public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -444,6 +505,7 @@ if (paramCallback != null) localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); @@ -454,16 +516,14 @@ if (enumHeaderString != null) localVarFormParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); -if (enumQueryDouble != null) - localVarFormParams.put("enum_query_double", enumQueryDouble); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -475,26 +535,26 @@ if (enumQueryDouble != null) /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public void testInlineAdditionalProperties(Object param) throws ApiException { + public void testInlineAdditionalProperties(String requestBody) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + testInlineAdditionalPropertiesWithHttpInfo(requestBody); } /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Object param) throws ApiException { - Object localVarPostBody = param; + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(String requestBody) throws ApiException { + Object localVarPostBody = requestBody; - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -576,7 +636,7 @@ if (param2 != null) final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 4c15c19f414..d216d4cb7f1 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -38,27 +38,27 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClassname(Client body) throws ApiException { - return testClassnameWithHttpInfo(body).getData(); + public Client testClassname(Client client) throws ApiException { + return testClassnameWithHttpInfo(client).getData(); } /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); } // create path and map variables diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java index e2cca5b3eec..9d75eb86f41 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java @@ -40,26 +40,26 @@ public class PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void addPet(Pet body) throws ApiException { + public void addPet(Pet pet) throws ApiException { - addPetWithHttpInfo(body); + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } // create path and map variables @@ -74,7 +74,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -130,7 +130,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -310,26 +310,26 @@ public class PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void updatePet(Pet body) throws ApiException { + public void updatePet(Pet pet) throws ApiException { - updatePetWithHttpInfo(body); + updatePetWithHttpInfo(pet); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } // create path and map variables @@ -344,7 +344,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -404,7 +404,7 @@ if (status != null) localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java index ede729d9540..c4a5249cce8 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java @@ -73,7 +73,7 @@ public class StoreApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -188,27 +188,27 @@ public class StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException if fails to make API call */ - public Order placeOrder(Order body) throws ApiException { - return placeOrderWithHttpInfo(body).getData(); + public Order placeOrder(Order order) throws ApiException { + return placeOrderWithHttpInfo(order).getData(); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException if fails to make API call */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + Object localVarPostBody = order; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } // create path and map variables diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java index 6535ce10427..0ba546adda3 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java @@ -38,26 +38,26 @@ public class UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException if fails to make API call */ - public void createUser(User body) throws ApiException { + public void createUser(User user) throws ApiException { - createUserWithHttpInfo(body); + createUserWithHttpInfo(user); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } // create path and map variables @@ -72,7 +72,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -89,26 +89,26 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithArrayInput(List body) throws ApiException { + public void createUsersWithArrayInput(List user) throws ApiException { - createUsersWithArrayInputWithHttpInfo(body); + createUsersWithArrayInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } // create path and map variables @@ -123,7 +123,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -140,26 +140,26 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithListInput(List body) throws ApiException { + public void createUsersWithListInput(List user) throws ApiException { - createUsersWithListInputWithHttpInfo(body); + createUsersWithListInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } // create path and map variables @@ -174,7 +174,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -226,7 +226,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -384,7 +384,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -402,32 +402,32 @@ public class UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException if fails to make API call */ - public void updateUser(String username, User body) throws ApiException { + public void updateUser(String username, User user) throws ApiException { - updateUserWithHttpInfo(username, body); + updateUserWithHttpInfo(username, user); } /** * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + Object localVarPostBody = user; // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables @@ -443,7 +443,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java index 1ff3b541245..f7710aa02c0 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java @@ -66,6 +66,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -163,6 +203,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -228,6 +286,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return ObjectUtils.equals(this.enumString, enumTest.enumString) && + ObjectUtils.equals(this.enumStringRequired, enumTest.enumStringRequired) && ObjectUtils.equals(this.enumInteger, enumTest.enumInteger) && ObjectUtils.equals(this.enumNumber, enumTest.enumNumber) && ObjectUtils.equals(this.outerEnum, enumTest.outerEnum); @@ -235,7 +294,7 @@ public class EnumTest { @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(enumString, enumInteger, enumNumber, outerEnum); + return ObjectUtils.hashCodeMulti(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -245,6 +304,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java index 1eac24d55c6..8bde2d233ec 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -54,7 +55,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -222,7 +223,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -232,11 +233,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java index b32ea0a16c4..1a7bce6281e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java @@ -77,9 +77,9 @@ public class Model200Response { if (o == null || getClass() != o.getClass()) { return false; } - Model200Response _200Response = (Model200Response) o; - return ObjectUtils.equals(this.name, _200Response.name) && - ObjectUtils.equals(this.propertyClass, _200Response.propertyClass); + Model200Response _200response = (Model200Response) o; + return ObjectUtils.equals(this.name, _200response.name) && + ObjectUtils.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java index a3c678b021f..7b5ccefdd81 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java @@ -36,7 +36,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -84,12 +84,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -105,12 +105,12 @@ public class Name { return ObjectUtils.equals(this.name, name.name) && ObjectUtils.equals(this.snakeCase, name.snakeCase) && ObjectUtils.equals(this.property, name.property) && - ObjectUtils.equals(this._123Number, name._123Number); + ObjectUtils.equals(this._123number, name._123number); } @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(name, snakeCase, property, _123Number); + return ObjectUtils.hashCodeMulti(name, snakeCase, property, _123number); } @@ -122,7 +122,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..4bc4d62efde --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,62 @@ +/* + * 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.model; + +import org.apache.commons.lang3.ObjectUtils; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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 ObjectUtils.hashCodeMulti(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..66c41ddcaf1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,62 @@ +/* + * 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.model; + +import org.apache.commons.lang3.ObjectUtils; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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 ObjectUtils.hashCodeMulti(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..d77d3e26271 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,62 @@ +/* + * 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.model; + +import org.apache.commons.lang3.ObjectUtils; + +/** + * OuterString + */ + +public class OuterString { + + @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 ObjectUtils.hashCodeMulti(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java index 6c750b2d75d..2e0df6db17b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -26,24 +26,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -55,13 +55,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return ObjectUtils.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return ObjectUtils.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(specialPropertyName); + return ObjectUtils.hashCodeMulti($specialPropertyName); } @@ -70,7 +70,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..0c06fbf57ca 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java index 0e4979b2906..7de631a091e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,9 +16,11 @@ package io.swagger.client.api; import io.swagger.client.ApiException; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -46,8 +48,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -62,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -100,6 +102,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -110,8 +129,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -135,7 +154,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -155,15 +174,15 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } @@ -178,8 +197,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { - Object param = null; - api.testInlineAdditionalProperties(param); + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..7b603d245c1 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,15 +35,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java index 349a55d93dc..1801332c609 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java @@ -44,8 +44,8 @@ public class PetApiTest { */ @Test public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); + Pet pet = null; + api.addPet(pet); // TODO: test validations } @@ -125,8 +125,8 @@ public class PetApiTest { */ @Test public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); + Pet pet = null; + api.updatePet(pet); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java index bef0884a2da..956978b470c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -89,8 +89,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() throws ApiException { - Order body = null; - Order response = api.placeOrder(body); + Order order = null; + Order response = api.placeOrder(order); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java index 4455b3920b9..411e031d0d3 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java @@ -42,8 +42,8 @@ public class UserApiTest { */ @Test public void createUserTest() throws ApiException { - User body = null; - api.createUser(body); + User user = null; + api.createUser(user); // TODO: test validations } @@ -58,8 +58,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - api.createUsersWithArrayInput(body); + List user = null; + api.createUsersWithArrayInput(user); // TODO: test validations } @@ -74,8 +74,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() throws ApiException { - List body = null; - api.createUsersWithListInput(body); + List user = null; + api.createUsersWithListInput(user); // TODO: test validations } @@ -155,8 +155,8 @@ public class UserApiTest { @Test public void updateUserTest() throws ApiException { String username = null; - User body = null; - api.updateUser(username, body); + User user = null; + api.updateUser(username, user); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore b/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/jersey2-java8/README.md b/samples/client/petstore/java/jersey2-java8/README.md index 8ceb02c6e3b..a786715e1bc 100644 --- a/samples/client/petstore/java/jersey2-java8/README.md +++ b/samples/client/petstore/java/jersey2-java8/README.md @@ -1,24 +1,35 @@ -# swagger-petstore-jersey2 +# petstore-jersey2-java8 + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-jersey2 - 1.0.0 - compile + org.openapitools + petstore-jersey2-java8 + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-jersey2:1.0.0" +compile "org.openapitools:petstore-jersey2-java8:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-jersey2-1.0.0.jar -* target/lib/*.jar +* `target/petstore-jersey2-java8-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -71,9 +84,9 @@ public class AnotherFakeApiExample { public static void main(String[] args) { AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -95,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -132,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -148,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index db59c81f09d..523d5141c28 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -82,7 +82,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-jersey2' + pom.artifactId = 'petstore-jersey2-java8' } } diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index a82232fe1a0..80b7698e7b2 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-jersey2", + organization := "org.openapitools", + name := "petstore-jersey2-java8", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/jersey2-java8/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/jersey2-java8/docs/Fake_classname_tags123Api.md deleted file mode 100644 index 56f7c9ea1ff..00000000000 --- a/samples/client/petstore/java/jersey2-java8/docs/Fake_classname_tags123Api.md +++ /dev/null @@ -1,52 +0,0 @@ -# Fake_classname_tags123Api - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.Fake_classname_tags123Api; - - -Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling Fake_classname_tags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeclassnametagsApi.md deleted file mode 100644 index f8ec0768e1f..00000000000 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2-java8/docs/Name.md b/samples/client/petstore/java/jersey2-java8/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Name.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 9541e09470f..0d508e5e97b 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-jersey2 + org.openapitools + petstore-jersey2-java8 jar - swagger-petstore-jersey2 + petstore-jersey2-java8 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/jersey2-java8/settings.gradle b/samples/client/petstore/java/jersey2-java8/settings.gradle index 498d426abee..409d1665bf5 100644 --- a/samples/client/petstore/java/jersey2-java8/settings.gradle +++ b/samples/client/petstore/java/jersey2-java8/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-jersey2" \ No newline at end of file +rootProject.name = "petstore-jersey2-java8" \ No newline at end of file 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 e75a0387f33..c8c9625de79 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 @@ -502,7 +502,7 @@ if (paramCallback != null) Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); 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 0afbcf99547..9d75eb86f41 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 @@ -178,7 +178,7 @@ public class PetApi { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); @@ -235,7 +235,7 @@ public class PetApi { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); 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 38fb1481a3d..46fb5650ff0 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 @@ -78,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 a62db5e76e6..e12c1072478 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 @@ -37,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -85,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -106,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -123,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } 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 209b4263f7e..3676b70365a 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 @@ -27,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -56,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -71,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ApiClientTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ApiClientTest.java deleted file mode 100644 index c8824547303..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ApiClientTest.java +++ /dev/null @@ -1,250 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - } - - @Test - public void testParseAndFormatDate() { - // default date format - String dateStr = "2015-11-07T03:49:09.356Z"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); - - // custom date format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - dateStr = "2015-11-07T13:49:09+10:00"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - @Ignore("There is no more basic auth in petstore security definitions") - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPairs("csv", null, new Integer(1)); - List pairs_b = apiClient.parameterToPairs("csv", "", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - - // single empty string - List pairs = apiClient.parameterToPairs("csv", "param-a", " "); - assertEquals(1, pairs.size()); - - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPairs("csv", name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "\\|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - } - } -} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ConfigurationTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ConfigurationTest.java deleted file mode 100644 index ccdf25feb30..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ConfigurationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ConfigurationTest { - @Test - public void testDefaultApiClient() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); - assertFalse(apiClient.isDebugging()); - } -} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/JSONTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/JSONTest.java deleted file mode 100644 index 5286976a819..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/JSONTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.model.Order; - -import java.lang.Exception; - -import java.time.OffsetDateTime; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import org.junit.*; -import static org.junit.Assert.*; - - -public class JSONTest { - JSON json = null; - Order order = null; - - @Before - public void setup() { - json = new JSON(); - order = new Order(); - } - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } -} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/StringUtilTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/StringUtilTest.java deleted file mode 100644 index 4b03c7a9812..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/StringUtilTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); - } -} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..0c06fbf57ca 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..7b603d245c1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,15 +35,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java index 349a55d93dc..1801332c609 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java @@ -44,8 +44,8 @@ public class PetApiTest { */ @Test public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); + Pet pet = null; + api.addPet(pet); // TODO: test validations } @@ -125,8 +125,8 @@ public class PetApiTest { */ @Test public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); + Pet pet = null; + api.updatePet(pet); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/StoreApiTest.java index bef0884a2da..956978b470c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -89,8 +89,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() throws ApiException { - Order body = null; - Order response = api.placeOrder(body); + Order order = null; + Order response = api.placeOrder(order); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/UserApiTest.java index 4455b3920b9..411e031d0d3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/UserApiTest.java @@ -42,8 +42,8 @@ public class UserApiTest { */ @Test public void createUserTest() throws ApiException { - User body = null; - api.createUser(body); + User user = null; + api.createUser(user); // TODO: test validations } @@ -58,8 +58,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - api.createUsersWithArrayInput(body); + List user = null; + api.createUsersWithArrayInput(user); // TODO: test validations } @@ -74,8 +74,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() throws ApiException { - List body = null; - api.createUsersWithListInput(body); + List user = null; + api.createUsersWithListInput(user); // TODO: test validations } @@ -155,8 +155,8 @@ public class UserApiTest { @Test public void updateUserTest() throws ApiException { String username = null; - User body = null; - api.updateUser(username, body); + User user = null; + api.updateUser(username, user); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java deleted file mode 100644 index 5bdb4fb78fb..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header parameters - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } -} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java deleted file mode 100644 index 52c5497ba83..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - } -} diff --git a/samples/client/petstore/java/jersey2/.openapi-generator-ignore b/samples/client/petstore/java/jersey2/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/jersey2/.openapi-generator-ignore +++ b/samples/client/petstore/java/jersey2/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/jersey2/README.md b/samples/client/petstore/java/jersey2/README.md index 8ceb02c6e3b..ca526c151f0 100644 --- a/samples/client/petstore/java/jersey2/README.md +++ b/samples/client/petstore/java/jersey2/README.md @@ -1,24 +1,35 @@ -# swagger-petstore-jersey2 +# petstore-jersey2 + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-jersey2 - 1.0.0 - compile + org.openapitools + petstore-jersey2 + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-jersey2:1.0.0" +compile "org.openapitools:petstore-jersey2:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-jersey2-1.0.0.jar -* target/lib/*.jar +* `target/petstore-jersey2-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -71,9 +84,9 @@ public class AnotherFakeApiExample { public static void main(String[] args) { AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -95,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -132,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -148,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/jersey2/build.gradle b/samples/client/petstore/java/jersey2/build.gradle index f7557cef9e8..d189b0170b5 100644 --- a/samples/client/petstore/java/jersey2/build.gradle +++ b/samples/client/petstore/java/jersey2/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -82,7 +82,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-jersey2' + pom.artifactId = 'petstore-jersey2' } } diff --git a/samples/client/petstore/java/jersey2/build.sbt b/samples/client/petstore/java/jersey2/build.sbt index 969eae51962..f650b5e372d 100644 --- a/samples/client/petstore/java/jersey2/build.sbt +++ b/samples/client/petstore/java/jersey2/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-jersey2", + organization := "org.openapitools", + name := "petstore-jersey2", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey2/docs/ApiResponse.md b/samples/client/petstore/java/jersey2/docs/ApiResponse.md deleted file mode 100644 index 1c17767c2b7..00000000000 --- a/samples/client/petstore/java/jersey2/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2/docs/EnumTest.md b/samples/client/petstore/java/jersey2/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/jersey2/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey2/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/jersey2/docs/Fake_classname_tags123Api.md deleted file mode 100644 index 56f7c9ea1ff..00000000000 --- a/samples/client/petstore/java/jersey2/docs/Fake_classname_tags123Api.md +++ /dev/null @@ -1,52 +0,0 @@ -# Fake_classname_tags123Api - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.Fake_classname_tags123Api; - - -Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling Fake_classname_tags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/jersey2/docs/FakeclassnametagsApi.md deleted file mode 100644 index f8ec0768e1f..00000000000 --- a/samples/client/petstore/java/jersey2/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2/docs/FormatTest.md b/samples/client/petstore/java/jersey2/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/jersey2/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2/docs/InlineResponse200.md b/samples/client/petstore/java/jersey2/docs/InlineResponse200.md deleted file mode 100644 index 232cb0ed5c1..00000000000 --- a/samples/client/petstore/java/jersey2/docs/InlineResponse200.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineResponse200 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**photoUrls** | **List<String>** | | [optional] -**name** | **String** | | [optional] -**id** | **Long** | | -**category** | **Object** | | [optional] -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - - diff --git a/samples/client/petstore/java/jersey2/docs/Name.md b/samples/client/petstore/java/jersey2/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/jersey2/docs/Name.md +++ b/samples/client/petstore/java/jersey2/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/jersey2/docs/OuterBoolean.md b/samples/client/petstore/java/jersey2/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2/docs/OuterNumber.md b/samples/client/petstore/java/jersey2/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2/docs/OuterString.md b/samples/client/petstore/java/jersey2/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2/docs/PetApi.md b/samples/client/petstore/java/jersey2/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/jersey2/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/jersey2/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/jersey2/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey2/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/jersey2/docs/StoreApi.md b/samples/client/petstore/java/jersey2/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/jersey2/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/jersey2/docs/UserApi.md b/samples/client/petstore/java/jersey2/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/jersey2/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index 78b68764b36..edc923c5dca 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-jersey2 + org.openapitools + petstore-jersey2 jar - swagger-petstore-jersey2 + petstore-jersey2 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org @@ -139,8 +139,7 @@ maven-compiler-plugin 3.6.1 - - 1.7 + 1.7 1.7 diff --git a/samples/client/petstore/java/jersey2/settings.gradle b/samples/client/petstore/java/jersey2/settings.gradle index 498d426abee..0ddcd580a4a 100644 --- a/samples/client/petstore/java/jersey2/settings.gradle +++ b/samples/client/petstore/java/jersey2/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-jersey2" \ No newline at end of file +rootProject.name = "petstore-jersey2" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java index a4201c9391b..2bb8cbbadfe 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -38,27 +38,27 @@ public class AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client body) throws ApiException { - return testSpecialTagsWithHttpInfo(body).getData(); + public Client testSpecialTags(Client client) throws ApiException { + return testSpecialTagsWithHttpInfo(client).getData(); } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); } // create path and map variables 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 293591710ea..52ec7d2a664 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 @@ -10,9 +10,11 @@ import javax.ws.rs.core.GenericType; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -42,23 +44,23 @@ public class FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean * @throws ApiException if fails to make API call */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - return fakeOuterBooleanSerializeWithHttpInfo(body).getData(); + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws ApiException { + return fakeOuterBooleanSerializeWithHttpInfo(booleanPostBody).getData(); } /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return ApiResponse<Boolean> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean booleanPostBody) throws ApiException { + Object localVarPostBody = booleanPostBody; // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -72,7 +74,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -89,23 +91,23 @@ public class FakeApi { /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException if fails to make API call */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - return fakeOuterCompositeSerializeWithHttpInfo(body).getData(); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + return fakeOuterCompositeSerializeWithHttpInfo(outerComposite).getData(); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { + Object localVarPostBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -119,7 +121,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -166,7 +168,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -213,7 +215,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -227,30 +229,89 @@ public class FakeApi { GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + + testBodyWithQueryParamsWithHttpInfo(query, user); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClientModel(Client body) throws ApiException { - return testClientModelWithHttpInfo(body).getData(); + public Client testClientModel(Client client) throws ApiException { + return testClientModelWithHttpInfo(client).getData(); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); } // create path and map variables @@ -298,7 +359,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -322,7 +383,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'number' is set @@ -385,12 +446,12 @@ if (paramCallback != null) localVarFormParams.put("callback", paramCallback); final String[] localVarAccepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -402,35 +463,35 @@ if (paramCallback != null) /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException if fails to make API call */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException if fails to make API call */ - public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { + public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -444,6 +505,7 @@ if (paramCallback != null) localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); @@ -454,16 +516,14 @@ if (enumHeaderString != null) localVarFormParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); -if (enumQueryDouble != null) - localVarFormParams.put("enum_query_double", enumQueryDouble); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -475,26 +535,26 @@ if (enumQueryDouble != null) /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public void testInlineAdditionalProperties(Object param) throws ApiException { + public void testInlineAdditionalProperties(String requestBody) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + testInlineAdditionalPropertiesWithHttpInfo(requestBody); } /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Object param) throws ApiException { - Object localVarPostBody = param; + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(String requestBody) throws ApiException { + Object localVarPostBody = requestBody; - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -576,7 +636,7 @@ if (param2 != null) final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); 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 4c15c19f414..d216d4cb7f1 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 @@ -38,27 +38,27 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClassname(Client body) throws ApiException { - return testClassnameWithHttpInfo(body).getData(); + public Client testClassname(Client client) throws ApiException { + return testClassnameWithHttpInfo(client).getData(); } /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); } // create path and map variables 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 e2cca5b3eec..9d75eb86f41 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 @@ -40,26 +40,26 @@ public class PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void addPet(Pet body) throws ApiException { + public void addPet(Pet pet) throws ApiException { - addPetWithHttpInfo(body); + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } // create path and map variables @@ -74,7 +74,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -130,7 +130,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -310,26 +310,26 @@ public class PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void updatePet(Pet body) throws ApiException { + public void updatePet(Pet pet) throws ApiException { - updatePetWithHttpInfo(body); + updatePetWithHttpInfo(pet); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } // create path and map variables @@ -344,7 +344,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -404,7 +404,7 @@ if (status != null) localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); 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 ede729d9540..c4a5249cce8 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 @@ -73,7 +73,7 @@ public class StoreApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -188,27 +188,27 @@ public class StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException if fails to make API call */ - public Order placeOrder(Order body) throws ApiException { - return placeOrderWithHttpInfo(body).getData(); + public Order placeOrder(Order order) throws ApiException { + return placeOrderWithHttpInfo(order).getData(); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException if fails to make API call */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + Object localVarPostBody = order; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } // create path and map variables 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 6535ce10427..0ba546adda3 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 @@ -38,26 +38,26 @@ public class UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException if fails to make API call */ - public void createUser(User body) throws ApiException { + public void createUser(User user) throws ApiException { - createUserWithHttpInfo(body); + createUserWithHttpInfo(user); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } // create path and map variables @@ -72,7 +72,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -89,26 +89,26 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithArrayInput(List body) throws ApiException { + public void createUsersWithArrayInput(List user) throws ApiException { - createUsersWithArrayInputWithHttpInfo(body); + createUsersWithArrayInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } // create path and map variables @@ -123,7 +123,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -140,26 +140,26 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithListInput(List body) throws ApiException { + public void createUsersWithListInput(List user) throws ApiException { - createUsersWithListInputWithHttpInfo(body); + createUsersWithListInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } // create path and map variables @@ -174,7 +174,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -226,7 +226,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -384,7 +384,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -402,32 +402,32 @@ public class UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException if fails to make API call */ - public void updateUser(String username, User body) throws ApiException { + public void updateUser(String username, User user) throws ApiException { - updateUserWithHttpInfo(username, body); + updateUserWithHttpInfo(username, user); } /** * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException if fails to make API call */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + Object localVarPostBody = user; // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables @@ -443,7 +443,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); 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 193d7f101db..2bb7dd17d43 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 @@ -67,6 +67,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -164,6 +204,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -229,6 +287,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -236,7 +295,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -246,6 +305,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 67879022f96..5f601300b95 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 @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -55,7 +56,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -223,7 +224,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -233,11 +234,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -331,7 +332,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -340,7 +341,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 38fb1481a3d..46fb5650ff0 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 @@ -78,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 a62db5e76e6..e12c1072478 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 @@ -37,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -85,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -106,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -123,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 209b4263f7e..3676b70365a 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 @@ -27,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -56,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -71,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/ApiClientTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/ApiClientTest.java deleted file mode 100644 index c8824547303..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/ApiClientTest.java +++ /dev/null @@ -1,250 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - } - - @Test - public void testParseAndFormatDate() { - // default date format - String dateStr = "2015-11-07T03:49:09.356Z"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); - - // custom date format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - dateStr = "2015-11-07T13:49:09+10:00"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - @Ignore("There is no more basic auth in petstore security definitions") - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPairs("csv", null, new Integer(1)); - List pairs_b = apiClient.parameterToPairs("csv", "", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - - // single empty string - List pairs = apiClient.parameterToPairs("csv", "param-a", " "); - assertEquals(1, pairs.size()); - - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPairs("csv", name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "\\|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - } - } -} diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/ConfigurationTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/ConfigurationTest.java deleted file mode 100644 index ccdf25feb30..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/ConfigurationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ConfigurationTest { - @Test - public void testDefaultApiClient() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); - assertFalse(apiClient.isDebugging()); - } -} diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/JSONTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/JSONTest.java deleted file mode 100644 index 2cce6e7ddd5..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/JSONTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.model.Order; -import org.junit.Before; -import org.junit.Test; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.format.DateTimeFormatter; - -import static org.junit.Assert.*; - - -public class JSONTest { - private JSON json = null; - private Order order = null; - - @Before - public void setup() { - json = new ApiClient().getJSON(); - order = new Order(); - } - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } - - @Test - public void testSqlDateSerialization() throws Exception { - String str = json.getContext(null).writeValueAsString(new java.sql.Date(10)); - assertEquals("\"1970-01-01\"", str); - } - - @Test - public void testSqlDateDeserialization() throws Exception { - final String str = "1970-01-01"; - java.sql.Date date = json.getContext(null).readValue("\"" + str + "\"", java.sql.Date.class); - assertEquals(date.toString(), str); - } - -} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/StringUtilTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/StringUtilTest.java deleted file mode 100644 index 4b03c7a9812..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/StringUtilTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); - } -} diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..0c06fbf57ca 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java index 0e4979b2906..7de631a091e 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,9 +16,11 @@ package io.swagger.client.api; import io.swagger.client.ApiException; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -46,8 +48,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -62,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -100,6 +102,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -110,8 +129,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -135,7 +154,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -155,15 +174,15 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } @@ -178,8 +197,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { - Object param = null; - api.testInlineAdditionalProperties(param); + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..7b603d245c1 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,15 +35,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/PetApiTest.java index 349a55d93dc..1801332c609 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/PetApiTest.java @@ -44,8 +44,8 @@ public class PetApiTest { */ @Test public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); + Pet pet = null; + api.addPet(pet); // TODO: test validations } @@ -125,8 +125,8 @@ public class PetApiTest { */ @Test public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); + Pet pet = null; + api.updatePet(pet); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/StoreApiTest.java index bef0884a2da..956978b470c 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -89,8 +89,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() throws ApiException { - Order body = null; - Order response = api.placeOrder(body); + Order order = null; + Order response = api.placeOrder(order); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/UserApiTest.java index 4455b3920b9..411e031d0d3 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/UserApiTest.java @@ -42,8 +42,8 @@ public class UserApiTest { */ @Test public void createUserTest() throws ApiException { - User body = null; - api.createUser(body); + User user = null; + api.createUser(user); // TODO: test validations } @@ -58,8 +58,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - api.createUsersWithArrayInput(body); + List user = null; + api.createUsersWithArrayInput(user); // TODO: test validations } @@ -74,8 +74,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() throws ApiException { - List body = null; - api.createUsersWithListInput(body); + List user = null; + api.createUsersWithListInput(user); // TODO: test validations } @@ -155,8 +155,8 @@ public class UserApiTest { @Test public void updateUserTest() throws ApiException { String username = null; - User body = null; - api.updateUser(username, body); + User user = null; + api.updateUser(username, user); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java deleted file mode 100644 index 5bdb4fb78fb..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header parameters - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } -} diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java deleted file mode 100644 index 52c5497ba83..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - } -} diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/model/EnumValueTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/model/EnumValueTest.java deleted file mode 100644 index e2ce8e1f1e5..00000000000 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/model/EnumValueTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package io.swagger.client.model; - -import org.junit.Test; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - try { - // test serialization (object => json) - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - ObjectWriter ow = mapper.writer(); - String json = ow.writeValueAsString(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); - - // test deserialization (json => object) - EnumTest fromString = mapper.readValue(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - - } catch (Exception e) { - fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); - } - } -} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator-ignore b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator-ignore +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md index cb9aa7a4531..f58e160b89e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-okhttp-gson +# petstore-okhttp-gson-parcelableModel Swagger Petstore - API version: 1.0.0 @@ -37,8 +37,8 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-okhttp-gson + org.openapitools + petstore-okhttp-gson-parcelableModel 1.0.0 compile @@ -49,7 +49,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-okhttp-gson:1.0.0" +compile "org.openapitools:petstore-okhttp-gson-parcelableModel:1.0.0" ``` ### Others @@ -62,7 +62,7 @@ mvn clean package Then manually install the following JARs: -* `target/swagger-petstore-okhttp-gson-1.0.0.jar` +* `target/petstore-okhttp-gson-parcelableModel-1.0.0.jar` * `target/lib/*.jar` ## Getting Started @@ -84,9 +84,9 @@ public class AnotherFakeApiExample { public static void main(String[] args) { AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -108,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -145,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -161,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 349c0805d9a..7825e6dbbd7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-okhttp-gson' + pom.artifactId = 'petstore-okhttp-gson-parcelableModel' } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index 957ff482292..f9c48d55eeb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-okhttp-gson", + organization := "org.openapitools", + name := "petstore-okhttp-gson-parcelableModel", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterBoolean.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterNumber.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterString.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 364994983a0..fab158949e6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-okhttp-gson + org.openapitools + petstore-okhttp-gson-parcelableModel jar - swagger-petstore-okhttp-gson + petstore-okhttp-gson-parcelableModel 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/settings.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/settings.gradle index b73eec84591..9c1a376207e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/settings.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-okhttp-gson" \ No newline at end of file +rootProject.name = "petstore-okhttp-gson-parcelableModel" \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java index 15ce43f658a..a518d2843d4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java @@ -60,7 +60,7 @@ public class JSON { classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "")); } }) ; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java index e8abc4b61d6..fd93c497926 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -56,14 +56,14 @@ public class AnotherFakeApi { /** * Build call for testSpecialTags - * @param body client model (required) + * @param client 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 testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; + public com.squareup.okhttp.Call testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; // create path and map variables String localVarPath = "/another-fake/dummy"; @@ -104,15 +104,15 @@ public class AnotherFakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testSpecialTags(Async)"); } - com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testSpecialTagsCall(client, progressListener, progressRequestListener); return call; } @@ -120,24 +120,24 @@ public class AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testSpecialTags(Client body) throws ApiException { - ApiResponse resp = testSpecialTagsWithHttpInfo(body); + public Client testSpecialTags(Client client) throws ApiException { + ApiResponse resp = testSpecialTagsWithHttpInfo(client); return resp.getData(); } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null); + public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +145,12 @@ public class AnotherFakeApi { /** * To test special tags (asynchronously) * To test special tags - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,7 +171,7 @@ public class AnotherFakeApi { }; } - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; 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 beb9cb1f8ff..78163633713 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 @@ -29,9 +29,11 @@ import java.io.IOException; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.lang.reflect.Type; import java.util.ArrayList; @@ -60,14 +62,14 @@ public class FakeApi { /** * Build call for fakeOuterBooleanSerialize - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (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 fakeOuterBooleanSerializeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; + public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean booleanPostBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = booleanPostBody; // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -80,7 +82,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -108,10 +110,10 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean booleanPostBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(booleanPostBody, progressListener, progressRequestListener); return call; } @@ -119,24 +121,24 @@ public class FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(body); + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws ApiException { + ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(booleanPostBody); return resp.getData(); } /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return ApiResponse<Boolean> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, null, null); + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean booleanPostBody) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(booleanPostBody, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -144,12 +146,12 @@ public class FakeApi { /** * (asynchronously) * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean booleanPostBody, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -170,21 +172,21 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(booleanPostBody, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /** * Build call for fakeOuterCompositeSerialize - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (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 fakeOuterCompositeSerializeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; + public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite outerComposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -197,7 +199,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -225,10 +227,10 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outerComposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(outerComposite, progressListener, progressRequestListener); return call; } @@ -236,24 +238,24 @@ public class FakeApi { /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(body); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(outerComposite); return resp.getData(); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, null, null); + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -261,12 +263,12 @@ public class FakeApi { /** * (asynchronously) * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite outerComposite, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -287,7 +289,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; @@ -314,7 +316,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -431,7 +433,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -527,15 +529,144 @@ public class FakeApi { return call; } /** - * Build call for testClientModel - * @param body client model (required) + * Build call for testBodyWithQueryParams + * @param query (required) + * @param user (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; + public com.squareup.okhttp.Call testBodyWithQueryParamsCall(String query, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (query != null) + localVarQueryParams.addAll(apiClient.parameterToPair("query", query)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call testBodyWithQueryParamsValidateBeforeCall(String query, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling testBodyWithQueryParams(Async)"); + } + + + com.squareup.okhttp.Call call = testBodyWithQueryParamsCall(query, user, progressListener, progressRequestListener); + return call; + + } + + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { + com.squareup.okhttp.Call call = testBodyWithQueryParamsValidateBeforeCall(query, user, null, null); + return apiClient.execute(call); + } + + /** + * (asynchronously) + * + * @param query (required) + * @param user (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call testBodyWithQueryParamsAsync(String query, User user, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = testBodyWithQueryParamsValidateBeforeCall(query, user, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for testClientModel + * @param client 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 client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; // create path and map variables String localVarPath = "/fake"; @@ -576,15 +707,15 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); } - com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClientModelCall(client, progressListener, progressRequestListener); return call; } @@ -592,24 +723,24 @@ public class FakeApi { /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testClientModel(Client body) throws ApiException { - ApiResponse resp = testClientModelWithHttpInfo(body); + public Client testClientModel(Client client) throws ApiException { + ApiResponse resp = testClientModelWithHttpInfo(client); return resp.getData(); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, null, null); + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -617,12 +748,12 @@ public class FakeApi { /** * To test \"client\" model (asynchronously) * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testClientModelAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClientModelAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -643,7 +774,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; @@ -669,7 +800,7 @@ public class FakeApi { * @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 { + public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File 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 @@ -711,13 +842,13 @@ public class FakeApi { localVarFormParams.put("callback", paramCallback); final String[] localVarAccepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -739,7 +870,7 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(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 { + private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'number' is set if (number == null) { @@ -786,7 +917,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -810,7 +941,7 @@ public class FakeApi { * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null); return apiClient.execute(call); } @@ -836,7 +967,7 @@ public class FakeApi { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testEndpointParametersAsync(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 ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -863,20 +994,20 @@ public class FakeApi { } /** * 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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (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 { + public com.squareup.okhttp.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -890,6 +1021,8 @@ public class FakeApi { localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string", enumQueryString)); if (enumQueryInteger != null) localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_integer", enumQueryInteger)); + if (enumQueryDouble != null) + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_double", enumQueryDouble)); Map localVarHeaderParams = new HashMap(); if (enumHeaderStringArray != null) @@ -902,17 +1035,15 @@ public class FakeApi { localVarFormParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); - if (enumQueryDouble != null) - localVarFormParams.put("enum_query_double", enumQueryDouble); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -934,10 +1065,10 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(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 { + private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, progressListener, progressRequestListener); return call; } @@ -945,55 +1076,55 @@ public class FakeApi { /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null); + public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null, null); return apiClient.execute(call); } /** * To test enum parameters (asynchronously) * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testEnumParametersAsync(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEnumParametersAsync(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1014,20 +1145,20 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } /** * Build call for testInlineAdditionalProperties - * @param param request body (required) + * @param requestBody request body (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 testInlineAdditionalPropertiesCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = param; + public com.squareup.okhttp.Call testInlineAdditionalPropertiesCall(String requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = requestBody; // create path and map variables String localVarPath = "/fake/inline-additionalProperties"; @@ -1068,15 +1199,15 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(String requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testInlineAdditionalProperties(Async)"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties(Async)"); } - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(param, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(requestBody, progressListener, progressRequestListener); return call; } @@ -1084,34 +1215,34 @@ public class FakeApi { /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + public void testInlineAdditionalProperties(String requestBody) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody); } /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Object param) throws ApiException { - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, null, null); + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(String requestBody) throws ApiException { + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, null, null); return apiClient.execute(call); } /** * test inline additionalProperties (asynchronously) * - * @param param request body (required) + * @param requestBody request body (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(Object param, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(String requestBody, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1132,7 +1263,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -1169,7 +1300,7 @@ public class FakeApi { if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); 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 e8114ca34ca..0c79cb50054 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 @@ -56,14 +56,14 @@ public class FakeClassnameTags123Api { /** * Build call for testClassname - * @param body client model (required) + * @param client 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; + public com.squareup.okhttp.Call testClassnameCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; // create path and map variables String localVarPath = "/fake_classname_test"; @@ -104,15 +104,15 @@ public class FakeClassnameTags123Api { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); } - com.squareup.okhttp.Call call = testClassnameCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClassnameCall(client, progressListener, progressRequestListener); return call; } @@ -120,24 +120,24 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testClassname(Client body) throws ApiException { - ApiResponse resp = testClassnameWithHttpInfo(body); + public Client testClassname(Client client) throws ApiException { + ApiResponse resp = testClassnameWithHttpInfo(client); return resp.getData(); } /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, null, null); + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +145,12 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case (asynchronously) * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testClassnameAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClassnameAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,7 +171,7 @@ public class FakeClassnameTags123Api { }; } - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; 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 23b9049e61b..2b7fc10c85f 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 @@ -58,14 +58,14 @@ public class PetApi { /** * Build call for addPet - * @param body Pet object that needs to be added to the store (required) + * @param pet 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; + public com.squareup.okhttp.Call addPetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; // create path and map variables String localVarPath = "/pet"; @@ -78,7 +78,7 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -106,15 +106,15 @@ public class PetApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); } - com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = addPetCall(pet, progressListener, progressRequestListener); return call; } @@ -122,34 +122,34 @@ public class PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void addPet(Pet body) throws ApiException { - addPetWithHttpInfo(body); + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, null, null); + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Add a new pet to the store (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call addPetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call addPetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -170,7 +170,7 @@ public class PetApi { }; } - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -200,7 +200,7 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -681,14 +681,14 @@ public class PetApi { } /** * Build call for updatePet - * @param body Pet object that needs to be added to the store (required) + * @param pet 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; + public com.squareup.okhttp.Call updatePetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; // create path and map variables String localVarPath = "/pet"; @@ -701,7 +701,7 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -729,15 +729,15 @@ public class PetApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); } - com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetCall(pet, progressListener, progressRequestListener); return call; } @@ -745,34 +745,34 @@ public class PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void updatePet(Pet body) throws ApiException { - updatePetWithHttpInfo(body); + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, null, null); + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Update an existing pet (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call updatePetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updatePetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -793,7 +793,7 @@ public class PetApi { }; } - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -826,7 +826,7 @@ public class PetApi { localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); 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 a517a459d79..5231b503130 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 @@ -77,7 +77,7 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -411,14 +411,14 @@ public class StoreApi { } /** * Build call for placeOrder - * @param body order placed for purchasing the pet (required) + * @param order 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; + public com.squareup.okhttp.Call placeOrderCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = order; // create path and map variables String localVarPath = "/store/order"; @@ -459,15 +459,15 @@ public class StoreApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); } - com.squareup.okhttp.Call call = placeOrderCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = placeOrderCall(order, progressListener, progressRequestListener); return call; } @@ -475,24 +475,24 @@ public class StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Order placeOrder(Order body) throws ApiException { - ApiResponse resp = placeOrderWithHttpInfo(body); + public Order placeOrder(Order order) throws ApiException { + ApiResponse resp = placeOrderWithHttpInfo(order); return resp.getData(); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, null, null); + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -500,12 +500,12 @@ public class StoreApi { /** * Place an order for a pet (asynchronously) * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call placeOrderAsync(Order body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call placeOrderAsync(Order order, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -526,7 +526,7 @@ public class StoreApi { }; } - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; 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 518d851e31a..65136e786dc 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 @@ -56,14 +56,14 @@ public class UserApi { /** * Build call for createUser - * @param body Created user object (required) + * @param user 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; + public com.squareup.okhttp.Call createUserCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user"; @@ -76,7 +76,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -104,15 +104,15 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUserValidateBeforeCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUserValidateBeforeCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - com.squareup.okhttp.Call call = createUserCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUserCall(user, progressListener, progressRequestListener); return call; } @@ -120,34 +120,34 @@ public class UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void createUser(User body) throws ApiException { - createUserWithHttpInfo(body); + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, null, null); + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Create user (asynchronously) * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createUserAsync(User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUserAsync(User user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -168,20 +168,20 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } /** * Build call for createUsersWithArrayInput - * @param body List of user object (required) + * @param user 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; + public com.squareup.okhttp.Call createUsersWithArrayInputCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/createWithArray"; @@ -194,7 +194,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -222,15 +222,15 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)"); } - com.squareup.okhttp.Call call = createUsersWithArrayInputCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithArrayInputCall(user, progressListener, progressRequestListener); return call; } @@ -238,34 +238,34 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void createUsersWithArrayInput(List body) throws ApiException { - createUsersWithArrayInputWithHttpInfo(body); + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, null, null); + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Creates list of users with given input array (asynchronously) * - * @param body List of user object (required) + * @param user List of user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createUsersWithArrayInputAsync(List body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUsersWithArrayInputAsync(List user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -286,20 +286,20 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } /** * Build call for createUsersWithListInput - * @param body List of user object (required) + * @param user 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; + public com.squareup.okhttp.Call createUsersWithListInputCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/createWithList"; @@ -312,7 +312,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -340,15 +340,15 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)"); } - com.squareup.okhttp.Call call = createUsersWithListInputCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithListInputCall(user, progressListener, progressRequestListener); return call; } @@ -356,34 +356,34 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void createUsersWithListInput(List body) throws ApiException { - createUsersWithListInputWithHttpInfo(body); + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, null, null); + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Creates list of users with given input array (asynchronously) * - * @param body List of user object (required) + * @param user List of user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createUsersWithListInputAsync(List body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUsersWithListInputAsync(List user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -404,7 +404,7 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -431,7 +431,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -806,7 +806,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -897,14 +897,14 @@ public class UserApi { /** * Build call for updateUser * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user 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; + public com.squareup.okhttp.Call updateUserCall(String username, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/{username}" @@ -918,7 +918,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -946,20 +946,20 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updateUserValidateBeforeCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updateUserValidateBeforeCall(String username, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); } - com.squareup.okhttp.Call call = updateUserCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserCall(username, user, progressListener, progressRequestListener); return call; } @@ -968,23 +968,23 @@ public class UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void updateUser(String username, User body) throws ApiException { - updateUserWithHttpInfo(username, body); + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); } /** * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, null, null); + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, user, null, null); return apiClient.execute(call); } @@ -992,12 +992,12 @@ public class UserApi { * Updated user (asynchronously) * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call updateUserAsync(String username, User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updateUserAsync(String username, User user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1018,7 +1018,7 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } 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 4363f4015fd..bf331ec1d89 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 @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; @@ -60,7 +61,7 @@ public class FormatTest implements Parcelable { private byte[] _byte = null; @SerializedName("binary") - private byte[] binary = null; + private File binary = null; @SerializedName("date") private LocalDate date = null; @@ -230,7 +231,7 @@ public class FormatTest implements Parcelable { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -240,11 +241,11 @@ public class FormatTest implements Parcelable { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -338,7 +339,7 @@ public class FormatTest implements Parcelable { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -347,7 +348,7 @@ public class FormatTest implements Parcelable { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } @@ -410,7 +411,7 @@ public class FormatTest implements Parcelable { _double = (Double)in.readValue(null); string = (String)in.readValue(null); _byte = (byte[])in.readValue(null); - binary = (byte[])in.readValue(null); + binary = (File)in.readValue(File.class.getClassLoader()); date = (LocalDate)in.readValue(LocalDate.class.getClassLoader()); dateTime = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader()); uuid = (UUID)in.readValue(UUID.class.getClassLoader()); 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 4ea40d8f1f2..73a18984f4c 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 @@ -85,9 +85,9 @@ public class Model200Response implements Parcelable { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 7c79b8abda4..453c178a575 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 @@ -42,7 +42,7 @@ public class Name implements Parcelable { private String property = null; @SerializedName("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name() { } @@ -92,12 +92,12 @@ public class Name implements Parcelable { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -113,12 +113,12 @@ public class Name implements Parcelable { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -130,7 +130,7 @@ public class Name implements Parcelable { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } @@ -151,14 +151,14 @@ public class Name implements Parcelable { out.writeValue(name); out.writeValue(snakeCase); out.writeValue(property); - out.writeValue(_123Number); + out.writeValue(_123number); } Name(Parcel in) { name = (Integer)in.readValue(null); snakeCase = (Integer)in.readValue(null); property = (String)in.readValue(null); - _123Number = (Integer)in.readValue(null); + _123number = (Integer)in.readValue(null); } public int describeContents() { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..b60bb5043a5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,86 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * OuterBoolean + */ + +public class OuterBoolean implements Parcelable { + public OuterBoolean() { + } + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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 "); + } + + + public void writeToParcel(Parcel out, int flags) { + } + + OuterBoolean(Parcel in) { + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public OuterBoolean createFromParcel(Parcel in) { + return new OuterBoolean(in); + } + public OuterBoolean[] newArray(int size) { + return new OuterBoolean[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..b4c83711b70 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,86 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * OuterNumber + */ + +public class OuterNumber implements Parcelable { + public OuterNumber() { + } + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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 "); + } + + + public void writeToParcel(Parcel out, int flags) { + } + + OuterNumber(Parcel in) { + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public OuterNumber createFromParcel(Parcel in) { + return new OuterNumber(in); + } + public OuterNumber[] newArray(int size) { + return new OuterNumber[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..0acc187bd31 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,86 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * OuterString + */ + +public class OuterString implements Parcelable { + public OuterString() { + } + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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 "); + } + + + public void writeToParcel(Parcel out, int flags) { + } + + OuterString(Parcel in) { + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public OuterString createFromParcel(Parcel in) { + return new OuterString(in); + } + public OuterString[] newArray(int size) { + return new OuterString[size]; + } + }; +} + 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 ea63befdee2..a0906040dea 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 @@ -32,26 +32,26 @@ import android.os.Parcel; public class SpecialModelName implements Parcelable { @SerializedName("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; public SpecialModelName() { } - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -63,13 +63,13 @@ public class SpecialModelName implements Parcelable { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -78,7 +78,7 @@ public class SpecialModelName implements Parcelable { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -96,11 +96,11 @@ public class SpecialModelName implements Parcelable { public void writeToParcel(Parcel out, int flags) { - out.writeValue(specialPropertyName); + out.writeValue($specialPropertyName); } SpecialModelName(Parcel in) { - specialPropertyName = (Long)in.readValue(null); + $specialPropertyName = (Long)in.readValue(null); } public int describeContents() { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..0c06fbf57ca 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java index 0e4979b2906..7de631a091e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,9 +16,11 @@ package io.swagger.client.api; import io.swagger.client.ApiException; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -46,8 +48,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -62,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -100,6 +102,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -110,8 +129,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -135,7 +154,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -155,15 +174,15 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } @@ -178,8 +197,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { - Object param = null; - api.testInlineAdditionalProperties(param); + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 06147652aad..7b603d245c1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -42,8 +42,8 @@ public class FakeClassnameTags123ApiTest { */ @Test public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java index 349a55d93dc..1801332c609 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java @@ -44,8 +44,8 @@ public class PetApiTest { */ @Test public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); + Pet pet = null; + api.addPet(pet); // TODO: test validations } @@ -125,8 +125,8 @@ public class PetApiTest { */ @Test public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); + Pet pet = null; + api.updatePet(pet); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java index bef0884a2da..956978b470c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -89,8 +89,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() throws ApiException { - Order body = null; - Order response = api.placeOrder(body); + Order order = null; + Order response = api.placeOrder(order); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java index 4455b3920b9..411e031d0d3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java @@ -42,8 +42,8 @@ public class UserApiTest { */ @Test public void createUserTest() throws ApiException { - User body = null; - api.createUser(body); + User user = null; + api.createUser(user); // TODO: test validations } @@ -58,8 +58,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - api.createUsersWithArrayInput(body); + List user = null; + api.createUsersWithArrayInput(user); // TODO: test validations } @@ -74,8 +74,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() throws ApiException { - List body = null; - api.createUsersWithListInput(body); + List user = null; + api.createUsersWithListInput(user); // TODO: test validations } @@ -155,8 +155,8 @@ public class UserApiTest { @Test public void updateUserTest() throws ApiException { String username = null; - User body = null; - api.updateUser(username, body); + User user = null; + api.updateUser(username, user); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore b/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index cb9aa7a4531..bc69f75d4c7 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-okhttp-gson +# petstore-okhttp-gson Swagger Petstore - API version: 1.0.0 @@ -37,8 +37,8 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-okhttp-gson + org.openapitools + petstore-okhttp-gson 1.0.0 compile @@ -49,7 +49,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-okhttp-gson:1.0.0" +compile "org.openapitools:petstore-okhttp-gson:1.0.0" ``` ### Others @@ -62,7 +62,7 @@ mvn clean package Then manually install the following JARs: -* `target/swagger-petstore-okhttp-gson-1.0.0.jar` +* `target/petstore-okhttp-gson-1.0.0.jar` * `target/lib/*.jar` ## Getting Started @@ -84,9 +84,9 @@ public class AnotherFakeApiExample { public static void main(String[] args) { AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -108,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -145,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -161,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 349c0805d9a..df65ade70d1 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-okhttp-gson' + pom.artifactId = 'petstore-okhttp-gson' } } diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index 957ff482292..d7dc9adb619 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-okhttp-gson", + organization := "org.openapitools", + name := "petstore-okhttp-gson", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/Name.md b/samples/client/petstore/java/okhttp-gson/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Name.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/OuterBoolean.md b/samples/client/petstore/java/okhttp-gson/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/OuterNumber.md b/samples/client/petstore/java/okhttp-gson/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/OuterString.md b/samples/client/petstore/java/okhttp-gson/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md +++ b/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index 1fcb1aa43b2..6dccf4ac0e7 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-okhttp-gson + org.openapitools + petstore-okhttp-gson jar - swagger-petstore-okhttp-gson + petstore-okhttp-gson 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/okhttp-gson/settings.gradle b/samples/client/petstore/java/okhttp-gson/settings.gradle index b73eec84591..3e4b819a481 100644 --- a/samples/client/petstore/java/okhttp-gson/settings.gradle +++ b/samples/client/petstore/java/okhttp-gson/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-okhttp-gson" \ No newline at end of file +rootProject.name = "petstore-okhttp-gson" \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java index 15ce43f658a..a518d2843d4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java @@ -60,7 +60,7 @@ public class JSON { classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "")); } }) ; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java index e8abc4b61d6..fd93c497926 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -56,14 +56,14 @@ public class AnotherFakeApi { /** * Build call for testSpecialTags - * @param body client model (required) + * @param client 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 testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; + public com.squareup.okhttp.Call testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; // create path and map variables String localVarPath = "/another-fake/dummy"; @@ -104,15 +104,15 @@ public class AnotherFakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testSpecialTags(Async)"); } - com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testSpecialTagsCall(client, progressListener, progressRequestListener); return call; } @@ -120,24 +120,24 @@ public class AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testSpecialTags(Client body) throws ApiException { - ApiResponse resp = testSpecialTagsWithHttpInfo(body); + public Client testSpecialTags(Client client) throws ApiException { + ApiResponse resp = testSpecialTagsWithHttpInfo(client); return resp.getData(); } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null); + public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +145,12 @@ public class AnotherFakeApi { /** * To test special tags (asynchronously) * To test special tags - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,7 +171,7 @@ public class AnotherFakeApi { }; } - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; 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 beb9cb1f8ff..78163633713 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 @@ -29,9 +29,11 @@ import java.io.IOException; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.lang.reflect.Type; import java.util.ArrayList; @@ -60,14 +62,14 @@ public class FakeApi { /** * Build call for fakeOuterBooleanSerialize - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (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 fakeOuterBooleanSerializeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; + public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean booleanPostBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = booleanPostBody; // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -80,7 +82,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -108,10 +110,10 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean booleanPostBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(booleanPostBody, progressListener, progressRequestListener); return call; } @@ -119,24 +121,24 @@ public class FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(body); + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws ApiException { + ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(booleanPostBody); return resp.getData(); } /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return ApiResponse<Boolean> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, null, null); + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean booleanPostBody) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(booleanPostBody, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -144,12 +146,12 @@ public class FakeApi { /** * (asynchronously) * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean booleanPostBody, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -170,21 +172,21 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(booleanPostBody, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /** * Build call for fakeOuterCompositeSerialize - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (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 fakeOuterCompositeSerializeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; + public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite outerComposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -197,7 +199,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -225,10 +227,10 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outerComposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(outerComposite, progressListener, progressRequestListener); return call; } @@ -236,24 +238,24 @@ public class FakeApi { /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(body); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(outerComposite); return resp.getData(); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, null, null); + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -261,12 +263,12 @@ public class FakeApi { /** * (asynchronously) * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite outerComposite, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -287,7 +289,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; @@ -314,7 +316,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -431,7 +433,7 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -527,15 +529,144 @@ public class FakeApi { return call; } /** - * Build call for testClientModel - * @param body client model (required) + * Build call for testBodyWithQueryParams + * @param query (required) + * @param user (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; + public com.squareup.okhttp.Call testBodyWithQueryParamsCall(String query, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (query != null) + localVarQueryParams.addAll(apiClient.parameterToPair("query", query)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call testBodyWithQueryParamsValidateBeforeCall(String query, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling testBodyWithQueryParams(Async)"); + } + + + com.squareup.okhttp.Call call = testBodyWithQueryParamsCall(query, user, progressListener, progressRequestListener); + return call; + + } + + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { + com.squareup.okhttp.Call call = testBodyWithQueryParamsValidateBeforeCall(query, user, null, null); + return apiClient.execute(call); + } + + /** + * (asynchronously) + * + * @param query (required) + * @param user (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call testBodyWithQueryParamsAsync(String query, User user, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = testBodyWithQueryParamsValidateBeforeCall(query, user, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for testClientModel + * @param client 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 client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; // create path and map variables String localVarPath = "/fake"; @@ -576,15 +707,15 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); } - com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClientModelCall(client, progressListener, progressRequestListener); return call; } @@ -592,24 +723,24 @@ public class FakeApi { /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testClientModel(Client body) throws ApiException { - ApiResponse resp = testClientModelWithHttpInfo(body); + public Client testClientModel(Client client) throws ApiException { + ApiResponse resp = testClientModelWithHttpInfo(client); return resp.getData(); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, null, null); + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -617,12 +748,12 @@ public class FakeApi { /** * To test \"client\" model (asynchronously) * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testClientModelAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClientModelAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -643,7 +774,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; @@ -669,7 +800,7 @@ public class FakeApi { * @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 { + public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File 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 @@ -711,13 +842,13 @@ public class FakeApi { localVarFormParams.put("callback", paramCallback); final String[] localVarAccepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -739,7 +870,7 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(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 { + private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'number' is set if (number == null) { @@ -786,7 +917,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -810,7 +941,7 @@ public class FakeApi { * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null); return apiClient.execute(call); } @@ -836,7 +967,7 @@ public class FakeApi { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testEndpointParametersAsync(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 ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -863,20 +994,20 @@ public class FakeApi { } /** * 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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (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 { + public com.squareup.okhttp.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -890,6 +1021,8 @@ public class FakeApi { localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string", enumQueryString)); if (enumQueryInteger != null) localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_integer", enumQueryInteger)); + if (enumQueryDouble != null) + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_double", enumQueryDouble)); Map localVarHeaderParams = new HashMap(); if (enumHeaderStringArray != null) @@ -902,17 +1035,15 @@ public class FakeApi { localVarFormParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); - if (enumQueryDouble != null) - localVarFormParams.put("enum_query_double", enumQueryDouble); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -934,10 +1065,10 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(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 { + private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, progressListener, progressRequestListener); return call; } @@ -945,55 +1076,55 @@ public class FakeApi { /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null); + public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null, null); return apiClient.execute(call); } /** * To test enum parameters (asynchronously) * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testEnumParametersAsync(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEnumParametersAsync(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1014,20 +1145,20 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } /** * Build call for testInlineAdditionalProperties - * @param param request body (required) + * @param requestBody request body (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 testInlineAdditionalPropertiesCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = param; + public com.squareup.okhttp.Call testInlineAdditionalPropertiesCall(String requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = requestBody; // create path and map variables String localVarPath = "/fake/inline-additionalProperties"; @@ -1068,15 +1199,15 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(String requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testInlineAdditionalProperties(Async)"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties(Async)"); } - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(param, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(requestBody, progressListener, progressRequestListener); return call; } @@ -1084,34 +1215,34 @@ public class FakeApi { /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + public void testInlineAdditionalProperties(String requestBody) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody); } /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Object param) throws ApiException { - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, null, null); + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(String requestBody) throws ApiException { + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, null, null); return apiClient.execute(call); } /** * test inline additionalProperties (asynchronously) * - * @param param request body (required) + * @param requestBody request body (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(Object param, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(String requestBody, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1132,7 +1263,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -1169,7 +1300,7 @@ public class FakeApi { if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); 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 e8114ca34ca..0c79cb50054 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 @@ -56,14 +56,14 @@ public class FakeClassnameTags123Api { /** * Build call for testClassname - * @param body client model (required) + * @param client 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; + public com.squareup.okhttp.Call testClassnameCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; // create path and map variables String localVarPath = "/fake_classname_test"; @@ -104,15 +104,15 @@ public class FakeClassnameTags123Api { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); } - com.squareup.okhttp.Call call = testClassnameCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClassnameCall(client, progressListener, progressRequestListener); return call; } @@ -120,24 +120,24 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testClassname(Client body) throws ApiException { - ApiResponse resp = testClassnameWithHttpInfo(body); + public Client testClassname(Client client) throws ApiException { + ApiResponse resp = testClassnameWithHttpInfo(client); return resp.getData(); } /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, null, null); + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +145,12 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case (asynchronously) * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testClassnameAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClassnameAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,7 +171,7 @@ public class FakeClassnameTags123Api { }; } - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; 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 23b9049e61b..2b7fc10c85f 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 @@ -58,14 +58,14 @@ public class PetApi { /** * Build call for addPet - * @param body Pet object that needs to be added to the store (required) + * @param pet 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; + public com.squareup.okhttp.Call addPetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; // create path and map variables String localVarPath = "/pet"; @@ -78,7 +78,7 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -106,15 +106,15 @@ public class PetApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); } - com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = addPetCall(pet, progressListener, progressRequestListener); return call; } @@ -122,34 +122,34 @@ public class PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void addPet(Pet body) throws ApiException { - addPetWithHttpInfo(body); + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, null, null); + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Add a new pet to the store (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call addPetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call addPetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -170,7 +170,7 @@ public class PetApi { }; } - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -200,7 +200,7 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -681,14 +681,14 @@ public class PetApi { } /** * Build call for updatePet - * @param body Pet object that needs to be added to the store (required) + * @param pet 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; + public com.squareup.okhttp.Call updatePetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; // create path and map variables String localVarPath = "/pet"; @@ -701,7 +701,7 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -729,15 +729,15 @@ public class PetApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); } - com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetCall(pet, progressListener, progressRequestListener); return call; } @@ -745,34 +745,34 @@ public class PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void updatePet(Pet body) throws ApiException { - updatePetWithHttpInfo(body); + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, null, null); + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Update an existing pet (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call updatePetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updatePetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -793,7 +793,7 @@ public class PetApi { }; } - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -826,7 +826,7 @@ public class PetApi { localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); 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 a517a459d79..5231b503130 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 @@ -77,7 +77,7 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -411,14 +411,14 @@ public class StoreApi { } /** * Build call for placeOrder - * @param body order placed for purchasing the pet (required) + * @param order 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; + public com.squareup.okhttp.Call placeOrderCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = order; // create path and map variables String localVarPath = "/store/order"; @@ -459,15 +459,15 @@ public class StoreApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); } - com.squareup.okhttp.Call call = placeOrderCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = placeOrderCall(order, progressListener, progressRequestListener); return call; } @@ -475,24 +475,24 @@ public class StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Order placeOrder(Order body) throws ApiException { - ApiResponse resp = placeOrderWithHttpInfo(body); + public Order placeOrder(Order order) throws ApiException { + ApiResponse resp = placeOrderWithHttpInfo(order); return resp.getData(); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, null, null); + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -500,12 +500,12 @@ public class StoreApi { /** * Place an order for a pet (asynchronously) * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call placeOrderAsync(Order body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call placeOrderAsync(Order order, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -526,7 +526,7 @@ public class StoreApi { }; } - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; 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 518d851e31a..65136e786dc 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 @@ -56,14 +56,14 @@ public class UserApi { /** * Build call for createUser - * @param body Created user object (required) + * @param user 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; + public com.squareup.okhttp.Call createUserCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user"; @@ -76,7 +76,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -104,15 +104,15 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUserValidateBeforeCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUserValidateBeforeCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - com.squareup.okhttp.Call call = createUserCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUserCall(user, progressListener, progressRequestListener); return call; } @@ -120,34 +120,34 @@ public class UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void createUser(User body) throws ApiException { - createUserWithHttpInfo(body); + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, null, null); + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Create user (asynchronously) * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createUserAsync(User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUserAsync(User user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -168,20 +168,20 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } /** * Build call for createUsersWithArrayInput - * @param body List of user object (required) + * @param user 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; + public com.squareup.okhttp.Call createUsersWithArrayInputCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/createWithArray"; @@ -194,7 +194,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -222,15 +222,15 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)"); } - com.squareup.okhttp.Call call = createUsersWithArrayInputCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithArrayInputCall(user, progressListener, progressRequestListener); return call; } @@ -238,34 +238,34 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void createUsersWithArrayInput(List body) throws ApiException { - createUsersWithArrayInputWithHttpInfo(body); + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, null, null); + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Creates list of users with given input array (asynchronously) * - * @param body List of user object (required) + * @param user List of user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createUsersWithArrayInputAsync(List body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUsersWithArrayInputAsync(List user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -286,20 +286,20 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } /** * Build call for createUsersWithListInput - * @param body List of user object (required) + * @param user 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; + public com.squareup.okhttp.Call createUsersWithListInputCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/createWithList"; @@ -312,7 +312,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -340,15 +340,15 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)"); } - com.squareup.okhttp.Call call = createUsersWithListInputCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithListInputCall(user, progressListener, progressRequestListener); return call; } @@ -356,34 +356,34 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void createUsersWithListInput(List body) throws ApiException { - createUsersWithListInputWithHttpInfo(body); + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, null, null); + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Creates list of users with given input array (asynchronously) * - * @param body List of user object (required) + * @param user List of user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call createUsersWithListInputAsync(List body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUsersWithListInputAsync(List user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -404,7 +404,7 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } @@ -431,7 +431,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -806,7 +806,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -897,14 +897,14 @@ public class UserApi { /** * Build call for updateUser * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user 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; + public com.squareup.okhttp.Call updateUserCall(String username, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/{username}" @@ -918,7 +918,7 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -946,20 +946,20 @@ public class UserApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updateUserValidateBeforeCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updateUserValidateBeforeCall(String username, User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); } - com.squareup.okhttp.Call call = updateUserCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserCall(username, user, progressListener, progressRequestListener); return call; } @@ -968,23 +968,23 @@ public class UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public void updateUser(String username, User body) throws ApiException { - updateUserWithHttpInfo(username, body); + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); } /** * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, null, null); + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, user, null, null); return apiClient.execute(call); } @@ -992,12 +992,12 @@ public class UserApi { * Updated user (asynchronously) * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call updateUserAsync(String username, User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updateUserAsync(String username, User user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1018,7 +1018,7 @@ public class UserApi { }; } - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } 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 a572c0d6b5b..7a1b9c32152 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 @@ -82,6 +82,58 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + @JsonAdapter(EnumStringRequiredEnum.Adapter.class) + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringRequiredEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -203,6 +255,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -268,6 +338,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -275,7 +346,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -285,6 +356,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 3223d766753..24ce7363eac 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 @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; @@ -58,7 +59,7 @@ public class FormatTest { private byte[] _byte = null; @SerializedName("binary") - private byte[] binary = null; + private File binary = null; @SerializedName("date") private LocalDate date = null; @@ -226,7 +227,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -236,11 +237,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -334,7 +335,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -343,7 +344,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 1bcc6ac44bf..28c5997ded5 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 @@ -81,9 +81,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 f6a3f8f4195..a7b129c2a4d 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 @@ -40,7 +40,7 @@ public class Name { private String property = null; @SerializedName("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 9c0a4477a04..185b853dce9 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 @@ -30,24 +30,24 @@ import java.io.IOException; public class SpecialModelName { @SerializedName("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -59,13 +59,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -74,7 +74,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ApiClientTest.java deleted file mode 100644 index e793075224b..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ApiClientTest.java +++ /dev/null @@ -1,330 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.TimeZone; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient; - JSON json; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - - assertTrue(apiClient.isJsonMime("application/json-patch+json")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - /* - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - */ - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testGetAndSetConnectTimeout() { - // connect timeout defaults to 10 seconds - assertEquals(10000, apiClient.getConnectTimeout()); - assertEquals(10000, apiClient.getHttpClient().getConnectTimeout()); - - apiClient.setConnectTimeout(0); - assertEquals(0, apiClient.getConnectTimeout()); - assertEquals(0, apiClient.getHttpClient().getConnectTimeout()); - - apiClient.setConnectTimeout(10000); - } - - @Test - public void testGetAndSetReadTimeout() { - // read timeout defaults to 10 seconds - assertEquals(10000, apiClient.getReadTimeout()); - assertEquals(10000, apiClient.getHttpClient().getReadTimeout()); - - apiClient.setReadTimeout(0); - assertEquals(0, apiClient.getReadTimeout()); - assertEquals(0, apiClient.getHttpClient().getReadTimeout()); - - apiClient.setReadTimeout(10000); - } - - @Test - public void testGetAndSetWriteTimeout() { - // write timeout defaults to 10 seconds - assertEquals(10000, apiClient.getWriteTimeout()); - assertEquals(10000, apiClient.getHttpClient().getWriteTimeout()); - - apiClient.setWriteTimeout(0); - assertEquals(0, apiClient.getWriteTimeout()); - assertEquals(0, apiClient.getHttpClient().getWriteTimeout()); - - apiClient.setWriteTimeout(10000); - } - - @Test - public void testParameterToPairWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPair(null, new Integer(1)); - List pairs_b = apiClient.parameterToPair("", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPair("param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsEmptyString() throws Exception { - // single empty string - List pairs = apiClient.parameterToPair("param-a", " "); - assertEquals(1, pairs.size()); - } - - @Test - public void testParameterToPairWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPair(name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairWhenValueIsCollection() throws Exception { - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - List pairs = apiClient.parameterToPair("param-a", values); - assertEquals(0, pairs.size()); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List objects = new ArrayList(); - objects.add(new Integer(1)); - - List pairs_a = apiClient.parameterToPairs("csv", null, objects); - List pairs_b = apiClient.parameterToPairs("csv", "", objects); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); - } - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - if (!delimiter.equals(",")) { - // commas are not escaped because they are reserved characters in URIs - delimiter = apiClient.escapeString(delimiter); - } - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); - } - } - } - - @Test - public void testSanitizeFilename() { - assertEquals("sun", apiClient.sanitizeFilename("sun")); - assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ConfigurationTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ConfigurationTest.java deleted file mode 100644 index ccdf25feb30..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ConfigurationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ConfigurationTest { - @Test - public void testDefaultApiClient() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); - assertFalse(apiClient.isDebugging()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/JSONTest.java deleted file mode 100644 index a3fefc96895..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/JSONTest.java +++ /dev/null @@ -1,201 +0,0 @@ -package io.swagger.client; - -import com.google.gson.reflect.TypeToken; - -import io.swagger.client.model.Order; - -import java.lang.Exception; -import java.lang.reflect.Type; -import java.nio.charset.StandardCharsets; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -import okio.ByteString; -import org.junit.*; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; - -import static org.junit.Assert.*; - -public class JSONTest { - private ApiClient apiClient = null; - private JSON json = null; - private Order order = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - order = new Order(); - } - - @Test - public void testSqlDateTypeAdapter() { - final String str = "\"2015-11-07\""; - final java.sql.Date date = java.sql.Date.valueOf("2015-11-07"); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, java.sql.Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", java.sql.Date.class).toString(), date.toString()); - - // custom date format: without day - DateFormat format = new SimpleDateFormat("yyyy-MM"); - apiClient.setSqlDateFormat(format); - String dateStr = "\"2015-11\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); - } - - @Test - public void testDateTypeAdapter() { - Calendar cal = new GregorianCalendar(2015, 10, 7, 3, 49, 9); - cal.setTimeZone(TimeZone.getTimeZone("UTC")); - - assertEquals(json.deserialize("\"2015-11-07T05:49:09+02\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 300); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.3Z\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 356); - Date date = cal.getTime(); - - final String utcDate = "\"2015-11-07T03:49:09.356Z\""; - assertEquals(json.deserialize(utcDate, Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T05:49:09.356+02:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-01:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356Z\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-0100\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356456789Z\"", Date.class), date); - - assertEquals(utcDate, json.serialize(date)); - - // custom datetime format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - - String dateStr = "\"2015-11-07T13:49:09+10:00\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); - - try { - // invalid time zone format - json.deserialize("\"2015-11-07T03:49:09+00\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - try { - // unexpected miliseconds - json.deserialize("\"2015-11-07T03:49:09.000Z\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - - } - - @Test - public void testOffsetDateTimeTypeAdapter() { - final String str = "\"2016-09-09T08:02:03.123-03:00\""; - OffsetDateTime date = OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); - - assertEquals(str, json.serialize(date)); - //Use toString() instead of isEqual to verify that the offset is preserved - assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); - } - - @Test - public void testLocalDateTypeAdapter() { - final String str = "\"2016-09-09\""; - final LocalDate date = LocalDate.of(2016, 9, 9); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, LocalDate.class), date); - } - - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } - - @Test - public void testByteArrayTypeAdapterSerialization() { - // Arrange - final String expectedBytesAsString = "Let's pretend this a jpg or something"; - final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); - - // Act - String serializedBytesWithQuotes = json.serialize(expectedBytes); - - // Assert - String serializedBytes = serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); - if (json.getGson().htmlSafe()) { - serializedBytes = serializedBytes.replaceAll("\\\\u003d", "="); - } - ByteString actualAsByteString = ByteString.decodeBase64(serializedBytes); - byte[] actualBytes = actualAsByteString.toByteArray(); - assertEquals(expectedBytesAsString, new String(actualBytes, StandardCharsets.UTF_8)); - } - - @Test - public void testByteArrayTypeAdapterDeserialization() { - // Arrange - final String expectedBytesAsString = "Let's pretend this a jpg or something"; - final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); - final ByteString expectedByteString = ByteString.of(expectedBytes); - final String serializedBytes = expectedByteString.base64(); - final String serializedBytesWithQuotes = "\"" + serializedBytes + "\""; - Type type = new TypeToken() { }.getType(); - - // Act - byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type); - - // Assert - assertEquals(expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); - } - - // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft https://stackoverflow.com/questions/11399491/java-timezone-offset - // Direct link https://stackoverflow.com/a/16680815/3166133 - public static String getCurrentTimezoneOffset() { - - TimeZone tz = TimeZone.getDefault(); - Calendar cal = GregorianCalendar.getInstance(tz); - int offsetInMillis = tz.getOffset(cal.getTimeInMillis()); - - String offset = String.format("%02d:%02d", Math.abs(offsetInMillis / 3600000), Math.abs((offsetInMillis / 60000) % 60)); - offset = (offsetInMillis >= 0 ? "+" : "-") + offset; - - return offset; - } -} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/StringUtilTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/StringUtilTest.java deleted file mode 100644 index 4b03c7a9812..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/StringUtilTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..0c06fbf57ca 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java index 0e4979b2906..7de631a091e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,9 +16,11 @@ package io.swagger.client.api; import io.swagger.client.ApiException; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -46,8 +48,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -62,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -100,6 +102,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -110,8 +129,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -135,7 +154,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -155,15 +174,15 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } @@ -178,8 +197,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { - Object param = null; - api.testInlineAdditionalProperties(param); + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..7b603d245c1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,15 +35,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java index b949d90ebdb..1801332c609 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,393 +1,170 @@ +/* + * 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.api; -import io.swagger.TestUtils; - -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.io.BufferedWriter; +import io.swagger.client.ApiException; import java.io.File; -import java.io.FileWriter; -import java.lang.reflect.Type; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Test; +import org.junit.Ignore; + import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.*; -import static org.junit.Assert.*; - +/** + * API tests for PetApi + */ +@Ignore public class PetApiTest { - PetApi api = null; - @Before - public void setup() { - api = new PetApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } + private final PetApi api = new PetApi(); + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testApiClient() { - // the default api client is used - assertEquals(Configuration.getDefaultApiClient(), api.getApiClient()); - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - - ApiClient oldClient = api.getApiClient(); - - ApiClient newClient = new ApiClient(); - newClient.setBasePath("http://example.com"); - newClient.setDebugging(true); - - // set api client via constructor - api = new PetApi(newClient); - assertNotNull(api.getApiClient()); - assertEquals("http://example.com", api.getApiClient().getBasePath()); - assertTrue(api.getApiClient().isDebugging()); - - // set api client via setter method - api.setApiClient(oldClient); - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - } - - @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createRandomPet(); + public void addPetTest() throws ApiException { + Pet pet = null; api.addPet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - - /* + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateAndGetPetWithByteArray() throws Exception { - Pet pet = createRandomPet(); - byte[] bytes = serializeJson(pet, api.getApiClient()).getBytes(); - api.addPetUsingByteArray(bytes); + public void deletePetTest() throws ApiException { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); - byte[] fetchedBytes = api.petPetIdtestingByteArraytrueGet(pet.getId()); - Type type = new TypeToken(){}.getType(); - Pet fetched = deserializeJson(new String(fetchedBytes), type, api.getApiClient()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - */ - + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateAndGetPetWithHttpInfo() throws Exception { - Pet pet = createRandomPet(); - api.addPetWithHttpInfo(pet); + public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); - ApiResponse resp = api.getPetByIdWithHttpInfo(pet.getId()); - assertEquals(200, resp.getStatusCode()); - assertEquals("application/json", resp.getHeaders().get("Content-Type").get(0)); - Pet fetched = resp.getData(); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateAndGetPetAsync() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - // to store returned Pet or error message/exception - final Map result = new HashMap(); + public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); - api.getPetByIdAsync(pet.getId(), new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("error", e.getMessage()); - } - - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); - // the API call should be executed asynchronously, so result should be empty at the moment - assertTrue(result.isEmpty()); - - // wait for the asynchronous call to finish (at most 10 seconds) - final int maxTry = 10; - int tryCount = 1; - Pet fetched = null; - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("error") != null) fail((String) result.get("error")); - if (result.get("pet") != null) { - fetched = (Pet) result.get("pet"); - break; - } - } while (result.isEmpty()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - - // test getting a nonexistent pet - result.clear(); - api.getPetByIdAsync(-10000L, new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("exception", e); - } - - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); - - // wait for the asynchronous call to finish (at most 10 seconds) - tryCount = 1; - ApiException exception = null; - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("pet") != null) fail("expected an error"); - if (result.get("exception") != null) { - exception = (ApiException) result.get("exception"); - break; - } - } while (result.isEmpty()); - assertNotNull(exception); - assertEquals(404, exception.getCode()); - assertEquals("Not Found", exception.getMessage()); - assertEquals("application/json", exception.getResponseHeaders().get("Content-Type").get(0)); + // TODO: test validations } - - /* + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetPetByIdInObject() throws Exception { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("pet " + pet.getId()); + public void getPetByIdTest() throws ApiException { + Long petId = null; + Pet response = api.getPetById(petId); - Category category = new Category(); - category.setId(TestUtils.nextId()); - category.setName("category " + category.getId()); - pet.setCategory(category); - - pet.setStatus(Pet.StatusEnum.PENDING); - List photos = Arrays.asList(new String[]{"http://foo.bar.com/1"}); - pet.setPhotoUrls(photos); - - api.addPet(pet); - - InlineResponse200 fetched = api.getPetByIdInObject(pet.getId()); - assertEquals(pet.getId(), fetched.getId()); - assertEquals(pet.getName(), fetched.getName()); - - Object categoryObj = fetched.getCategory(); - assertNotNull(categoryObj); - assertTrue(categoryObj instanceof Map); - - Map categoryMap = (Map) categoryObj; - Object categoryIdObj = categoryMap.get("id"); - // NOTE: Gson parses integer value to double. - assertTrue(categoryIdObj instanceof Double); - Long categoryIdLong = ((Double) categoryIdObj).longValue(); - assertEquals(category.getId(), categoryIdLong); - assertEquals(category.getName(), categoryMap.get("name")); + // TODO: test validations } - */ - + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - + public void updatePetTest() throws ApiException { + Pet pet = null; api.updatePet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.PENDING); + public void updatePetWithFormTest() throws ApiException { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); - api.updatePet(pet); - - List pets = api.findPetsByStatus(Arrays.asList("pending")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); - - api.deletePet(pet.getId(), null); + // TODO: test validations } - + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testFindPetsByTags() throws Exception { - Pet pet = createRandomPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void uploadFileTest() throws ApiException { + Long petId = null; + String additionalMetadata = null; + File file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - List tags = new ArrayList(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet); - - List pets = api.findPetsByTags(Arrays.asList("friendly")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); - - api.deletePet(pet.getId(), null); - } - - @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); - } - - @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(fetched.getId(), null); - - try { - fetched = api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (ApiException e) { - assertEquals(404, e.getCode()); - } - } - - @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); - } - - @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"); - pet.setPhotoUrls(photos); - - return pet; - } - - private String serializeJson(Object o, ApiClient apiClient) { - return apiClient.getJSON().serialize(o); - } - - private T deserializeJson(String json, Type type, ApiClient apiClient) { - return (T) apiClient.getJSON().deserialize(json, type); + // TODO: test validations } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java index 655e7be65b8..956978b470c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,99 +1,98 @@ +/* + * 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.api; -import io.swagger.TestUtils; import io.swagger.client.ApiException; +import io.swagger.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; -import org.junit.*; -import org.threeten.bp.OffsetDateTime; - -import static org.junit.Assert.*; - +/** + * API tests for StoreApi + */ +@Ignore public class StoreApiTest { - StoreApi api = null; - @Before - public void setup() { - api = new StoreApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } + private final StoreApi api = new StoreApi(); + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory(); - assertTrue(inventory.keySet().size() > 0); - } + public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); - /* + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetInventoryInObject() throws Exception { - Object inventoryObj = api.getInventoryInObject(); - assertTrue(inventoryObj instanceof Map); + public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); - Map inventoryMap = (Map) inventoryObj; - assertTrue(inventoryMap.keySet().size() > 0); - - Map.Entry firstEntry = (Map.Entry) inventoryMap.entrySet().iterator().next(); - assertTrue(firstEntry.getKey() instanceof String); - // NOTE: Gson parses integer value to double. - assertTrue(firstEntry.getValue() instanceof Double); + // TODO: test validations } - */ - + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testPlaceOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getOrderByIdTest() throws ApiException { + Long orderId = null; + Order response = api.getOrderById(orderId); - Order fetched = api.getOrderById(order.getId()); - assertEquals(order.getId(), fetched.getId()); - assertEquals(order.getPetId(), fetched.getPetId()); - assertEquals(order.getQuantity(), fetched.getQuantity()); - assertTrue(order.getShipDate().isEqual(fetched.getShipDate())); + // TODO: test validations } - + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void placeOrderTest() throws ApiException { + Order order = null; + Order response = api.placeOrder(order); - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); - - api.deleteOrder(String.valueOf(order.getId())); - - try { - api.getOrderById(order.getId()); - // fail("expected an error"); - } catch (ApiException e) { - // ok - } - } - - private Order createOrder() { - Order order = new Order(); - order.setPetId(200L); - order.setQuantity(13); - //Ensure 3 fractional digits because of a bug in the petstore server - order.setShipDate(OffsetDateTime.now().withNano(123000000)); - order.setStatus(Order.StatusEnum.PLACED); - order.setComplete(true); - - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, TestUtils.nextId()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; + // TODO: test validations } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java index b47a146d737..411e031d0d3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,87 +1,164 @@ +/* + * 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.api; -import io.swagger.TestUtils; +import io.swagger.client.ApiException; +import io.swagger.client.model.User; +import org.junit.Test; +import org.junit.Ignore; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.util.Arrays; - -import org.junit.*; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * API tests for UserApi + */ +@Ignore public class UserApiTest { - UserApi api = null; - @Before - public void setup() { - api = new UserApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } + private final UserApi api = new UserApi(); + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUser() throws Exception { - User user = createUser(); - + public void createUserTest() throws ApiException { + User user = null; api.createUser(user); - User fetched = api.getUserByName(user.getUsername()); - assertEquals(user.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUsersWithArray() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithArrayInputTest() throws ApiException { + List user = null; + api.createUsersWithArrayInput(user); - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUsersWithList() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithListInputTest() throws ApiException { + List user = null; + api.createUsersWithListInput(user); - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testLoginUser() throws Exception { - User user = createUser(); - api.createUser(user); + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); - String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + // TODO: test validations } - + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void logoutUser() throws Exception { + public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { api.logoutUser(); - } - private User createUser() { - User user = new User(); - user.setId(TestUtils.nextId()); - user.setUsername("fred" + user.getId()); - user.setFirstName("Fred"); - user.setLastName("Meyer"); - user.setEmail("fred@fredmeyer.com"); - user.setPassword("xxXXxx"); - user.setPhone("408-867-5309"); - user.setUserStatus(123); - - return user; + // TODO: test validations } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User user = null; + api.updateUser(username, user); + + // TODO: test validations + } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java deleted file mode 100644 index 3715e9724e6..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header parameters - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInQueryWithNullValue() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey(null); - auth.applyToParams(queryParams, headerParams); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInHeaderWithNullValue() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey(null); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java deleted file mode 100644 index ddee04f57fc..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - - // null username and password should be ignored - queryParams = new ArrayList(); - headerParams = new HashMap(); - auth.setUsername(null); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/model/EnumValueTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/model/EnumValueTest.java deleted file mode 100644 index a74a4a31b66..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/model/EnumValueTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.swagger.client.model; - -import org.junit.Test; - -import com.google.gson.Gson; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - // test serialization - Gson gson = new Gson(); - String json = gson.toJson(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1}"); - - // test deserialization - EnumTest fromString = gson.fromJson(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumString().getValue(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertTrue(fromString.getEnumInteger().getValue() == 1); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - assertTrue(fromString.getEnumNumber().getValue() == 1.1); - } -} diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator-ignore b/samples/client/petstore/java/rest-assured/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator-ignore +++ b/samples/client/petstore/java/rest-assured/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/rest-assured/README.md b/samples/client/petstore/java/rest-assured/README.md index 42dbb94813b..30ea0747534 100644 --- a/samples/client/petstore/java/rest-assured/README.md +++ b/samples/client/petstore/java/rest-assured/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-rest-assured +# petstore-rest-assured ## Requirements @@ -24,8 +24,8 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-petstore-rest-assured + org.openapitools + petstore-rest-assured 1.0.0 compile diff --git a/samples/client/petstore/java/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index 37767811dab..8afb2af1889 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-rest-assured' + pom.artifactId = 'petstore-rest-assured' } } @@ -95,7 +95,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.15" - rest_assured_version = "3.0.6" + rest_assured_version = "3.1.0" junit_version = "4.12" gson_version = "2.6.1" gson_fire_version = "1.8.2" diff --git a/samples/client/petstore/java/rest-assured/build.sbt b/samples/client/petstore/java/rest-assured/build.sbt index d4f15d41492..a57bc62b677 100644 --- a/samples/client/petstore/java/rest-assured/build.sbt +++ b/samples/client/petstore/java/rest-assured/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-rest-assured", + organization := "org.openapitools", + name := "petstore-rest-assured", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), @@ -10,7 +10,7 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.15", - "io.rest-assured" % "scala-support" % "3.0.6", + "io.rest-assured" % "scala-support" % "3.1.0", "com.google.code.gson" % "gson" % "2.6.1", "io.gsonfire" % "gson-fire" % "1.8.2" % "compile", "org.threeten" % "threetenbp" % "1.3.5" % "compile", diff --git a/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md b/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md index e26468a5fd8..741731fceb8 100644 --- a/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -27,14 +27,14 @@ AnotherFakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSuppl .setBaseUri("http://petstore.swagger.io:80/v2"))).anotherFake(); api.testSpecialTags() - .body(body).execute(r -> r.prettyPeek()); + .body(client).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/rest-assured/docs/EnumTest.md b/samples/client/petstore/java/rest-assured/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/rest-assured/docs/EnumTest.md +++ b/samples/client/petstore/java/rest-assured/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/rest-assured/docs/FakeApi.md b/samples/client/petstore/java/rest-assured/docs/FakeApi.md index f2d9bd569cd..6e50bf99d22 100644 --- a/samples/client/petstore/java/rest-assured/docs/FakeApi.md +++ b/samples/client/petstore/java/rest-assured/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -41,7 +42,7 @@ api.fakeOuterBooleanSerialize().execute(r -> r.prettyPeek()); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -54,11 +55,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -82,7 +83,7 @@ api.fakeOuterCompositeSerialize().execute(r -> r.prettyPeek()); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -95,7 +96,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -123,7 +124,7 @@ api.fakeOuterNumberSerialize().execute(r -> r.prettyPeek()); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -136,7 +137,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -164,7 +165,7 @@ api.fakeOuterStringSerialize().execute(r -> r.prettyPeek()); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -177,11 +178,53 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.restassured.builder.RequestSpecBuilder; +//import io.restassured.filter.log.ErrorLoggingFilter; + +FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( + () -> new RequestSpecBuilder() + .setBaseUri("http://petstore.swagger.io:80/v2"))).fake(); + +api.testBodyWithQueryParams() + .queryQuery(query) + .body(user).execute(r -> r.prettyPeek()); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -199,14 +242,14 @@ FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).fake(); api.testClientModel() - .body(body).execute(r -> r.prettyPeek()); + .body(client).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -255,12 +298,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -276,12 +319,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -305,14 +348,14 @@ api.testEnumParameters().execute(r -> r.prettyPeek()); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -324,17 +367,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -347,14 +388,14 @@ FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).fake(); api.testInlineAdditionalProperties() - .body(param).execute(r -> r.prettyPeek()); + .body(requestBody).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -375,8 +416,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -410,6 +449,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/rest-assured/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/rest-assured/docs/FakeClassnameTags123Api.md index a98b6ab652b..ec13ee2c535 100644 --- a/samples/client/petstore/java/rest-assured/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/rest-assured/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -27,14 +27,14 @@ FakeClassnameTags123Api api = ApiClient.api(ApiClient.Config.apiConfig().withReq .setBaseUri("http://petstore.swagger.io:80/v2"))).fakeClassnameTags123(); api.testClassname() - .body(body).execute(r -> r.prettyPeek()); + .body(client).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/rest-assured/docs/FormatTest.md b/samples/client/petstore/java/rest-assured/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/rest-assured/docs/FormatTest.md +++ b/samples/client/petstore/java/rest-assured/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/rest-assured/docs/Name.md b/samples/client/petstore/java/rest-assured/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/rest-assured/docs/Name.md +++ b/samples/client/petstore/java/rest-assured/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/rest-assured/docs/OuterBoolean.md b/samples/client/petstore/java/rest-assured/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/rest-assured/docs/OuterNumber.md b/samples/client/petstore/java/rest-assured/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/rest-assured/docs/OuterString.md b/samples/client/petstore/java/rest-assured/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/rest-assured/docs/PetApi.md b/samples/client/petstore/java/rest-assured/docs/PetApi.md index 8e2fd4fa00e..dcff4c5ab1b 100644 --- a/samples/client/petstore/java/rest-assured/docs/PetApi.md +++ b/samples/client/petstore/java/rest-assured/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -34,14 +32,14 @@ PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).pet(); api.addPet() - .body(body).execute(r -> r.prettyPeek()); + .body(pet).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -54,7 +52,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -62,8 +60,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -97,7 +93,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -227,12 +223,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -245,14 +239,14 @@ PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).pet(); api.updatePet() - .body(body).execute(r -> r.prettyPeek()); + .body(pet).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -265,7 +259,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -273,8 +267,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -309,7 +301,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -317,8 +309,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: diff --git a/samples/client/petstore/java/rest-assured/docs/SpecialModelName.md b/samples/client/petstore/java/rest-assured/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/rest-assured/docs/SpecialModelName.md +++ b/samples/client/petstore/java/rest-assured/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/rest-assured/docs/StoreApi.md b/samples/client/petstore/java/rest-assured/docs/StoreApi.md index aa3529f0d99..d7dc303f1e2 100644 --- a/samples/client/petstore/java/rest-assured/docs/StoreApi.md +++ b/samples/client/petstore/java/rest-assured/docs/StoreApi.md @@ -50,7 +50,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -117,7 +117,7 @@ api.getOrderById() Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -134,12 +134,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -152,14 +150,14 @@ StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).store(); api.placeOrder() - .body(body).execute(r -> r.prettyPeek()); + .body(order).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/rest-assured/docs/UserApi.md b/samples/client/petstore/java/rest-assured/docs/UserApi.md index 1bf14094eb0..549e790d33a 100644 --- a/samples/client/petstore/java/rest-assured/docs/UserApi.md +++ b/samples/client/petstore/java/rest-assured/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -34,14 +34,14 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).user(); api.createUser() - .body(body).execute(r -> r.prettyPeek()); + .body(user).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -54,16 +54,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -76,14 +74,14 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).user(); api.createUsersWithArrayInput() - .body(body).execute(r -> r.prettyPeek()); + .body(user).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -96,16 +94,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,14 +114,14 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( .setBaseUri("http://petstore.swagger.io:80/v2"))).user(); api.createUsersWithListInput() - .body(body).execute(r -> r.prettyPeek()); + .body(user).execute(r -> r.prettyPeek()); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -138,7 +134,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -180,7 +176,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -188,8 +184,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -230,8 +224,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -274,8 +266,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -304,11 +294,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -327,7 +317,7 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( api.updateUser() .usernamePath(username) - .body(body).execute(r -> r.prettyPeek()); + .body(user).execute(r -> r.prettyPeek()); ``` ### Parameters @@ -335,7 +325,7 @@ api.updateUser() Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -348,5 +338,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/rest-assured/pom.xml b/samples/client/petstore/java/rest-assured/pom.xml index 7d5b031a083..4ed742e4659 100644 --- a/samples/client/petstore/java/rest-assured/pom.xml +++ b/samples/client/petstore/java/rest-assured/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-rest-assured + org.openapitools + petstore-rest-assured jar - swagger-petstore-rest-assured + petstore-rest-assured 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org @@ -237,7 +237,7 @@ UTF-8 1.5.15 - 3.0.6 + 3.1.0 2.6.1 1.8.2 1.0.0 diff --git a/samples/client/petstore/java/rest-assured/settings.gradle b/samples/client/petstore/java/rest-assured/settings.gradle index 4d5d4752176..bc461db4ebb 100644 --- a/samples/client/petstore/java/rest-assured/settings.gradle +++ b/samples/client/petstore/java/rest-assured/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-rest-assured" \ No newline at end of file +rootProject.name = "petstore-rest-assured" \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/ApiClient.java index f8f8fc93aaf..a3e0fba7a2f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/ApiClient.java @@ -64,6 +64,8 @@ public class ApiClient { /** * Use common specification for all operations + * @param supplier supplier + * @return configuration */ public Config reqSpecSupplier(Supplier supplier) { this.baseReqSpec = supplier; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/JSON.java index 15ce43f658a..a518d2843d4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/JSON.java @@ -60,7 +60,7 @@ public class JSON { classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "")); } }) ; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/AnotherFakeApi.java index b6a2b25fe8a..2eea340b720 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -38,11 +38,8 @@ public class AnotherFakeApi { private RequestSpecBuilder reqSpec; - private JSON json; - private AnotherFakeApi(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - this.json = new JSON(); } public static AnotherFakeApi anotherFake(RequestSpecBuilder reqSpec) { @@ -55,28 +52,10 @@ public class AnotherFakeApi { } /** - * Get JSON - * - * @return JSON object + * Customise request specification + * @param consumer consumer + * @return api */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return AnotherFakeApi - */ - public AnotherFakeApi setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * Customise request specification - */ public AnotherFakeApi reqSpec(Consumer consumer) { consumer.accept(reqSpec); return this; @@ -113,6 +92,9 @@ public class AnotherFakeApi { /** * PATCH /another-fake/dummy + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PATCH, REQ_URI)); @@ -120,23 +102,27 @@ public class AnotherFakeApi { /** * PATCH /another-fake/dummy + * @param handler handler * @return Client */ public Client executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param body (Client) client model (required) + * @param client (Client) client model (required) + * @return operation */ - public TestSpecialTagsOper body(Client body) { - reqSpec.setBody(getJSON().serialize(body)); + public TestSpecialTagsOper body(Client client) { + reqSpec.setBody(client); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public TestSpecialTagsOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -145,6 +131,8 @@ public class AnotherFakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public TestSpecialTagsOper respSpec(Consumer consumer) { consumer.accept(respSpec); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeApi.java index 8dc32bd5765..ca9b42e23c2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeApi.java @@ -16,9 +16,11 @@ package io.swagger.client.api; import com.google.gson.reflect.TypeToken; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.Arrays; @@ -42,11 +44,8 @@ public class FakeApi { private RequestSpecBuilder reqSpec; - private JSON json; - private FakeApi(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - this.json = new JSON(); } public static FakeApi fake(RequestSpecBuilder reqSpec) { @@ -70,6 +69,10 @@ public class FakeApi { return new FakeOuterStringSerializeOper(reqSpec); } + public TestBodyWithQueryParamsOper testBodyWithQueryParams() { + return new TestBodyWithQueryParamsOper(reqSpec); + } + public TestClientModelOper testClientModel() { return new TestClientModelOper(reqSpec); } @@ -91,28 +94,10 @@ public class FakeApi { } /** - * Get JSON - * - * @return JSON object + * Customise request specification + * @param consumer consumer + * @return api */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return FakeApi - */ - public FakeApi setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * Customise request specification - */ public FakeApi reqSpec(Consumer consumer) { consumer.accept(reqSpec); return this; @@ -135,20 +120,23 @@ public class FakeApi { public FakeOuterBooleanSerializeOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } public FakeOuterBooleanSerializeOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /fake/outer/boolean + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -156,23 +144,27 @@ public class FakeApi { /** * POST /fake/outer/boolean + * @param handler handler * @return Boolean */ public Boolean executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param body (Boolean) Input boolean as post body (optional) + * @param booleanPostBody (Boolean) Input boolean as post body (optional) + * @return operation */ - public FakeOuterBooleanSerializeOper body(Boolean body) { - reqSpec.setBody(getJSON().serialize(body)); + public FakeOuterBooleanSerializeOper body(Boolean booleanPostBody) { + reqSpec.setBody(booleanPostBody); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public FakeOuterBooleanSerializeOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -181,6 +173,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public FakeOuterBooleanSerializeOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -204,20 +198,23 @@ public class FakeApi { public FakeOuterCompositeSerializeOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } public FakeOuterCompositeSerializeOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /fake/outer/composite + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -225,23 +222,27 @@ public class FakeApi { /** * POST /fake/outer/composite + * @param handler handler * @return OuterComposite */ public OuterComposite executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param body (OuterComposite) Input composite as post body (optional) + * @param outerComposite (OuterComposite) Input composite as post body (optional) + * @return operation */ - public FakeOuterCompositeSerializeOper body(OuterComposite body) { - reqSpec.setBody(getJSON().serialize(body)); + public FakeOuterCompositeSerializeOper body(OuterComposite outerComposite) { + reqSpec.setBody(outerComposite); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public FakeOuterCompositeSerializeOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -250,6 +251,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public FakeOuterCompositeSerializeOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -273,20 +276,23 @@ public class FakeApi { public FakeOuterNumberSerializeOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } public FakeOuterNumberSerializeOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /fake/outer/number + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -294,23 +300,27 @@ public class FakeApi { /** * POST /fake/outer/number + * @param handler handler * @return BigDecimal */ public BigDecimal executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * @param body (BigDecimal) Input number as post body (optional) + * @return operation */ public FakeOuterNumberSerializeOper body(BigDecimal body) { - reqSpec.setBody(getJSON().serialize(body)); + reqSpec.setBody(body); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public FakeOuterNumberSerializeOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -319,6 +329,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public FakeOuterNumberSerializeOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -342,20 +354,23 @@ public class FakeApi { public FakeOuterStringSerializeOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } public FakeOuterStringSerializeOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); - reqSpec.setAccept("application/json"); + reqSpec.setContentType("*/*"); + reqSpec.setAccept("*/*"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /fake/outer/string + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -363,23 +378,27 @@ public class FakeApi { /** * POST /fake/outer/string + * @param handler handler * @return String */ public String executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * @param body (String) Input string as post body (optional) + * @return operation */ public FakeOuterStringSerializeOper body(String body) { - reqSpec.setBody(getJSON().serialize(body)); + reqSpec.setBody(body); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public FakeOuterStringSerializeOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -388,12 +407,91 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public FakeOuterStringSerializeOper respSpec(Consumer consumer) { consumer.accept(respSpec); return this; } } + /** + * + * + * + * @see #queryQuery (required) + * @see #body (required) + */ + public class TestBodyWithQueryParamsOper { + + public static final String REQ_URI = "/fake/body-with-query-params"; + + private RequestSpecBuilder reqSpec; + + private ResponseSpecBuilder respSpec; + + public TestBodyWithQueryParamsOper() { + this.reqSpec = new RequestSpecBuilder(); + reqSpec.setContentType("application/json"); + reqSpec.setAccept("application/json"); + this.respSpec = new ResponseSpecBuilder(); + } + + public TestBodyWithQueryParamsOper(RequestSpecBuilder reqSpec) { + this.reqSpec = reqSpec; + reqSpec.setContentType("application/json"); + reqSpec.setAccept("application/json"); + this.respSpec = new ResponseSpecBuilder(); + } + + /** + * PUT /fake/body-with-query-params + * @param handler handler + * @param type + * @return type + */ + public T execute(Function handler) { + return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PUT, REQ_URI)); + } + + /** + * @param user (User) (required) + * @return operation + */ + public TestBodyWithQueryParamsOper body(User user) { + reqSpec.setBody(user); + return this; + } + + /** + * @param query (String) (required) + * @return operation + */ + public TestBodyWithQueryParamsOper queryQuery(Object... query) { + reqSpec.addQueryParam("query", query); + return this; + } + + /** + * Customise request specification + * @param consumer consumer + * @return operation + */ + public TestBodyWithQueryParamsOper reqSpec(Consumer consumer) { + consumer.accept(reqSpec); + return this; + } + + /** + * Customise response specification + * @param consumer consumer + * @return operation + */ + public TestBodyWithQueryParamsOper respSpec(Consumer consumer) { + consumer.accept(respSpec); + return this; + } + } /** * To test \"client\" model * To test \"client\" model @@ -425,6 +523,9 @@ public class FakeApi { /** * PATCH /fake + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PATCH, REQ_URI)); @@ -432,23 +533,27 @@ public class FakeApi { /** * PATCH /fake + * @param handler handler * @return Client */ public Client executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param body (Client) client model (required) + * @param client (Client) client model (required) + * @return operation */ - public TestClientModelOper body(Client body) { - reqSpec.setBody(getJSON().serialize(body)); + public TestClientModelOper body(Client client) { + reqSpec.setBody(client); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public TestClientModelOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -457,6 +562,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public TestClientModelOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -476,7 +583,7 @@ public class FakeApi { * @see #int64Form None (optional) * @see #_floatForm None (optional) * @see #stringForm None (optional) - * @see #binaryForm None (optional) + * @see #binaryMultiPart None (optional) * @see #dateForm None (optional) * @see #dateTimeForm None (optional) * @see #passwordForm None (optional) @@ -492,20 +599,23 @@ public class FakeApi { public TestEndpointParametersOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/xml; charset=utf-8"); - reqSpec.setAccept("application/xml; charset=utf-8,application/json; charset=utf-8"); + reqSpec.setContentType("application/x-www-form-urlencoded"); + reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public TestEndpointParametersOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/xml; charset=utf-8"); - reqSpec.setAccept("application/xml; charset=utf-8,application/json; charset=utf-8"); + reqSpec.setContentType("application/x-www-form-urlencoded"); + reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /fake + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -513,6 +623,7 @@ public class FakeApi { /** * @param integer (Integer) None (optional) + * @return operation */ public TestEndpointParametersOper integerForm(Object... integer) { reqSpec.addFormParam("integer", integer); @@ -521,6 +632,7 @@ public class FakeApi { /** * @param int32 (Integer) None (optional) + * @return operation */ public TestEndpointParametersOper int32Form(Object... int32) { reqSpec.addFormParam("int32", int32); @@ -529,6 +641,7 @@ public class FakeApi { /** * @param int64 (Long) None (optional) + * @return operation */ public TestEndpointParametersOper int64Form(Object... int64) { reqSpec.addFormParam("int64", int64); @@ -537,6 +650,7 @@ public class FakeApi { /** * @param number (BigDecimal) None (required) + * @return operation */ public TestEndpointParametersOper numberForm(Object... number) { reqSpec.addFormParam("number", number); @@ -545,6 +659,7 @@ public class FakeApi { /** * @param _float (Float) None (optional) + * @return operation */ public TestEndpointParametersOper _floatForm(Object... _float) { reqSpec.addFormParam("float", _float); @@ -553,6 +668,7 @@ public class FakeApi { /** * @param _double (Double) None (required) + * @return operation */ public TestEndpointParametersOper _doubleForm(Object... _double) { reqSpec.addFormParam("double", _double); @@ -561,6 +677,7 @@ public class FakeApi { /** * @param string (String) None (optional) + * @return operation */ public TestEndpointParametersOper stringForm(Object... string) { reqSpec.addFormParam("string", string); @@ -569,6 +686,7 @@ public class FakeApi { /** * @param patternWithoutDelimiter (String) None (required) + * @return operation */ public TestEndpointParametersOper patternWithoutDelimiterForm(Object... patternWithoutDelimiter) { reqSpec.addFormParam("pattern_without_delimiter", patternWithoutDelimiter); @@ -577,22 +695,16 @@ public class FakeApi { /** * @param _byte (byte[]) None (required) + * @return operation */ public TestEndpointParametersOper _byteForm(Object... _byte) { reqSpec.addFormParam("byte", _byte); return this; } - /** - * @param binary (byte[]) None (optional) - */ - public TestEndpointParametersOper binaryForm(Object... binary) { - reqSpec.addFormParam("binary", binary); - return this; - } - /** * @param date (LocalDate) None (optional) + * @return operation */ public TestEndpointParametersOper dateForm(Object... date) { reqSpec.addFormParam("date", date); @@ -601,6 +713,7 @@ public class FakeApi { /** * @param dateTime (OffsetDateTime) None (optional) + * @return operation */ public TestEndpointParametersOper dateTimeForm(Object... dateTime) { reqSpec.addFormParam("dateTime", dateTime); @@ -609,6 +722,7 @@ public class FakeApi { /** * @param password (String) None (optional) + * @return operation */ public TestEndpointParametersOper passwordForm(Object... password) { reqSpec.addFormParam("password", password); @@ -617,14 +731,28 @@ public class FakeApi { /** * @param paramCallback (String) None (optional) + * @return operation */ public TestEndpointParametersOper paramCallbackForm(Object... paramCallback) { reqSpec.addFormParam("callback", paramCallback); return this; } + /** + * It will assume that the control name is file and the <content-type> is <application/octet-stream> + * @see #reqSpec for customise + * @param binary (File) None (optional) + * @return operation + */ + public TestEndpointParametersOper binaryMultiPart(File binary) { + reqSpec.addMultiPart(binary); + return this; + } + /** * Customise request specification + * @param consumer consumer + * @return operation */ public TestEndpointParametersOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -633,6 +761,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public TestEndpointParametersOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -643,14 +773,14 @@ public class FakeApi { * To test enum parameters * To test enum parameters * - * @see #enumFormStringArrayForm Form parameter enum test (string array) (optional) - * @see #enumFormStringForm Form parameter enum test (string) (optional, default to -efg) * @see #enumHeaderStringArrayHeader Header parameter enum test (string array) (optional) * @see #enumHeaderStringHeader Header parameter enum test (string) (optional, default to -efg) * @see #enumQueryStringArrayQuery Query parameter enum test (string array) (optional) * @see #enumQueryStringQuery Query parameter enum test (string) (optional, default to -efg) * @see #enumQueryIntegerQuery Query parameter enum test (double) (optional) - * @see #enumQueryDoubleForm Query parameter enum test (double) (optional) + * @see #enumQueryDoubleQuery Query parameter enum test (double) (optional) + * @see #enumFormStringArrayForm Form parameter enum test (string array) (optional) + * @see #enumFormStringForm Form parameter enum test (string) (optional) */ public class TestEnumParametersOper { @@ -662,27 +792,31 @@ public class FakeApi { public TestEnumParametersOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("*/*"); - reqSpec.setAccept("*/*"); + reqSpec.setContentType("application/x-www-form-urlencoded"); + reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public TestEnumParametersOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("*/*"); - reqSpec.setAccept("*/*"); + reqSpec.setContentType("application/x-www-form-urlencoded"); + reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * GET /fake + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); } /** - * @param enumHeaderStringArray (List) Header parameter enum test (string array) (optional) + * @param enumHeaderStringArray (List<String>) Header parameter enum test (string array) (optional) + * @return operation */ public TestEnumParametersOper enumHeaderStringArrayHeader(String enumHeaderStringArray) { reqSpec.addHeader("enum_header_string_array", enumHeaderStringArray); @@ -691,6 +825,7 @@ public class FakeApi { /** * @param enumHeaderString (String) Header parameter enum test (string) (optional, default to -efg) + * @return operation */ public TestEnumParametersOper enumHeaderStringHeader(String enumHeaderString) { reqSpec.addHeader("enum_header_string", enumHeaderString); @@ -698,7 +833,8 @@ public class FakeApi { } /** - * @param enumQueryStringArray (List) Query parameter enum test (string array) (optional) + * @param enumQueryStringArray (List<String>) Query parameter enum test (string array) (optional) + * @return operation */ public TestEnumParametersOper enumQueryStringArrayQuery(Object... enumQueryStringArray) { reqSpec.addQueryParam("enum_query_string_array", enumQueryStringArray); @@ -707,6 +843,7 @@ public class FakeApi { /** * @param enumQueryString (String) Query parameter enum test (string) (optional, default to -efg) + * @return operation */ public TestEnumParametersOper enumQueryStringQuery(Object... enumQueryString) { reqSpec.addQueryParam("enum_query_string", enumQueryString); @@ -715,14 +852,25 @@ public class FakeApi { /** * @param enumQueryInteger (Integer) Query parameter enum test (double) (optional) + * @return operation */ public TestEnumParametersOper enumQueryIntegerQuery(Object... enumQueryInteger) { reqSpec.addQueryParam("enum_query_integer", enumQueryInteger); return this; } + /** + * @param enumQueryDouble (Double) Query parameter enum test (double) (optional) + * @return operation + */ + public TestEnumParametersOper enumQueryDoubleQuery(Object... enumQueryDouble) { + reqSpec.addQueryParam("enum_query_double", enumQueryDouble); + return this; + } + /** - * @param enumFormStringArray (List) Form parameter enum test (string array) (optional) + * @param enumFormStringArray (List<String>) Form parameter enum test (string array) (optional) + * @return operation */ public TestEnumParametersOper enumFormStringArrayForm(Object... enumFormStringArray) { reqSpec.addFormParam("enum_form_string_array", enumFormStringArray); @@ -730,23 +878,18 @@ public class FakeApi { } /** - * @param enumFormString (String) Form parameter enum test (string) (optional, default to -efg) + * @param enumFormString (String) Form parameter enum test (string) (optional) + * @return operation */ public TestEnumParametersOper enumFormStringForm(Object... enumFormString) { reqSpec.addFormParam("enum_form_string", enumFormString); return this; } - /** - * @param enumQueryDouble (Double) Query parameter enum test (double) (optional) - */ - public TestEnumParametersOper enumQueryDoubleForm(Object... enumQueryDouble) { - reqSpec.addFormParam("enum_query_double", enumQueryDouble); - return this; - } - /** * Customise request specification + * @param consumer consumer + * @return operation */ public TestEnumParametersOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -755,6 +898,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public TestEnumParametersOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -791,21 +936,27 @@ public class FakeApi { /** * POST /fake/inline-additionalProperties + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); } /** - * @param param (Object) request body (required) + * @param requestBody (String) request body (required) + * @return operation */ - public TestInlineAdditionalPropertiesOper body(Object param) { - reqSpec.setBody(getJSON().serialize(param)); + public TestInlineAdditionalPropertiesOper body(String requestBody) { + reqSpec.setBody(requestBody); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public TestInlineAdditionalPropertiesOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -814,6 +965,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public TestInlineAdditionalPropertiesOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -837,20 +990,23 @@ public class FakeApi { public TestJsonFormDataOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); + reqSpec.setContentType("application/x-www-form-urlencoded"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public TestJsonFormDataOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); + reqSpec.setContentType("application/x-www-form-urlencoded"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * GET /fake/jsonFormData + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -858,6 +1014,7 @@ public class FakeApi { /** * @param param (String) field1 (required) + * @return operation */ public TestJsonFormDataOper paramForm(Object... param) { reqSpec.addFormParam("param", param); @@ -866,6 +1023,7 @@ public class FakeApi { /** * @param param2 (String) field2 (required) + * @return operation */ public TestJsonFormDataOper param2Form(Object... param2) { reqSpec.addFormParam("param2", param2); @@ -874,6 +1032,8 @@ public class FakeApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public TestJsonFormDataOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -882,6 +1042,8 @@ public class FakeApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public TestJsonFormDataOper respSpec(Consumer consumer) { consumer.accept(respSpec); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index dd57a83a030..4c38faf15a3 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -38,11 +38,8 @@ public class FakeClassnameTags123Api { private RequestSpecBuilder reqSpec; - private JSON json; - private FakeClassnameTags123Api(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - this.json = new JSON(); } public static FakeClassnameTags123Api fakeClassnameTags123(RequestSpecBuilder reqSpec) { @@ -55,28 +52,10 @@ public class FakeClassnameTags123Api { } /** - * Get JSON - * - * @return JSON object + * Customise request specification + * @param consumer consumer + * @return api */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return FakeClassnameTags123Api - */ - public FakeClassnameTags123Api setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * Customise request specification - */ public FakeClassnameTags123Api reqSpec(Consumer consumer) { consumer.accept(reqSpec); return this; @@ -113,6 +92,9 @@ public class FakeClassnameTags123Api { /** * PATCH /fake_classname_test + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PATCH, REQ_URI)); @@ -120,23 +102,27 @@ public class FakeClassnameTags123Api { /** * PATCH /fake_classname_test + * @param handler handler * @return Client */ public Client executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param body (Client) client model (required) + * @param client (Client) client model (required) + * @return operation */ - public TestClassnameOper body(Client body) { - reqSpec.setBody(getJSON().serialize(body)); + public TestClassnameOper body(Client client) { + reqSpec.setBody(client); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public TestClassnameOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -145,6 +131,8 @@ public class FakeClassnameTags123Api { /** * Customise response specification + * @param consumer consumer + * @return operation */ public TestClassnameOper respSpec(Consumer consumer) { consumer.accept(respSpec); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/PetApi.java index 1fb00ae6195..54105541a3f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/PetApi.java @@ -40,11 +40,8 @@ public class PetApi { private RequestSpecBuilder reqSpec; - private JSON json; - private PetApi(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - this.json = new JSON(); } public static PetApi pet(RequestSpecBuilder reqSpec) { @@ -86,28 +83,10 @@ public class PetApi { } /** - * Get JSON - * - * @return JSON object + * Customise request specification + * @param consumer consumer + * @return api */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return PetApi - */ - public PetApi setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * Customise request specification - */ public PetApi reqSpec(Consumer consumer) { consumer.accept(reqSpec); return this; @@ -143,21 +122,27 @@ public class PetApi { /** * POST /pet + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); } /** - * @param body (Pet) Pet object that needs to be added to the store (required) + * @param pet (Pet) Pet object that needs to be added to the store (required) + * @return operation */ - public AddPetOper body(Pet body) { - reqSpec.setBody(getJSON().serialize(body)); + public AddPetOper body(Pet pet) { + reqSpec.setBody(pet); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public AddPetOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -166,6 +151,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public AddPetOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -201,6 +188,9 @@ public class PetApi { /** * DELETE /pet/{petId} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(DELETE, REQ_URI)); @@ -208,6 +198,7 @@ public class PetApi { /** * @param apiKey (String) (optional) + * @return operation */ public DeletePetOper apiKeyHeader(String apiKey) { reqSpec.addHeader("api_key", apiKey); @@ -216,6 +207,7 @@ public class PetApi { /** * @param petId (Long) Pet id to delete (required) + * @return operation */ public DeletePetOper petIdPath(Object petId) { reqSpec.addPathParam("petId", petId); @@ -224,6 +216,8 @@ public class PetApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public DeletePetOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -232,6 +226,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public DeletePetOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -243,7 +239,7 @@ public class PetApi { * Multiple status values can be provided with comma separated strings * * @see #statusQuery Status values that need to be considered for filter (required) - * return List + * return List<Pet> */ public class FindPetsByStatusOper { @@ -267,6 +263,9 @@ public class PetApi { /** * GET /pet/findByStatus + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -274,15 +273,17 @@ public class PetApi { /** * GET /pet/findByStatus - * @return List + * @param handler handler + * @return List<Pet> */ public List executeAs(Function handler) { Type type = new TypeToken>(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param status (List) Status values that need to be considered for filter (required) + * @param status (List<String>) Status values that need to be considered for filter (required) + * @return operation */ public FindPetsByStatusOper statusQuery(Object... status) { reqSpec.addQueryParam("status", status); @@ -291,6 +292,8 @@ public class PetApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public FindPetsByStatusOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -299,6 +302,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public FindPetsByStatusOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -310,7 +315,7 @@ public class PetApi { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * * @see #tagsQuery Tags to filter by (required) - * return List + * return List<Pet> * @deprecated */ @Deprecated @@ -336,6 +341,9 @@ public class PetApi { /** * GET /pet/findByTags + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -343,15 +351,17 @@ public class PetApi { /** * GET /pet/findByTags - * @return List + * @param handler handler + * @return List<Pet> */ public List executeAs(Function handler) { Type type = new TypeToken>(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param tags (List) Tags to filter by (required) + * @param tags (List<String>) Tags to filter by (required) + * @return operation */ public FindPetsByTagsOper tagsQuery(Object... tags) { reqSpec.addQueryParam("tags", tags); @@ -360,6 +370,8 @@ public class PetApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public FindPetsByTagsOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -368,6 +380,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public FindPetsByTagsOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -403,6 +417,9 @@ public class PetApi { /** * GET /pet/{petId} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -410,15 +427,17 @@ public class PetApi { /** * GET /pet/{petId} + * @param handler handler * @return Pet */ public Pet executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * @param petId (Long) ID of pet to return (required) + * @return operation */ public GetPetByIdOper petIdPath(Object petId) { reqSpec.addPathParam("petId", petId); @@ -427,6 +446,8 @@ public class PetApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public GetPetByIdOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -435,6 +456,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public GetPetByIdOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -471,21 +494,27 @@ public class PetApi { /** * PUT /pet + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PUT, REQ_URI)); } /** - * @param body (Pet) Pet object that needs to be added to the store (required) + * @param pet (Pet) Pet object that needs to be added to the store (required) + * @return operation */ - public UpdatePetOper body(Pet body) { - reqSpec.setBody(getJSON().serialize(body)); + public UpdatePetOper body(Pet pet) { + reqSpec.setBody(pet); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public UpdatePetOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -494,6 +523,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public UpdatePetOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -532,6 +563,9 @@ public class PetApi { /** * POST /pet/{petId} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -539,6 +573,7 @@ public class PetApi { /** * @param petId (Long) ID of pet that needs to be updated (required) + * @return operation */ public UpdatePetWithFormOper petIdPath(Object petId) { reqSpec.addPathParam("petId", petId); @@ -547,6 +582,7 @@ public class PetApi { /** * @param name (String) Updated name of the pet (optional) + * @return operation */ public UpdatePetWithFormOper nameForm(Object... name) { reqSpec.addFormParam("name", name); @@ -555,6 +591,7 @@ public class PetApi { /** * @param status (String) Updated status of the pet (optional) + * @return operation */ public UpdatePetWithFormOper statusForm(Object... status) { reqSpec.addFormParam("status", status); @@ -563,6 +600,8 @@ public class PetApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public UpdatePetWithFormOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -571,6 +610,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public UpdatePetWithFormOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -610,6 +651,9 @@ public class PetApi { /** * POST /pet/{petId}/uploadImage + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -617,15 +661,17 @@ public class PetApi { /** * POST /pet/{petId}/uploadImage + * @param handler handler * @return ModelApiResponse */ public ModelApiResponse executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * @param petId (Long) ID of pet to update (required) + * @return operation */ public UploadFileOper petIdPath(Object petId) { reqSpec.addPathParam("petId", petId); @@ -634,6 +680,7 @@ public class PetApi { /** * @param additionalMetadata (String) Additional data to pass to server (optional) + * @return operation */ public UploadFileOper additionalMetadataForm(Object... additionalMetadata) { reqSpec.addFormParam("additionalMetadata", additionalMetadata); @@ -641,9 +688,10 @@ public class PetApi { } /** - * It will assume that the control name is file and the is + * It will assume that the control name is file and the <content-type> is <application/octet-stream> * @see #reqSpec for customise * @param file (File) file to upload (optional) + * @return operation */ public UploadFileOper fileMultiPart(File file) { reqSpec.addMultiPart(file); @@ -652,6 +700,8 @@ public class PetApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public UploadFileOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -660,6 +710,8 @@ public class PetApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public UploadFileOper respSpec(Consumer consumer) { consumer.accept(respSpec); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/StoreApi.java index 27e37ed1d42..61282df86bc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/StoreApi.java @@ -38,11 +38,8 @@ public class StoreApi { private RequestSpecBuilder reqSpec; - private JSON json; - private StoreApi(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - this.json = new JSON(); } public static StoreApi store(RequestSpecBuilder reqSpec) { @@ -67,28 +64,10 @@ public class StoreApi { } /** - * Get JSON - * - * @return JSON object + * Customise request specification + * @param consumer consumer + * @return api */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return StoreApi - */ - public StoreApi setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * Customise request specification - */ public StoreApi reqSpec(Consumer consumer) { consumer.accept(reqSpec); return this; @@ -122,6 +101,9 @@ public class StoreApi { /** * DELETE /store/order/{order_id} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(DELETE, REQ_URI)); @@ -129,6 +111,7 @@ public class StoreApi { /** * @param orderId (String) ID of the order that needs to be deleted (required) + * @return operation */ public DeleteOrderOper orderIdPath(Object orderId) { reqSpec.addPathParam("order_id", orderId); @@ -137,6 +120,8 @@ public class StoreApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public DeleteOrderOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -145,6 +130,8 @@ public class StoreApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public DeleteOrderOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -155,7 +142,7 @@ public class StoreApi { * Returns pet inventories by status * Returns a map of status codes to quantities * - * return Map + * return Map<String, Integer> */ public class GetInventoryOper { @@ -179,6 +166,9 @@ public class StoreApi { /** * GET /store/inventory + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -186,15 +176,18 @@ public class StoreApi { /** * GET /store/inventory - * @return Map + * @param handler handler + * @return Map<String, Integer> */ public Map executeAs(Function handler) { Type type = new TypeToken>(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * Customise request specification + * @param consumer consumer + * @return operation */ public GetInventoryOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -203,6 +196,8 @@ public class StoreApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public GetInventoryOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -238,6 +233,9 @@ public class StoreApi { /** * GET /store/order/{order_id} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -245,15 +243,17 @@ public class StoreApi { /** * GET /store/order/{order_id} + * @param handler handler * @return Order */ public Order executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * @param orderId (Long) ID of pet that needs to be fetched (required) + * @return operation */ public GetOrderByIdOper orderIdPath(Object orderId) { reqSpec.addPathParam("order_id", orderId); @@ -262,6 +262,8 @@ public class StoreApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public GetOrderByIdOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -270,6 +272,8 @@ public class StoreApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public GetOrderByIdOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -293,20 +297,23 @@ public class StoreApi { public PlaceOrderOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public PlaceOrderOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /store/order + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); @@ -314,23 +321,27 @@ public class StoreApi { /** * POST /store/order + * @param handler handler * @return Order */ public Order executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** - * @param body (Order) order placed for purchasing the pet (required) + * @param order (Order) order placed for purchasing the pet (required) + * @return operation */ - public PlaceOrderOper body(Order body) { - reqSpec.setBody(getJSON().serialize(body)); + public PlaceOrderOper body(Order order) { + reqSpec.setBody(order); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public PlaceOrderOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -339,6 +350,8 @@ public class StoreApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public PlaceOrderOper respSpec(Consumer consumer) { consumer.accept(respSpec); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/UserApi.java index c3eed3d9ce4..f60761aa1f8 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/api/UserApi.java @@ -38,11 +38,8 @@ public class UserApi { private RequestSpecBuilder reqSpec; - private JSON json; - private UserApi(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - this.json = new JSON(); } public static UserApi user(RequestSpecBuilder reqSpec) { @@ -83,28 +80,10 @@ public class UserApi { } /** - * Get JSON - * - * @return JSON object + * Customise request specification + * @param consumer consumer + * @return api */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return UserApi - */ - public UserApi setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * Customise request specification - */ public UserApi reqSpec(Consumer consumer) { consumer.accept(reqSpec); return this; @@ -126,35 +105,41 @@ public class UserApi { public CreateUserOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public CreateUserOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /user + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); } /** - * @param body (User) Created user object (required) + * @param user (User) Created user object (required) + * @return operation */ - public CreateUserOper body(User body) { - reqSpec.setBody(getJSON().serialize(body)); + public CreateUserOper body(User user) { + reqSpec.setBody(user); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public CreateUserOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -163,6 +148,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public CreateUserOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -185,35 +172,41 @@ public class UserApi { public CreateUsersWithArrayInputOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public CreateUsersWithArrayInputOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /user/createWithArray + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); } /** - * @param body (List) List of user object (required) + * @param user (List<User>) List of user object (required) + * @return operation */ - public CreateUsersWithArrayInputOper body(List body) { - reqSpec.setBody(getJSON().serialize(body)); + public CreateUsersWithArrayInputOper body(List user) { + reqSpec.setBody(user); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public CreateUsersWithArrayInputOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -222,6 +215,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public CreateUsersWithArrayInputOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -244,35 +239,41 @@ public class UserApi { public CreateUsersWithListInputOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public CreateUsersWithListInputOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * POST /user/createWithList + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI)); } /** - * @param body (List) List of user object (required) + * @param user (List<User>) List of user object (required) + * @return operation */ - public CreateUsersWithListInputOper body(List body) { - reqSpec.setBody(getJSON().serialize(body)); + public CreateUsersWithListInputOper body(List user) { + reqSpec.setBody(user); return this; } /** * Customise request specification + * @param consumer consumer + * @return operation */ public CreateUsersWithListInputOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -281,6 +282,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public CreateUsersWithListInputOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -315,6 +318,9 @@ public class UserApi { /** * DELETE /user/{username} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(DELETE, REQ_URI)); @@ -322,6 +328,7 @@ public class UserApi { /** * @param username (String) The name that needs to be deleted (required) + * @return operation */ public DeleteUserOper usernamePath(Object username) { reqSpec.addPathParam("username", username); @@ -330,6 +337,8 @@ public class UserApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public DeleteUserOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -338,6 +347,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public DeleteUserOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -373,6 +384,9 @@ public class UserApi { /** * GET /user/{username} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -380,15 +394,17 @@ public class UserApi { /** * GET /user/{username} + * @param handler handler * @return User */ public User executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * @param username (String) The name that needs to be fetched. Use user1 for testing. (required) + * @return operation */ public GetUserByNameOper usernamePath(Object username) { reqSpec.addPathParam("username", username); @@ -397,6 +413,8 @@ public class UserApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public GetUserByNameOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -405,6 +423,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public GetUserByNameOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -441,6 +461,9 @@ public class UserApi { /** * GET /user/login + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -448,15 +471,17 @@ public class UserApi { /** * GET /user/login + * @param handler handler * @return String */ public String executeAs(Function handler) { Type type = new TypeToken(){}.getType(); - return getJSON().deserialize(execute(handler).asString(), type); + return execute(handler).as(type); } /** * @param username (String) The user name for login (required) + * @return operation */ public LoginUserOper usernameQuery(Object... username) { reqSpec.addQueryParam("username", username); @@ -465,6 +490,7 @@ public class UserApi { /** * @param password (String) The password for login in clear text (required) + * @return operation */ public LoginUserOper passwordQuery(Object... password) { reqSpec.addQueryParam("password", password); @@ -473,6 +499,8 @@ public class UserApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public LoginUserOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -481,6 +509,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public LoginUserOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -514,6 +544,9 @@ public class UserApi { /** * GET /user/logout + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI)); @@ -521,6 +554,8 @@ public class UserApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public LogoutUserOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -529,6 +564,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public LogoutUserOper respSpec(Consumer consumer) { consumer.accept(respSpec); @@ -552,35 +589,40 @@ public class UserApi { public UpdateUserOper() { this.reqSpec = new RequestSpecBuilder(); - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } public UpdateUserOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; - reqSpec.setContentType("application/json"); + reqSpec.setContentType("*/*"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } /** * PUT /user/{username} + * @param handler handler + * @param type + * @return type */ public T execute(Function handler) { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PUT, REQ_URI)); } /** - * @param body (User) Updated user object (required) + * @param user (User) Updated user object (required) + * @return operation */ - public UpdateUserOper body(User body) { - reqSpec.setBody(getJSON().serialize(body)); + public UpdateUserOper body(User user) { + reqSpec.setBody(user); return this; } /** * @param username (String) name that need to be deleted (required) + * @return operation */ public UpdateUserOper usernamePath(Object username) { reqSpec.addPathParam("username", username); @@ -589,6 +631,8 @@ public class UserApi { /** * Customise request specification + * @param consumer consumer + * @return operation */ public UpdateUserOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); @@ -597,6 +641,8 @@ public class UserApi { /** * Customise response specification + * @param consumer consumer + * @return operation */ public UpdateUserOper respSpec(Consumer consumer) { consumer.accept(respSpec); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java index a572c0d6b5b..7a1b9c32152 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java @@ -82,6 +82,58 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + @JsonAdapter(EnumStringRequiredEnum.Adapter.class) + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringRequiredEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -203,6 +255,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -268,6 +338,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -275,7 +346,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -285,6 +356,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/FormatTest.java index 3223d766753..24ce7363eac 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/FormatTest.java @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; @@ -58,7 +59,7 @@ public class FormatTest { private byte[] _byte = null; @SerializedName("binary") - private byte[] binary = null; + private File binary = null; @SerializedName("date") private LocalDate date = null; @@ -226,7 +227,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -236,11 +237,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -334,7 +335,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -343,7 +344,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Model200Response.java index 1bcc6ac44bf..28c5997ded5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Model200Response.java @@ -81,9 +81,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Name.java index f6a3f8f4195..a7b129c2a4d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Name.java @@ -40,7 +40,7 @@ public class Name { private String property = null; @SerializedName("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/SpecialModelName.java index 9c0a4477a04..185b853dce9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -30,24 +30,24 @@ import java.io.IOException; public class SpecialModelName { @SerializedName("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -59,13 +59,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -74,7 +74,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index edfaf2c4286..7a9fef11447 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -13,14 +13,19 @@ package io.swagger.client.api; +import io.swagger.client.model.Client; +import io.swagger.client.ApiClient; +import io.swagger.client.api.AnotherFakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import io.swagger.client.ApiClient; -import io.swagger.client.model.Client; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; +import org.junit.Ignore; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static io.swagger.client.GsonObjectMapper.gson; @@ -46,9 +51,9 @@ public class AnotherFakeApiTest { */ @Test public void shouldSee200AfterTestSpecialTags() { - Client body = null; + Client client = null; api.testSpecialTags() - .body(body).execute(r -> r.prettyPeek()); + .body(client).execute(r -> r.prettyPeek()); // TODO: test validations } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeApiTest.java index cc77c0e9b91..85e4f0c9d39 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -13,20 +13,25 @@ package io.swagger.client.api; -import io.restassured.builder.RequestSpecBuilder; -import io.restassured.filter.log.ErrorLoggingFilter; -import io.swagger.client.ApiClient; +import java.math.BigDecimal; import io.swagger.client.model.Client; -import io.swagger.client.model.OuterComposite; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; +import io.swagger.client.ApiClient; +import io.swagger.client.api.FakeApi; +import io.restassured.builder.RequestSpecBuilder; +import io.restassured.filter.log.ErrorLoggingFilter; +import org.junit.Before; +import org.junit.Test; +import org.junit.Ignore; -import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; - +import java.util.Map; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static io.swagger.client.GsonObjectMapper.gson; @@ -52,7 +57,7 @@ public class FakeApiTest { */ @Test public void shouldSee200AfterFakeOuterBooleanSerialize() { - Boolean body = null; + Boolean booleanPostBody = null; api.fakeOuterBooleanSerialize().execute(r -> r.prettyPeek()); // TODO: test validations } @@ -63,7 +68,7 @@ public class FakeApiTest { */ @Test public void shouldSee200AfterFakeOuterCompositeSerialize() { - OuterComposite body = null; + OuterComposite outerComposite = null; api.fakeOuterCompositeSerialize().execute(r -> r.prettyPeek()); // TODO: test validations } @@ -91,14 +96,28 @@ public class FakeApiTest { } + /** + * Success + */ + @Test + public void shouldSee200AfterTestBodyWithQueryParams() { + String query = null; + User user = null; + api.testBodyWithQueryParams() + .queryQuery(query) + .body(user).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** * successful operation */ @Test public void shouldSee200AfterTestClientModel() { - Client body = null; + Client client = null; api.testClientModel() - .body(body).execute(r -> r.prettyPeek()); + .body(client).execute(r -> r.prettyPeek()); // TODO: test validations } @@ -117,7 +136,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -144,7 +163,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -163,14 +182,14 @@ public class FakeApiTest { */ @Test public void shouldSee400AfterTestEnumParameters() { - List enumFormStringArray = null; - String enumFormString = null; String enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; api.testEnumParameters().execute(r -> r.prettyPeek()); // TODO: test validations } @@ -180,14 +199,14 @@ public class FakeApiTest { */ @Test public void shouldSee404AfterTestEnumParameters() { - List enumFormStringArray = null; - String enumFormString = null; String enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; api.testEnumParameters().execute(r -> r.prettyPeek()); // TODO: test validations } @@ -198,9 +217,9 @@ public class FakeApiTest { */ @Test public void shouldSee200AfterTestInlineAdditionalProperties() { - Object param = null; + String requestBody = null; api.testInlineAdditionalProperties() - .body(param).execute(r -> r.prettyPeek()); + .body(requestBody).execute(r -> r.prettyPeek()); // TODO: test validations } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 21f82221826..a18b4d779ed 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -13,14 +13,19 @@ package io.swagger.client.api; +import io.swagger.client.model.Client; +import io.swagger.client.ApiClient; +import io.swagger.client.api.FakeClassnameTags123Api; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import io.swagger.client.ApiClient; -import io.swagger.client.model.Client; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; +import org.junit.Ignore; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static io.swagger.client.GsonObjectMapper.gson; @@ -46,9 +51,9 @@ public class FakeClassnameTags123ApiTest { */ @Test public void shouldSee200AfterTestClassname() { - Client body = null; + Client client = null; api.testClassname() - .body(body).execute(r -> r.prettyPeek()); + .body(client).execute(r -> r.prettyPeek()); // TODO: test validations } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/PetApiTest.java index 3ba3a116092..e931663362e 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/PetApiTest.java @@ -13,39 +13,29 @@ package io.swagger.client.api; +import java.io.File; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import io.swagger.client.ApiClient; +import io.swagger.client.api.PetApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import io.swagger.client.ApiClient; -import io.swagger.client.model.Category; -import io.swagger.client.model.Pet; import org.junit.Before; import org.junit.Test; +import org.junit.Ignore; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Arrays; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; -import java.util.stream.Collectors; - -import static io.restassured.RestAssured.config; +import java.util.Map; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; +import static io.restassured.config.RestAssuredConfig.config; import static io.swagger.client.GsonObjectMapper.gson; -import static io.swagger.client.ResponseSpecBuilders.shouldBeCode; -import static io.swagger.client.ResponseSpecBuilders.validatedWith; -import static io.swagger.client.model.Pet.StatusEnum.AVAILABLE; -import static io.swagger.client.model.Pet.StatusEnum.PENDING; -import static io.swagger.client.model.Pet.StatusEnum.SOLD; -import static org.apache.http.HttpStatus.SC_NOT_FOUND; -import static org.apache.http.HttpStatus.SC_OK; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.MatcherAssert.assertThat; /** * API tests for PetApi */ +@Ignore public class PetApiTest { private PetApi api; @@ -58,65 +48,170 @@ public class PetApiTest { .setBaseUri("http://petstore.swagger.io:80/v2"))).pet(); } + /** + * Invalid input + */ @Test - public void statusListTest() { - Pet pet = getPet(); - api.addPet().body(pet.status(PENDING)).execute(validatedWith(shouldBeCode(SC_OK))); - List statusList = Arrays.asList(PENDING.getValue()); - List petsId = api.findPetsByStatus() - .statusQuery(statusList.toArray()).executeAs(validatedWith(shouldBeCode(SC_OK))) - .stream().map(Pet::getId).collect(Collectors.toList()); - assertThat(petsId, hasItem(pet.getId())); - api.deletePet().petIdPath(pet.getId()).execute(validatedWith(shouldBeCode(SC_OK))); + public void shouldSee405AfterAddPet() { + Pet pet = null; + api.addPet() + .body(pet).execute(r -> r.prettyPeek()); + // TODO: test validations } + + /** + * Invalid pet value + */ @Test - public void getPetByIdTest() { - Pet pet = getPet(); - api.addPet().body(pet.status(PENDING)).execute(validatedWith(shouldBeCode(SC_OK))); - Pet fetchedPet = api.getPetById() - .petIdPath(pet.getId()).executeAs(validatedWith(shouldBeCode(SC_OK))); - assertThat(fetchedPet.getId(), equalTo(pet.getId())); - api.deletePet().petIdPath(pet.getId()).execute(validatedWith(shouldBeCode(SC_OK))); + public void shouldSee400AfterDeletePet() { + Long petId = null; + String apiKey = null; + api.deletePet() + .petIdPath(petId).execute(r -> r.prettyPeek()); + // TODO: test validations } + + /** + * successful operation + */ @Test - public void deletePet() { - Pet pet = getPet(); - api.addPet().body(pet.status(PENDING)).execute(validatedWith(shouldBeCode(SC_OK))); - api.deletePet().petIdPath(pet.getId()).execute(validatedWith(shouldBeCode(SC_OK))); + public void shouldSee200AfterFindPetsByStatus() { + List status = null; + api.findPetsByStatus() + .statusQuery(status).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Invalid status value + */ + @Test + public void shouldSee400AfterFindPetsByStatus() { + List status = null; + api.findPetsByStatus() + .statusQuery(status).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * successful operation + */ + @Test + public void shouldSee200AfterFindPetsByTags() { + List tags = null; + api.findPetsByTags() + .tagsQuery(tags).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Invalid tag value + */ + @Test + public void shouldSee400AfterFindPetsByTags() { + List tags = null; + api.findPetsByTags() + .tagsQuery(tags).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * successful operation + */ + @Test + public void shouldSee200AfterGetPetById() { + Long petId = null; api.getPetById() - .petIdPath(pet.getId()).execute(validatedWith(shouldBeCode(SC_NOT_FOUND))); + .petIdPath(petId).execute(r -> r.prettyPeek()); + // TODO: test validations } + /** + * Invalid ID supplied + */ @Test - public void uploadFileTest() throws IOException { - Pet pet = getPet(); - api.addPet().body(pet).execute(validatedWith(shouldBeCode(SC_OK))); - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - api.uploadFile().fileMultiPart(file) - .petIdPath(pet.getId()).execute(validatedWith(shouldBeCode(SC_OK))); - api.deletePet().petIdPath(pet.getId()).execute(validatedWith(shouldBeCode(SC_OK))); + public void shouldSee400AfterGetPetById() { + Long petId = null; + api.getPetById() + .petIdPath(petId).execute(r -> r.prettyPeek()); + // TODO: test validations } + /** + * Pet not found + */ @Test - public void updatePetTest() { - Pet pet = getPet(); - api.addPet().body(pet).execute(validatedWith(shouldBeCode(SC_OK))); - api.updatePet().body(pet.status(SOLD)).execute(validatedWith(shouldBeCode(SC_OK))); - Pet.StatusEnum statusEnum = api.getPetById().petIdPath(pet.getId()).executeAs(validatedWith(shouldBeCode(SC_OK))).getStatus(); - assertThat(statusEnum, equalTo(SOLD)); - api.deletePet().petIdPath(pet.getId()).execute(validatedWith(shouldBeCode(SC_OK))); + public void shouldSee404AfterGetPetById() { + Long petId = null; + api.getPetById() + .petIdPath(petId).execute(r -> r.prettyPeek()); + // TODO: test validations } - private Pet getPet() { - return new Pet().id(TestUtils.nextId()).name("alex").status(AVAILABLE) - .category(new Category().id(TestUtils.nextId()).name("dog")) - .photoUrls(Arrays.asList("http://foo.bar.com/1")); + /** + * Invalid ID supplied + */ + @Test + public void shouldSee400AfterUpdatePet() { + Pet pet = null; + api.updatePet() + .body(pet).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Pet not found + */ + @Test + public void shouldSee404AfterUpdatePet() { + Pet pet = null; + api.updatePet() + .body(pet).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Validation exception + */ + @Test + public void shouldSee405AfterUpdatePet() { + Pet pet = null; + api.updatePet() + .body(pet).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * Invalid input + */ + @Test + public void shouldSee405AfterUpdatePetWithForm() { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm() + .petIdPath(petId).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * successful operation + */ + @Test + public void shouldSee200AfterUploadFile() { + Long petId = null; + String additionalMetadata = null; + File file = null; + api.uploadFile() + .petIdPath(petId).execute(r -> r.prettyPeek()); + // TODO: test validations } } \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/StoreApiTest.java index 033a6a4fc8c..9bdaadcdd2d 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -13,30 +13,27 @@ package io.swagger.client.api; +import io.swagger.client.model.Order; +import io.swagger.client.ApiClient; +import io.swagger.client.api.StoreApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import io.swagger.client.ApiClient; -import io.swagger.client.model.Order; import org.junit.Before; import org.junit.Test; -import org.threeten.bp.OffsetDateTime; +import org.junit.Ignore; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; - import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static io.swagger.client.GsonObjectMapper.gson; -import static io.swagger.client.ResponseSpecBuilders.shouldBeCode; -import static io.swagger.client.ResponseSpecBuilders.validatedWith; -import static org.apache.http.HttpStatus.SC_NOT_FOUND; -import static org.apache.http.HttpStatus.SC_OK; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.greaterThan; /** * API tests for StoreApi */ +@Ignore public class StoreApiTest { private StoreApi api; @@ -49,36 +46,93 @@ public class StoreApiTest { .setBaseUri("http://petstore.swagger.io:80/v2"))).store(); } + /** + * Invalid ID supplied + */ @Test - public void getInventoryTest() { - Map inventory = api.getInventory().executeAs(validatedWith(shouldBeCode(SC_OK))); - assertThat(inventory.keySet().size(), greaterThan(0)); + public void shouldSee400AfterDeleteOrder() { + String orderId = null; + api.deleteOrder() + .orderIdPath(orderId).execute(r -> r.prettyPeek()); + // TODO: test validations } + /** + * Order not found + */ @Test - public void getOrderByIdTest() { - Order order = getOrder(); - api.placeOrder().body(order).execute(validatedWith(shouldBeCode(SC_OK))); - Long orderId = api.getOrderById() - .orderIdPath(order.getId()).executeAs(validatedWith(shouldBeCode(SC_OK))).getId(); - assertThat(orderId, equalTo(order.getId())); - api.deleteOrder().orderIdPath(orderId).execute(validatedWith(shouldBeCode(SC_OK))); - + public void shouldSee404AfterDeleteOrder() { + String orderId = null; + api.deleteOrder() + .orderIdPath(orderId).execute(r -> r.prettyPeek()); + // TODO: test validations } + + /** + * successful operation + */ @Test - public void placeAndDeleteOrderTest() { - Order order = getOrder(); - Long id = api.placeOrder() - .body(order).executeAs(validatedWith(shouldBeCode(SC_OK))).getId(); - api.deleteOrder().orderIdPath(id) - .execute(validatedWith(shouldBeCode(SC_OK))); - api.getOrderById().orderIdPath(order.getId()).execute(validatedWith(shouldBeCode(SC_NOT_FOUND))); + public void shouldSee200AfterGetInventory() { + api.getInventory().execute(r -> r.prettyPeek()); + // TODO: test validations } - private Order getOrder() { - return new Order().id(TestUtils.nextId()).complete(false).petId(0L) - .quantity(111).status(Order.StatusEnum.DELIVERED).shipDate(OffsetDateTime.now().withNano(123000000)); + + /** + * successful operation + */ + @Test + public void shouldSee200AfterGetOrderById() { + Long orderId = null; + api.getOrderById() + .orderIdPath(orderId).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Invalid ID supplied + */ + @Test + public void shouldSee400AfterGetOrderById() { + Long orderId = null; + api.getOrderById() + .orderIdPath(orderId).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Order not found + */ + @Test + public void shouldSee404AfterGetOrderById() { + Long orderId = null; + api.getOrderById() + .orderIdPath(orderId).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * successful operation + */ + @Test + public void shouldSee200AfterPlaceOrder() { + Order order = null; + api.placeOrder() + .body(order).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Invalid Order + */ + @Test + public void shouldSee400AfterPlaceOrder() { + Order order = null; + api.placeOrder() + .body(order).execute(r -> r.prettyPeek()); + // TODO: test validations } } \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/TestUtils.java b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/TestUtils.java deleted file mode 100644 index 776dd8aa63f..00000000000 --- a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/TestUtils.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.swagger.client.api; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} - diff --git a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/UserApiTest.java index 61b7775ef00..e8efebee590 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/io/swagger/client/api/UserApiTest.java @@ -13,31 +13,27 @@ package io.swagger.client.api; +import io.swagger.client.model.User; +import io.swagger.client.ApiClient; +import io.swagger.client.api.UserApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import io.swagger.client.ApiClient; -import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; +import org.junit.Ignore; -import java.util.Arrays; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; - +import java.util.Map; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static io.swagger.client.GsonObjectMapper.gson; -import static io.swagger.client.ResponseSpecBuilders.shouldBeCode; -import static io.swagger.client.ResponseSpecBuilders.validatedWith; -import static io.swagger.client.api.TestUtils.nextId; -import static org.apache.http.HttpStatus.SC_OK; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.notNullValue; /** * API tests for UserApi */ +@Ignore public class UserApiTest { private UserApi api; @@ -50,83 +46,160 @@ public class UserApiTest { .setBaseUri("http://petstore.swagger.io:80/v2"))).user(); } + /** + * successful operation + */ @Test - public void createUsersWithArrayInputTest() { - User first = getUser().id(nextId()); - User second = getUser().id(nextId()); - List body = Arrays.asList(first, second); + public void shouldSee0AfterCreateUser() { + User user = null; + api.createUser() + .body(user).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * successful operation + */ + @Test + public void shouldSee0AfterCreateUsersWithArrayInput() { + List user = null; api.createUsersWithArrayInput() - .body(body).execute(validatedWith(shouldBeCode(SC_OK))); - api.deleteUser().usernamePath(first.getUsername()).execute( - validatedWith(shouldBeCode(SC_OK))); + .body(user).execute(r -> r.prettyPeek()); + // TODO: test validations } + + /** + * successful operation + */ @Test - public void createUsersWithListInputTest() { - User first = getUser().id(nextId()); - User second = getUser().id(nextId()); - List body = Arrays.asList(first, second); + public void shouldSee0AfterCreateUsersWithListInput() { + List user = null; api.createUsersWithListInput() - .body(body).execute(validatedWith(shouldBeCode(SC_OK))); - api.deleteUser().usernamePath(first.getUsername()).execute( - validatedWith(shouldBeCode(SC_OK))); + .body(user).execute(r -> r.prettyPeek()); + // TODO: test validations } - @Test - public void createUserTest() { - String userName = "Blah"; - User user = getUser().username(userName); - api.createUser().body(user).execute(validatedWith(shouldBeCode(SC_OK))); - User fetched = api.getUserByName() - .usernamePath(userName).executeAs(validatedWith(shouldBeCode(SC_OK))); - assertThat(fetched, notNullValue()); - assertThat(fetched.getUsername(), equalTo(userName)); - assertThat(fetched.getPassword(), equalTo(user.getPassword())); - assertThat(fetched.getEmail(), equalTo(user.getEmail())); - assertThat(fetched.getFirstName(), equalTo(user.getFirstName())); - assertThat(fetched.getLastName(), equalTo(user.getLastName())); - assertThat(fetched.getId(), equalTo(user.getId())); - api.deleteUser().usernamePath(user.getUsername()).execute( - validatedWith(shouldBeCode(SC_OK))); + /** + * Invalid username supplied + */ + @Test + public void shouldSee400AfterDeleteUser() { + String username = null; + api.deleteUser() + .usernamePath(username).execute(r -> r.prettyPeek()); + // TODO: test validations } + /** + * User not found + */ @Test - public void loginTest() { - String username = "a"; - String password = "b"; - String result = api.loginUser() + public void shouldSee404AfterDeleteUser() { + String username = null; + api.deleteUser() + .usernamePath(username).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * successful operation + */ + @Test + public void shouldSee200AfterGetUserByName() { + String username = null; + api.getUserByName() + .usernamePath(username).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * Invalid username supplied + */ + @Test + public void shouldSee400AfterGetUserByName() { + String username = null; + api.getUserByName() + .usernamePath(username).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + /** + * User not found + */ + @Test + public void shouldSee404AfterGetUserByName() { + String username = null; + api.getUserByName() + .usernamePath(username).execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * successful operation + */ + @Test + public void shouldSee200AfterLoginUser() { + String username = null; + String password = null; + api.loginUser() .usernameQuery(username) - .passwordQuery(password).executeAs(validatedWith(shouldBeCode(SC_OK))); - assertThat(result, containsString("logged in user session")); - + .passwordQuery(password).execute(r -> r.prettyPeek()); + // TODO: test validations } + /** + * Invalid username/password supplied + */ @Test - public void logoutTest() { - api.logoutUser().execute(validatedWith(shouldBeCode(SC_OK))); + public void shouldSee400AfterLoginUser() { + String username = null; + String password = null; + api.loginUser() + .usernameQuery(username) + .passwordQuery(password).execute(r -> r.prettyPeek()); + // TODO: test validations } + + /** + * successful operation + */ @Test - public void updateUserTest() { - String username = "me"; - String email = "me@blah.com"; - User user = new User().username(username).email(email); - api.createUser().body(user).execute(validatedWith(shouldBeCode(SC_OK))); + public void shouldSee0AfterLogoutUser() { + api.logoutUser().execute(r -> r.prettyPeek()); + // TODO: test validations + } + + + /** + * Invalid user supplied + */ + @Test + public void shouldSee400AfterUpdateUser() { + String username = null; + User user = null; api.updateUser() .usernamePath(username) - .body(user).execute(validatedWith(shouldBeCode(SC_OK))); - User fetched = api.getUserByName().usernamePath(username).executeAs(validatedWith(shouldBeCode(SC_OK))); - assertThat(fetched, notNullValue()); - assertThat(fetched.getUsername(), equalTo(username)); - assertThat(fetched.getEmail(), equalTo(email)); - api.deleteUser().usernamePath(user.getUsername()).execute( - validatedWith(shouldBeCode(SC_OK))); - + .body(user).execute(r -> r.prettyPeek()); + // TODO: test validations } - private User getUser() { - return new User().id(nextId()).username("Username") - .email("blah@blah.com").firstName("Firstname").lastName("Lastname").userStatus(1); + /** + * User not found + */ + @Test + public void shouldSee404AfterUpdateUser() { + String username = null; + User user = null; + api.updateUser() + .usernamePath(username) + .body(user).execute(r -> r.prettyPeek()); + // TODO: test validations } + } \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator-ignore b/samples/client/petstore/java/resteasy/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator-ignore +++ b/samples/client/petstore/java/resteasy/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/resteasy/README.md b/samples/client/petstore/java/resteasy/README.md index 4e4673592f7..84993330d2c 100644 --- a/samples/client/petstore/java/resteasy/README.md +++ b/samples/client/petstore/java/resteasy/README.md @@ -1,155 +1,215 @@ -# swagger-java-client - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn deploy -``` - -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - io.swagger - swagger-java-client - 1.0.0 - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy -compile "io.swagger:swagger-java-client:1.0.0" -``` - -### Others - -At first generate the JAR by executing: - - mvn package - -Then manually install the following JARs: - -* target/swagger-java-client-1.0.0.jar -* target/lib/*.jar - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java - -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.PetApi; - -import java.io.File; -import java.util.*; - -public class PetApiExample { - - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store - try { - apiInstance.addPet(body); - } catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - e.printStackTrace(); - } - } -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - -## Documentation for Models - - - [Category](docs/Category.md) - - [ModelApiResponse](docs/ModelApiResponse.md) - - [Order](docs/Order.md) - - [Pet](docs/Pet.md) - - [Tag](docs/Tag.md) - - [User](docs/User.md) - - -## Documentation for Authorization - -Authentication schemes defined for the API: -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/oauth/dialog -- **Scopes**: - - write:pets: modify pets in your account - - read:pets: read your pets - - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -apiteam@swagger.io - +# petstore-resteasy + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + + +## Requirements + +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-resteasy + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools:petstore-resteasy:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/petstore-resteasy-1.0.0.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.AnotherFakeApi; + +import java.io.File; +import java.util.*; + +public class AnotherFakeApiExample { + + public static void main(String[] args) { + + AnotherFakeApi apiInstance = new AnotherFakeApi(); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +apiteam@swagger.io + diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 7153f2820a7..d2f9ff5b15b 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -82,7 +82,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-resteasy' + pom.artifactId = 'petstore-resteasy' } } diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index 7ef8075935f..fb8f636d356 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-resteasy", + organization := "org.openapitools", + name := "petstore-resteasy", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md b/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/resteasy/docs/EnumTest.md b/samples/client/petstore/java/resteasy/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/resteasy/docs/EnumTest.md +++ b/samples/client/petstore/java/resteasy/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/resteasy/docs/FormatTest.md b/samples/client/petstore/java/resteasy/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/resteasy/docs/FormatTest.md +++ b/samples/client/petstore/java/resteasy/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/resteasy/docs/Name.md b/samples/client/petstore/java/resteasy/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/resteasy/docs/Name.md +++ b/samples/client/petstore/java/resteasy/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/resteasy/docs/OuterBoolean.md b/samples/client/petstore/java/resteasy/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resteasy/docs/OuterNumber.md b/samples/client/petstore/java/resteasy/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resteasy/docs/OuterString.md b/samples/client/petstore/java/resteasy/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resteasy/docs/PetApi.md b/samples/client/petstore/java/resteasy/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/resteasy/docs/PetApi.md +++ b/samples/client/petstore/java/resteasy/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/resteasy/docs/SpecialModelName.md b/samples/client/petstore/java/resteasy/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/resteasy/docs/SpecialModelName.md +++ b/samples/client/petstore/java/resteasy/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/resteasy/docs/StoreApi.md b/samples/client/petstore/java/resteasy/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/resteasy/docs/StoreApi.md +++ b/samples/client/petstore/java/resteasy/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/resteasy/docs/UserApi.md b/samples/client/petstore/java/resteasy/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/resteasy/docs/UserApi.md +++ b/samples/client/petstore/java/resteasy/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 68d55e82a6c..275413705ca 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - io.swagger - swagger-petstore-resteasy + org.openapitools + petstore-resteasy jar - swagger-petstore-resteasy + petstore-resteasy 1.0.0 scm:git:git@github.com:swagger-api/swagger-mustache.git @@ -120,8 +120,7 @@ maven-compiler-plugin 2.5.1 - - 1.7 + 1.7 1.7 diff --git a/samples/client/petstore/java/resteasy/settings.gradle b/samples/client/petstore/java/resteasy/settings.gradle index 01f9d7ff1a3..7a90bf229d5 100644 --- a/samples/client/petstore/java/resteasy/settings.gradle +++ b/samples/client/petstore/java/resteasy/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-resteasy" \ No newline at end of file +rootProject.name = "petstore-resteasy" \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 82673918c35..6d58a7f175b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -37,16 +37,16 @@ public class AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client body) throws ApiException { - Object localVarPostBody = body; + public Client testSpecialTags(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); } // create path and map variables diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java index 9a9757e898b..36ecc92ae13 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java @@ -9,9 +9,11 @@ import javax.ws.rs.core.GenericType; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -41,12 +43,12 @@ public class FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean * @throws ApiException if fails to make API call */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - Object localVarPostBody = body; + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws ApiException { + Object localVarPostBody = booleanPostBody; // create path and map variables String localVarPath = "/fake/outer/boolean".replaceAll("\\{format\\}","json"); @@ -60,7 +62,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -77,12 +79,12 @@ public class FakeApi { /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException if fails to make API call */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - Object localVarPostBody = body; + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + Object localVarPostBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite".replaceAll("\\{format\\}","json"); @@ -96,7 +98,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -132,7 +134,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -168,7 +170,7 @@ public class FakeApi { final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -182,19 +184,66 @@ public class FakeApi { GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-query-params".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClientModel(Client body) throws ApiException { - Object localVarPostBody = body; + public Client testClientModel(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); } // create path and map variables @@ -242,7 +291,7 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'number' is set @@ -305,12 +354,12 @@ if (paramCallback != null) localVarFormParams.put("callback", paramCallback); final String[] localVarAccepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -322,17 +371,17 @@ if (paramCallback != null) /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @throws ApiException if fails to make API call */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -346,6 +395,7 @@ if (paramCallback != null) localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); @@ -356,16 +406,14 @@ if (enumHeaderString != null) localVarFormParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); -if (enumQueryDouble != null) - localVarFormParams.put("enum_query_double", enumQueryDouble); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); @@ -377,15 +425,15 @@ if (enumQueryDouble != null) /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - Object localVarPostBody = param; + public void testInlineAdditionalProperties(String requestBody) throws ApiException { + Object localVarPostBody = requestBody; - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -455,7 +503,7 @@ if (param2 != null) final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 81d87f96dbf..38776d56363 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -37,16 +37,16 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testClassname(Client body) throws ApiException { - Object localVarPostBody = body; + public Client testClassname(Client client) throws ApiException { + Object localVarPostBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); } // create path and map variables diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/PetApi.java index d95172a9741..bb08caf617d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/PetApi.java @@ -39,15 +39,15 @@ public class PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void addPet(Pet body) throws ApiException { - Object localVarPostBody = body; + public void addPet(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } // create path and map variables @@ -62,7 +62,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -106,7 +106,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -251,15 +251,15 @@ public class PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void updatePet(Pet body) throws ApiException { - Object localVarPostBody = body; + public void updatePet(Pet pet) throws ApiException { + Object localVarPostBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } // create path and map variables @@ -274,7 +274,7 @@ public class PetApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -321,7 +321,7 @@ if (status != null) localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/StoreApi.java index 715d6f6f10e..82b8805b589 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/StoreApi.java @@ -61,7 +61,7 @@ public class StoreApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -155,16 +155,16 @@ public class StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException if fails to make API call */ - public Order placeOrder(Order body) throws ApiException { - Object localVarPostBody = body; + public Order placeOrder(Order order) throws ApiException { + Object localVarPostBody = order; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } // create path and map variables diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/UserApi.java index 41c494040e0..14ea6c93ca7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/UserApi.java @@ -37,15 +37,15 @@ public class UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException if fails to make API call */ - public void createUser(User body) throws ApiException { - Object localVarPostBody = body; + public void createUser(User user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } // create path and map variables @@ -60,7 +60,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -77,15 +77,15 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithArrayInput(List body) throws ApiException { - Object localVarPostBody = body; + public void createUsersWithArrayInput(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } // create path and map variables @@ -100,7 +100,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -117,15 +117,15 @@ public class UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithListInput(List body) throws ApiException { - Object localVarPostBody = body; + public void createUsersWithListInput(List user) throws ApiException { + Object localVarPostBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } // create path and map variables @@ -140,7 +140,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -181,7 +181,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -306,7 +306,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -324,20 +324,20 @@ public class UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException if fails to make API call */ - public void updateUser(String username, User body) throws ApiException { - Object localVarPostBody = body; + public void updateUser(String username, User user) throws ApiException { + Object localVarPostBody = user; // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables @@ -353,7 +353,7 @@ public class UserApi { final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java index 193d7f101db..2bb7dd17d43 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java @@ -67,6 +67,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -164,6 +204,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -229,6 +287,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -236,7 +295,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -246,6 +305,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java index 67879022f96..5f601300b95 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -55,7 +56,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -223,7 +224,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -233,11 +234,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -331,7 +332,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -340,7 +341,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java index 38fb1481a3d..46fb5650ff0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java @@ -78,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java index a62db5e76e6..e12c1072478 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java @@ -37,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -85,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -106,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -123,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java index 209b4263f7e..3676b70365a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -27,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -56,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -71,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..0c06fbf57ca 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -42,8 +42,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java index f7a75022194..7de631a091e 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,9 +16,11 @@ package io.swagger.client.api; import io.swagger.client.ApiException; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -46,8 +48,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -62,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -100,6 +102,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -110,8 +129,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -135,7 +154,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -155,15 +174,31 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..7b603d245c1 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,15 +35,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/PetApiTest.java index 8a39ab3b78b..1801332c609 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,168 +1,170 @@ -/* - * 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. - * - * 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.api; - -import io.swagger.client.ApiException; -import java.io.File; -import io.swagger.client.model.ModelApiResponse; -import io.swagger.client.model.Pet; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for PetApi - */ -public class PetApiTest { - - private final PetApi api = new PetApi(); - - - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void addPetTest() throws ApiException { - Pet body = null; - // api.addPet(body); - - // TODO: test validations - } - - /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deletePetTest() throws ApiException { - Long petId = null; - String apiKey = null; - // api.deletePet(petId, apiKey); - - // TODO: test validations - } - - /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void findPetsByStatusTest() throws ApiException { - List status = null; - // List response = api.findPetsByStatus(status); - - // TODO: test validations - } - - /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void findPetsByTagsTest() throws ApiException { - List tags = null; - // List response = api.findPetsByTags(tags); - - // TODO: test validations - } - - /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getPetByIdTest() throws ApiException { - Long petId = null; - // Pet response = api.getPetById(petId); - - // TODO: test validations - } - - /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updatePetTest() throws ApiException { - Pet body = null; - // api.updatePet(body); - - // TODO: test validations - } - - /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updatePetWithFormTest() throws ApiException { - Long petId = null; - String name = null; - String status = null; - // api.updatePetWithForm(petId, name, status); - - // TODO: test validations - } - - /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void uploadFileTest() throws ApiException { - Long petId = null; - String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - - // TODO: test validations - } - -} +/* + * 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.api; + +import io.swagger.client.ApiException; +import java.io.File; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PetApi + */ +@Ignore +public class PetApiTest { + + private final PetApi api = new PetApi(); + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() throws ApiException { + Pet pet = null; + api.addPet(pet); + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() throws ApiException { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + Long petId = null; + Pet response = api.getPetById(petId); + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + Pet pet = null; + api.updatePet(pet); + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws ApiException { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + Long petId = null; + String additionalMetadata = null; + File file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/StoreApiTest.java index 290eb06ebe6..956978b470c 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,96 +1,98 @@ -/* - * 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. - * - * 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.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.Order; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for StoreApi - */ -public class StoreApiTest { - - private final StoreApi api = new StoreApi(); - - - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deleteOrderTest() throws ApiException { - Long orderId = null; - // api.deleteOrder(orderId); - - // TODO: test validations - } - - /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getInventoryTest() throws ApiException { - // Map response = api.getInventory(); - - // TODO: test validations - } - - /** - * Find purchase order by ID - * - * For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getOrderByIdTest() throws ApiException { - Long orderId = null; - // Order response = api.getOrderById(orderId); - - // TODO: test validations - } - - /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void placeOrderTest() throws ApiException { - Order body = null; - // Order response = api.placeOrder(body); - - // TODO: test validations - } - -} +/* + * 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.api; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for StoreApi + */ +@Ignore +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() throws ApiException { + Long orderId = null; + Order response = api.getOrderById(orderId); + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + Order order = null; + Order response = api.placeOrder(order); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/UserApiTest.java index 83845743210..411e031d0d3 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,162 +1,164 @@ -/* - * 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. - * - * 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.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.User; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for UserApi - */ -public class UserApiTest { - - private final UserApi api = new UserApi(); - - - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUserTest() throws ApiException { - User body = null; - // api.createUser(body); - - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - // api.createUsersWithArrayInput(body); - - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUsersWithListInputTest() throws ApiException { - List body = null; - // api.createUsersWithListInput(body); - - // TODO: test validations - } - - /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deleteUserTest() throws ApiException { - String username = null; - // api.deleteUser(username); - - // TODO: test validations - } - - /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getUserByNameTest() throws ApiException { - String username = null; - // User response = api.getUserByName(username); - - // TODO: test validations - } - - /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void loginUserTest() throws ApiException { - String username = null; - String password = null; - // String response = api.loginUser(username, password); - - // TODO: test validations - } - - /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void logoutUserTest() throws ApiException { - // api.logoutUser(); - - // TODO: test validations - } - - /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updateUserTest() throws ApiException { - String username = null; - User body = null; - // api.updateUser(username, body); - - // TODO: test validations - } - -} +/* + * 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.api; + +import io.swagger.client.ApiException; +import io.swagger.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for UserApi + */ +@Ignore +public class UserApiTest { + + private final UserApi api = new UserApi(); + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + User user = null; + api.createUser(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + List user = null; + api.createUsersWithArrayInput(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + List user = null; + api.createUsersWithListInput(user); + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + api.logoutUser(); + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User user = null; + api.updateUser(username, user); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator-ignore b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator-ignore +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/resttemplate-withXml/README.md b/samples/client/petstore/java/resttemplate-withXml/README.md index 6435fa1c756..1ba2cd065ca 100644 --- a/samples/client/petstore/java/resttemplate-withXml/README.md +++ b/samples/client/petstore/java/resttemplate-withXml/README.md @@ -1,24 +1,35 @@ -# swagger-petstore-resttemplate +# pestore-resttemplate-withxml + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-resttemplate - 1.0.0 - compile + org.openapitools + pestore-resttemplate-withxml + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-resttemplate:1.0.0" +compile "org.openapitools:pestore-resttemplate-withxml:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-resttemplate-1.0.0.jar -* target/lib/*.jar +* `target/pestore-resttemplate-withxml-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -61,22 +74,22 @@ Please follow the [installation](#installation) instruction and execute the foll import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; -import io.swagger.client.api.FakeApi; +import io.swagger.client.api.AnotherFakeApi; import java.io.File; import java.util.*; -public class FakeApiExample { +public class AnotherFakeApiExample { public static void main(String[] args) { - FakeApi apiInstance = new FakeApi(); - Boolean body = true; // Boolean | Input boolean as post body + AnotherFakeApi apiInstance = new AnotherFakeApi(); + Client client = new Client(); // Client | client model try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); e.printStackTrace(); } } @@ -90,13 +103,18 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -128,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -144,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -164,6 +185,12 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + ### http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 5e035a97697..1d6787e3dbe 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-pestore-resttemplate-withxml' + pom.artifactId = 'pestore-resttemplate-withxml' } } diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Name.md b/samples/client/petstore/java/resttemplate-withXml/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Name.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/OuterBoolean.md b/samples/client/petstore/java/resttemplate-withXml/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/OuterNumber.md b/samples/client/petstore/java/resttemplate-withXml/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/OuterString.md b/samples/client/petstore/java/resttemplate-withXml/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md b/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/StoreApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/StoreApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index a0044849956..e8c5b512c7a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger + org.openapitools pestore-resttemplate-withxml jar pestore-resttemplate-withxml 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org @@ -139,8 +139,7 @@ maven-compiler-plugin 3.6.1 - - 1.7 + 1.7 1.7 diff --git a/samples/client/petstore/java/resttemplate-withXml/settings.gradle b/samples/client/petstore/java/resttemplate-withXml/settings.gradle index 47a3e512775..c653f9d22b5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/settings.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-pestore-resttemplate-withxml" \ No newline at end of file +rootProject.name = "pestore-resttemplate-withxml" \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 6992e1f5f42..1b1e0c8acd7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -49,16 +49,16 @@ public class AnotherFakeApi { * To test special tags * To test special tags *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testSpecialTags(Client body) throws RestClientException { - Object postBody = body; + public Client testSpecialTags(Client client) throws RestClientException { + Object postBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testSpecialTags"); + // verify the required parameter 'client' is set + if (client == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testSpecialTags"); } String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeApi.java index 9bb930c3003..90ba9b69fc7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeApi.java @@ -4,9 +4,11 @@ import io.swagger.client.ApiClient; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -53,12 +55,12 @@ public class FakeApi { * * Test serialization of outer boolean types *

200 - Output boolean - * @param body Input boolean as post body + * @param booleanPostBody Input boolean as post body * @return Boolean * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientException { - Object postBody = body; + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws RestClientException { + Object postBody = booleanPostBody; String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString(); @@ -66,7 +68,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -80,12 +84,12 @@ public class FakeApi { * * Test serialization of object with outer number type *

200 - Output composite - * @param body Input composite as post body + * @param outerComposite Input composite as post body * @return OuterComposite * @throws RestClientException if an error occurs while attempting to invoke the API */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException { - Object postBody = body; + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws RestClientException { + Object postBody = outerComposite; String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString(); @@ -93,7 +97,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -120,7 +126,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -147,7 +155,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -157,20 +167,61 @@ public class FakeApi { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * + *

200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testBodyWithQueryParams(String query, User user) throws RestClientException { + Object postBody = user; + + // verify the required parameter 'query' is set + if (query == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { + "application/json" + }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } /** * To test \"client\" model * To test \"client\" model *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testClientModel(Client body) throws RestClientException { - Object postBody = body; + public Client testClientModel(Client client) throws RestClientException { + Object postBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel"); + // verify the required parameter 'client' is set + if (client == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testClientModel"); } String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -214,7 +265,7 @@ public class FakeApi { * @param paramCallback None * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException { Object postBody = null; // verify the required parameter 'number' is set @@ -262,7 +313,7 @@ public class FakeApi { if (_byte != null) formParams.add("byte", _byte); if (binary != null) - formParams.add("binary", binary); + formParams.add("binary", new FileSystemResource(binary)); if (date != null) formParams.add("date", date); if (dateTime != null) @@ -272,12 +323,10 @@ public class FakeApi { if (paramCallback != null) formParams.add("callback", paramCallback); - final String[] accepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -291,17 +340,17 @@ public class FakeApi { * To test enum parameters *

400 - Invalid request *

404 - Not found - * @param enumFormStringArray Form parameter enum test (string array) - * @param enumFormString Form parameter enum test (string) * @param enumHeaderStringArray Header parameter enum test (string array) * @param enumHeaderString Header parameter enum test (string) * @param enumQueryStringArray Query parameter enum test (string array) * @param enumQueryString Query parameter enum test (string) * @param enumQueryInteger Query parameter enum test (double) * @param enumQueryDouble Query parameter enum test (double) + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws RestClientException { + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { Object postBody = null; String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -313,6 +362,7 @@ public class FakeApi { queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "enum_query_string_array", enumQueryStringArray)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); @@ -323,15 +373,11 @@ public class FakeApi { formParams.add("enum_form_string_array", enumFormStringArray); if (enumFormString != null) formParams.add("enum_form_string", enumFormString); - if (enumQueryDouble != null) - formParams.add("enum_query_double", enumQueryDouble); - final String[] accepts = { - "*/*" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -344,15 +390,15 @@ public class FakeApi { * test inline additionalProperties * *

200 - successful operation - * @param param request body + * @param requestBody request body * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void testInlineAdditionalProperties(Object param) throws RestClientException { - Object postBody = param; + public void testInlineAdditionalProperties(String requestBody) throws RestClientException { + Object postBody = requestBody; - // verify the required parameter 'param' is set - if (param == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString(); @@ -408,7 +454,7 @@ public class FakeApi { final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 7d5016df7ee..96621961a78 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -49,16 +49,16 @@ public class FakeClassnameTags123Api { * To test class name in snake case * To test class name in snake case *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testClassname(Client body) throws RestClientException { - Object postBody = body; + public Client testClassname(Client client) throws RestClientException { + Object postBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname"); + // verify the required parameter 'client' is set + if (client == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testClassname"); } String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/PetApi.java index 0d8436ccc63..61ad401ce2d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/PetApi.java @@ -51,15 +51,15 @@ public class PetApi { * Add a new pet to the store * *

405 - Invalid input - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void addPet(Pet body) throws RestClientException { - Object postBody = body; + public void addPet(Pet pet) throws RestClientException { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pet' when calling addPet"); } String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); @@ -68,9 +68,7 @@ public class PetApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json", "application/xml" @@ -110,9 +108,7 @@ public class PetApi { if (apiKey != null) headerParams.add("api_key", apiClient.parameterToString(apiKey)); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -241,15 +237,15 @@ public class PetApi { *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void updatePet(Pet body) throws RestClientException { - Object postBody = body; + public void updatePet(Pet pet) throws RestClientException { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pet' when calling updatePet"); } String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); @@ -258,9 +254,7 @@ public class PetApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json", "application/xml" @@ -303,9 +297,7 @@ public class PetApi { if (status != null) formParams.add("status", status); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/x-www-form-urlencoded" diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/StoreApi.java index bfe4173e279..3dba5f3e55d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/StoreApi.java @@ -70,9 +70,7 @@ public class StoreApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -154,16 +152,16 @@ public class StoreApi { * *

200 - successful operation *

400 - Invalid Order - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Order placeOrder(Order body) throws RestClientException { - Object postBody = body; + public Order placeOrder(Order order) throws RestClientException { + Object postBody = order; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder"); + // verify the required parameter 'order' is set + if (order == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'order' when calling placeOrder"); } String path = UriComponentsBuilder.fromPath("/store/order").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/UserApi.java index 019d802e215..38b2c1f409b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/UserApi.java @@ -49,15 +49,15 @@ public class UserApi { * Create user * This can only be done by the logged in user. *

0 - successful operation - * @param body Created user object + * @param user Created user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void createUser(User body) throws RestClientException { - Object postBody = body; + public void createUser(User user) throws RestClientException { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling createUser"); } String path = UriComponentsBuilder.fromPath("/user").build().toUriString(); @@ -66,9 +66,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -82,15 +80,15 @@ public class UserApi { * Creates list of users with given input array * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void createUsersWithArrayInput(List body) throws RestClientException { - Object postBody = body; + public void createUsersWithArrayInput(List user) throws RestClientException { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } String path = UriComponentsBuilder.fromPath("/user/createWithArray").build().toUriString(); @@ -99,9 +97,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -115,15 +111,15 @@ public class UserApi { * Creates list of users with given input array * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void createUsersWithListInput(List body) throws RestClientException { - Object postBody = body; + public void createUsersWithListInput(List user) throws RestClientException { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling createUsersWithListInput"); } String path = UriComponentsBuilder.fromPath("/user/createWithList").build().toUriString(); @@ -132,9 +128,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -169,9 +163,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -279,9 +271,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -297,20 +287,20 @@ public class UserApi { *

400 - Invalid user supplied *

404 - User not found * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void updateUser(String username, User body) throws RestClientException { - Object postBody = body; + public void updateUser(String username, User user) throws RestClientException { + Object postBody = user; // verify the required parameter 'username' is set if (username == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updateUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables @@ -322,9 +312,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java index 3827113df36..08d817e1952 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java @@ -74,6 +74,48 @@ public class EnumTest { @XmlElement(name = "enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + @JacksonXmlProperty(localName = "enum_string_required") + @XmlElement(name = "enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -177,6 +219,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -242,6 +302,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -249,7 +310,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -259,6 +320,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java index 4a80fc9cb4b..4fedbcafb20 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -78,7 +79,7 @@ public class FormatTest { @JsonProperty("binary") @JacksonXmlProperty(localName = "binary") @XmlElement(name = "binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") @JacksonXmlProperty(localName = "date") @@ -254,7 +255,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -264,11 +265,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -362,7 +363,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -371,7 +372,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java index 00f5d72f95a..5905fc5b062 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java @@ -87,9 +87,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java index 4d26d01e0c8..e8a9cd01f47 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java @@ -50,7 +50,7 @@ public class Name { @JsonProperty("123Number") @JacksonXmlProperty(localName = "123Number") @XmlElement(name = "123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -98,12 +98,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -119,12 +119,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -136,7 +136,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..8080e308e4e --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,68 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * OuterBoolean + */ + +@XmlRootElement(name = "OuterBoolean") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "OuterBoolean") +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..1ac57446b08 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,68 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * OuterNumber + */ + +@XmlRootElement(name = "OuterNumber") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "OuterNumber") +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..74e7d3bfa71 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,68 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * OuterString + */ + +@XmlRootElement(name = "OuterString") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "OuterString") +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java index c8804eb8955..21ce4535de7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -34,24 +34,24 @@ public class SpecialModelName { @JsonProperty("$special[property.name]") @JacksonXmlProperty(localName = "$special[property.name]") @XmlElement(name = "$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -63,13 +63,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -78,7 +78,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index c09af938647..ea1c4aa5267 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -41,8 +41,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeApiTest.java index 65b341a3c52..887356d2ff4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -15,9 +15,11 @@ package io.swagger.client.api; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -45,8 +47,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -61,8 +63,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -99,6 +101,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -109,8 +128,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -134,7 +153,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -154,15 +173,31 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 641e4fc7008..611f809195d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -34,15 +34,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/PetApiTest.java index f2c54db84a7..3485d9e04f6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/PetApiTest.java @@ -43,8 +43,8 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet body = null; - api.addPet(body); + Pet pet = null; + api.addPet(pet); // TODO: test validations } @@ -124,8 +124,8 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet body = null; - api.updatePet(body); + Pet pet = null; + api.updatePet(pet); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/StoreApiTest.java index 44d442e00ec..d5fe4c7775e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -88,8 +88,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order body = null; - Order response = api.placeOrder(body); + Order order = null; + Order response = api.placeOrder(order); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/UserApiTest.java index fca5f719231..7184bf98403 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/UserApiTest.java @@ -41,8 +41,8 @@ public class UserApiTest { */ @Test public void createUserTest() { - User body = null; - api.createUser(body); + User user = null; + api.createUser(user); // TODO: test validations } @@ -57,8 +57,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List body = null; - api.createUsersWithArrayInput(body); + List user = null; + api.createUsersWithArrayInput(user); // TODO: test validations } @@ -73,8 +73,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List body = null; - api.createUsersWithListInput(body); + List user = null; + api.createUsersWithListInput(user); // TODO: test validations } @@ -154,8 +154,8 @@ public class UserApiTest { @Test public void updateUserTest() { String username = null; - User body = null; - api.updateUser(username, body); + User user = null; + api.updateUser(username, user); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator-ignore b/samples/client/petstore/java/resttemplate/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator-ignore +++ b/samples/client/petstore/java/resttemplate/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/resttemplate/README.md b/samples/client/petstore/java/resttemplate/README.md index 4632c0742a4..512abe39785 100644 --- a/samples/client/petstore/java/resttemplate/README.md +++ b/samples/client/petstore/java/resttemplate/README.md @@ -1,24 +1,35 @@ -# swagger-petstore-resttemplate +# petstore-resttemplate + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-resttemplate - 1.0.0 - compile + org.openapitools + petstore-resttemplate + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-resttemplate:1.0.0" +compile "org.openapitools:petstore-resttemplate:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-resttemplate-1.0.0.jar -* target/lib/*.jar +* `target/petstore-resttemplate-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -61,22 +74,22 @@ Please follow the [installation](#installation) instruction and execute the foll import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; -import io.swagger.client.api.FakeApi; +import io.swagger.client.api.AnotherFakeApi; import java.io.File; import java.util.*; -public class FakeApiExample { +public class AnotherFakeApiExample { public static void main(String[] args) { - FakeApi apiInstance = new FakeApi(); - Boolean body = true; // Boolean | Input boolean as post body + AnotherFakeApi apiInstance = new AnotherFakeApi(); + Client client = new Client(); // Client | client model try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); e.printStackTrace(); } } @@ -90,13 +103,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store @@ -130,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -146,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -166,6 +185,12 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + ### http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index ef119a98b38..a6de57bd8cb 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-resttemplate' + pom.artifactId = 'petstore-resttemplate' } } diff --git a/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md index 7a04619aaba..a4e6f902bf9 100644 --- a/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/resttemplate/docs/EnumTest.md b/samples/client/petstore/java/resttemplate/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/resttemplate/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index 737ccc28293..cf5414fa9e1 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md index eb030817b50..01f56c717d8 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/resttemplate/docs/FormatTest.md b/samples/client/petstore/java/resttemplate/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/resttemplate/docs/FormatTest.md +++ b/samples/client/petstore/java/resttemplate/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/resttemplate/docs/Name.md b/samples/client/petstore/java/resttemplate/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/resttemplate/docs/Name.md +++ b/samples/client/petstore/java/resttemplate/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/resttemplate/docs/OuterBoolean.md b/samples/client/petstore/java/resttemplate/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate/docs/OuterNumber.md b/samples/client/petstore/java/resttemplate/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate/docs/OuterString.md b/samples/client/petstore/java/resttemplate/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate/docs/PetApi.md b/samples/client/petstore/java/resttemplate/docs/PetApi.md index b5fa395947d..d790ff3cd4d 100644 --- a/samples/client/petstore/java/resttemplate/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md b/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md +++ b/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/resttemplate/docs/StoreApi.md b/samples/client/petstore/java/resttemplate/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/resttemplate/docs/StoreApi.md +++ b/samples/client/petstore/java/resttemplate/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/resttemplate/docs/UserApi.md b/samples/client/petstore/java/resttemplate/docs/UserApi.md index 1c5218ac128..f982ddbf57b 100644 --- a/samples/client/petstore/java/resttemplate/docs/UserApi.md +++ b/samples/client/petstore/java/resttemplate/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index d209a61c146..9869bad196e 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-resttemplate + org.openapitools + petstore-resttemplate jar - swagger-petstore-resttemplate + petstore-resttemplate 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org @@ -139,8 +139,7 @@ maven-compiler-plugin 3.6.1 - - 1.7 + 1.7 1.7 diff --git a/samples/client/petstore/java/resttemplate/settings.gradle b/samples/client/petstore/java/resttemplate/settings.gradle index 09db544e8ba..edae24e952d 100644 --- a/samples/client/petstore/java/resttemplate/settings.gradle +++ b/samples/client/petstore/java/resttemplate/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-resttemplate" \ No newline at end of file +rootProject.name = "petstore-resttemplate" \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 6992e1f5f42..1b1e0c8acd7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -49,16 +49,16 @@ public class AnotherFakeApi { * To test special tags * To test special tags *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testSpecialTags(Client body) throws RestClientException { - Object postBody = body; + public Client testSpecialTags(Client client) throws RestClientException { + Object postBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testSpecialTags"); + // verify the required parameter 'client' is set + if (client == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testSpecialTags"); } String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java index 9bb930c3003..90ba9b69fc7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java @@ -4,9 +4,11 @@ import io.swagger.client.ApiClient; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -53,12 +55,12 @@ public class FakeApi { * * Test serialization of outer boolean types *

200 - Output boolean - * @param body Input boolean as post body + * @param booleanPostBody Input boolean as post body * @return Boolean * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientException { - Object postBody = body; + public Boolean fakeOuterBooleanSerialize(Boolean booleanPostBody) throws RestClientException { + Object postBody = booleanPostBody; String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString(); @@ -66,7 +68,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -80,12 +84,12 @@ public class FakeApi { * * Test serialization of object with outer number type *

200 - Output composite - * @param body Input composite as post body + * @param outerComposite Input composite as post body * @return OuterComposite * @throws RestClientException if an error occurs while attempting to invoke the API */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException { - Object postBody = body; + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws RestClientException { + Object postBody = outerComposite; String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString(); @@ -93,7 +97,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -120,7 +126,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -147,7 +155,9 @@ public class FakeApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; + final String[] accepts = { + "*/*" + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -157,20 +167,61 @@ public class FakeApi { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * + *

200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testBodyWithQueryParams(String query, User user) throws RestClientException { + Object postBody = user; + + // verify the required parameter 'query' is set + if (query == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { + "application/json" + }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } /** * To test \"client\" model * To test \"client\" model *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testClientModel(Client body) throws RestClientException { - Object postBody = body; + public Client testClientModel(Client client) throws RestClientException { + Object postBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel"); + // verify the required parameter 'client' is set + if (client == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testClientModel"); } String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -214,7 +265,7 @@ public class FakeApi { * @param paramCallback None * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException { Object postBody = null; // verify the required parameter 'number' is set @@ -262,7 +313,7 @@ public class FakeApi { if (_byte != null) formParams.add("byte", _byte); if (binary != null) - formParams.add("binary", binary); + formParams.add("binary", new FileSystemResource(binary)); if (date != null) formParams.add("date", date); if (dateTime != null) @@ -272,12 +323,10 @@ public class FakeApi { if (paramCallback != null) formParams.add("callback", paramCallback); - final String[] accepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" + "application/x-www-form-urlencoded" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -291,17 +340,17 @@ public class FakeApi { * To test enum parameters *

400 - Invalid request *

404 - Not found - * @param enumFormStringArray Form parameter enum test (string array) - * @param enumFormString Form parameter enum test (string) * @param enumHeaderStringArray Header parameter enum test (string array) * @param enumHeaderString Header parameter enum test (string) * @param enumQueryStringArray Query parameter enum test (string array) * @param enumQueryString Query parameter enum test (string) * @param enumQueryInteger Query parameter enum test (double) * @param enumQueryDouble Query parameter enum test (double) + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws RestClientException { + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { Object postBody = null; String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -313,6 +362,7 @@ public class FakeApi { queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "enum_query_string_array", enumQueryStringArray)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); @@ -323,15 +373,11 @@ public class FakeApi { formParams.add("enum_form_string_array", enumFormStringArray); if (enumFormString != null) formParams.add("enum_form_string", enumFormString); - if (enumQueryDouble != null) - formParams.add("enum_query_double", enumQueryDouble); - final String[] accepts = { - "*/*" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { - "*/*" + "application/x-www-form-urlencoded" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -344,15 +390,15 @@ public class FakeApi { * test inline additionalProperties * *

200 - successful operation - * @param param request body + * @param requestBody request body * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void testInlineAdditionalProperties(Object param) throws RestClientException { - Object postBody = param; + public void testInlineAdditionalProperties(String requestBody) throws RestClientException { + Object postBody = requestBody; - // verify the required parameter 'param' is set - if (param == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString(); @@ -408,7 +454,7 @@ public class FakeApi { final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { - "application/json" + "application/x-www-form-urlencoded" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 7d5016df7ee..96621961a78 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -49,16 +49,16 @@ public class FakeClassnameTags123Api { * To test class name in snake case * To test class name in snake case *

200 - successful operation - * @param body client model + * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testClassname(Client body) throws RestClientException { - Object postBody = body; + public Client testClassname(Client client) throws RestClientException { + Object postBody = client; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname"); + // verify the required parameter 'client' is set + if (client == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testClassname"); } String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/PetApi.java index 0d8436ccc63..61ad401ce2d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/PetApi.java @@ -51,15 +51,15 @@ public class PetApi { * Add a new pet to the store * *

405 - Invalid input - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void addPet(Pet body) throws RestClientException { - Object postBody = body; + public void addPet(Pet pet) throws RestClientException { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pet' when calling addPet"); } String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); @@ -68,9 +68,7 @@ public class PetApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json", "application/xml" @@ -110,9 +108,7 @@ public class PetApi { if (apiKey != null) headerParams.add("api_key", apiClient.parameterToString(apiKey)); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -241,15 +237,15 @@ public class PetApi { *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void updatePet(Pet body) throws RestClientException { - Object postBody = body; + public void updatePet(Pet pet) throws RestClientException { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pet' when calling updatePet"); } String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); @@ -258,9 +254,7 @@ public class PetApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json", "application/xml" @@ -303,9 +297,7 @@ public class PetApi { if (status != null) formParams.add("status", status); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/x-www-form-urlencoded" diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/StoreApi.java index bfe4173e279..3dba5f3e55d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/StoreApi.java @@ -70,9 +70,7 @@ public class StoreApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -154,16 +152,16 @@ public class StoreApi { * *

200 - successful operation *

400 - Invalid Order - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Order placeOrder(Order body) throws RestClientException { - Object postBody = body; + public Order placeOrder(Order order) throws RestClientException { + Object postBody = order; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder"); + // verify the required parameter 'order' is set + if (order == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'order' when calling placeOrder"); } String path = UriComponentsBuilder.fromPath("/store/order").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/UserApi.java index 019d802e215..38b2c1f409b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/UserApi.java @@ -49,15 +49,15 @@ public class UserApi { * Create user * This can only be done by the logged in user. *

0 - successful operation - * @param body Created user object + * @param user Created user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void createUser(User body) throws RestClientException { - Object postBody = body; + public void createUser(User user) throws RestClientException { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling createUser"); } String path = UriComponentsBuilder.fromPath("/user").build().toUriString(); @@ -66,9 +66,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -82,15 +80,15 @@ public class UserApi { * Creates list of users with given input array * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void createUsersWithArrayInput(List body) throws RestClientException { - Object postBody = body; + public void createUsersWithArrayInput(List user) throws RestClientException { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } String path = UriComponentsBuilder.fromPath("/user/createWithArray").build().toUriString(); @@ -99,9 +97,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -115,15 +111,15 @@ public class UserApi { * Creates list of users with given input array * *

0 - successful operation - * @param body List of user object + * @param user List of user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void createUsersWithListInput(List body) throws RestClientException { - Object postBody = body; + public void createUsersWithListInput(List user) throws RestClientException { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling createUsersWithListInput"); } String path = UriComponentsBuilder.fromPath("/user/createWithList").build().toUriString(); @@ -132,9 +128,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -169,9 +163,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -279,9 +271,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); @@ -297,20 +287,20 @@ public class UserApi { *

400 - Invalid user supplied *

404 - User not found * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @throws RestClientException if an error occurs while attempting to invoke the API */ - public void updateUser(String username, User body) throws RestClientException { - Object postBody = body; + public void updateUser(String username, User user) throws RestClientException { + Object postBody = user; // verify the required parameter 'username' is set if (username == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updateUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables @@ -322,9 +312,7 @@ public class UserApi { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { - "application/xml", "application/json" - }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java index 193d7f101db..2bb7dd17d43 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java @@ -67,6 +67,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -164,6 +204,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -229,6 +287,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -236,7 +295,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -246,6 +305,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java index 67879022f96..5f601300b95 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -55,7 +56,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -223,7 +224,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -233,11 +234,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -331,7 +332,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -340,7 +341,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java index 38fb1481a3d..46fb5650ff0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java @@ -78,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java index a62db5e76e6..e12c1072478 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java @@ -37,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -85,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -106,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -123,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java index 209b4263f7e..3676b70365a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -27,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -56,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -71,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/PetstoreProfiling.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/PetstoreProfiling.java deleted file mode 100644 index c35c2a0f796..00000000000 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/PetstoreProfiling.java +++ /dev/null @@ -1,107 +0,0 @@ -package io.swagger; - -import java.io.*; -import java.util.*; - -import io.swagger.client.*; -import io.swagger.client.api.*; -import io.swagger.client.model.*; -import org.springframework.web.client.HttpClientErrorException; - -public class PetstoreProfiling { - public int total = 5; - public Long newPetId = 50003L; - public String outputFile = "./petstore_profiling.output"; - - public void callApis(int index, List> results) { - long start; - - try { - PetApi petApi = new PetApi(); - - /* ADD PET */ - Pet pet = new Pet(); - pet.setId(newPetId); - pet.setName("profiler"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - pet.setPhotoUrls(Arrays.asList("http://profiler.com")); - // new tag - Tag tag = new Tag(); - tag.setId(newPetId); // use the same id as pet - tag.setName("profile tag 1"); - // new category - Category category = new Category(); - category.setId(newPetId); // use the same id as pet - category.setName("profile category 1"); - - pet.setTags(Arrays.asList(tag)); - pet.setCategory(category); - - /* ADD PET */ - start = System.nanoTime(); - petApi.addPet(pet); - results.add(buildResult(index, "ADD PET", System.nanoTime() - start)); - - /* GET PET */ - start = System.nanoTime(); - pet = petApi.getPetById(newPetId); - results.add(buildResult(index, "GET PET", System.nanoTime() - start)); - - /* UPDATE PET WITH FORM */ - start = System.nanoTime(); - petApi.updatePetWithForm(newPetId, "new profiler", "sold"); - results.add(buildResult(index, "UPDATE PET", System.nanoTime() - start)); - - /* DELETE PET */ - start = System.nanoTime(); - petApi.deletePet(newPetId, "special-key"); - results.add(buildResult(index, "DELETE PET", System.nanoTime() - start)); - } catch (HttpClientErrorException e) { - System.out.println("Caught error: " + e.getMessage()); - System.out.println("HTTP response headers: " + e.getResponseHeaders()); - System.out.println("HTTP response body: " + e.getResponseBodyAsString()); - System.out.println("HTTP status code: " + e.getStatusCode()); - } - } - - public void run() { - System.out.printf("Running profiling... (total: %s)\n", total); - - List> results = new ArrayList>(); - for (int i = 0; i < total; i++) { - callApis(i, results); - } - writeResultsToFile(results); - - System.out.printf("Profiling results written to %s\n", outputFile); - } - - private Map buildResult(int index, String name, long time) { - Map result = new HashMap(); - result.put("index", String.valueOf(index)); - result.put("name", name); - result.put("time", String.valueOf(time / 1000000000.0)); - return result; - } - - private void writeResultsToFile(List> results) { - try { - File file = new File(outputFile); - PrintWriter writer = new PrintWriter(file); - String command = "mvn compile test-compile exec:java -Dexec.classpathScope=test -Dexec.mainClass=\"io.swagger.PetstoreProfiling\""; - writer.println("# To run the profiling:"); - writer.printf("# %s\n\n", command); - for (Map result : results) { - writer.printf("%s: %s => %s\n", result.get("index"), result.get("name"), result.get("time")); - } - writer.close(); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - - public static void main(String[] args) { - final PetstoreProfiling profiling = new PetstoreProfiling(); - profiling.run(); - } -} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/ApiClientTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/ApiClientTest.java deleted file mode 100644 index 17953e3401a..00000000000 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/ApiClientTest.java +++ /dev/null @@ -1,254 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.junit.*; -import org.springframework.http.MediaType; -import org.springframework.util.MultiValueMap; - -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - } - - /** - * - */ - @Test - public void testParseAndFormatDate() { - // default date format - String dateStr = "2015-11-07T03:49:09.356Z"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); - - // custom date format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - dateStr = "2015-11-07T13:49:09+10:00"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime((String) null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("application/json")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("APPLICATION/JSON")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("application/json; charset=UTF8")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("text/plain"),MediaType.parseMediaType("application/xml")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals(MediaType.parseMediaType("APPLICATION/JSON"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals(MediaType.parseMediaType("application/json; charset=UTF8"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals(MediaType.parseMediaType("text/plain"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - @Ignore("There is no more basic auth in petstore security definitions") - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testParameterToMultiValueMapWhenNameIsInvalid() throws Exception { - MultiValueMap pairs_a = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, null, new Integer(1)); - MultiValueMap pairs_b = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToMultiValueMapWhenValueIsNull() throws Exception { - MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToMultiValueMapWhenValueIsEmptyStrings() throws Exception { - - // single empty string - MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", " "); - assertEquals(1, pairs.size()); - - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - MultiValueMap concatStrings = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", strs); - - assertEquals(1, concatStrings.get("param-a").size()); - assertFalse(concatStrings.get("param-a").isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToMultiValueMapWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, name, value); - - assertEquals(1, pairs.get(name).size()); - assertEquals(value, Integer.valueOf(pairs.get(name).get(0))); - } - - @Test - public void testParameterToMultiValueMapWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put(ApiClient.CollectionFormat.CSV, ","); - collectionFormatMap.put(ApiClient.CollectionFormat.TSV, "\t"); - collectionFormatMap.put(ApiClient.CollectionFormat.SSV, " "); - collectionFormatMap.put(ApiClient.CollectionFormat.PIPES, "\\|"); - collectionFormatMap.put(null, ","); // no format, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - MultiValueMap multiValueMap = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.MULTI, name, values); - assertEquals(values.size(), multiValueMap.get(name).size()); - - // all other formats - for (ApiClient.CollectionFormat collectionFormat : collectionFormatMap.keySet()) { - MultiValueMap pairs = apiClient.parameterToMultiValueMap(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - String[] pairValueSplit = pairs.get(name).get(0).split(delimiter); - - assertEquals(values.size(), pairValueSplit.length); - } - } -} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index c09af938647..ea1c4aa5267 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -41,8 +41,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - Client response = api.testSpecialTags(body); + Client client = null; + Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeApiTest.java index 65b341a3c52..887356d2ff4 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -15,9 +15,11 @@ package io.swagger.client.api; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -45,8 +47,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -61,8 +63,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -99,6 +101,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -109,8 +128,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client body = null; - Client response = api.testClientModel(body); + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } @@ -134,7 +153,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -154,15 +173,31 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 641e4fc7008..611f809195d 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -34,15 +34,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() { - Client body = null; - Client response = api.testClassname(body); + Client client = null; + Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/PetApiTest.java index fb1bb2810f6..3485d9e04f6 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,317 +1,169 @@ +/* + * 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.api; -import com.fasterxml.jackson.annotation.*; -import com.fasterxml.jackson.databind.*; - -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import io.swagger.TestUtils; - -import io.swagger.client.*; -import io.swagger.client.api.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.io.BufferedWriter; import java.io.File; -import java.io.FileWriter; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Test; +import org.junit.Ignore; + import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.*; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.RestClientException; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; - -import static org.junit.Assert.*; - +/** + * API tests for PetApi + */ +@Ignore public class PetApiTest { - private PetApi api; - private ObjectMapper mapper; - @Before - public void setup() { - api = new PetApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } + private final PetApi api = new PetApi(); + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testApiClient() { - // the default api client is used - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - - ApiClient oldClient = api.getApiClient(); - - ApiClient newClient = new ApiClient(); - newClient.setBasePath("http://example.com"); - newClient.setDebugging(true); - - // set api client via constructor - api = new PetApi(newClient); - assertNotNull(api.getApiClient()); - assertEquals("http://example.com", api.getApiClient().getBasePath()); - assertTrue(api.getApiClient().isDebugging()); - - // set api client via setter method - api.setApiClient(oldClient); - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - } - - @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createRandomPet(); + public void addPetTest() { + Pet pet = null; api.addPet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - - /* + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateAndGetPetWithByteArray() throws Exception { - Pet pet = createRandomPet(); - byte[] bytes = serializeJson(pet).getBytes(); - api.addPetUsingByteArray(bytes); + public void deletePetTest() { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); - byte[] fetchedBytes = api.petPetIdtestingByteArraytrueGet(pet.getId()); - Pet fetched = deserializeJson(new String(fetchedBytes), Pet.class); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetPetByIdInObject() throws Exception { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("pet " + pet.getId()); + public void findPetsByStatusTest() { + List status = null; + List response = api.findPetsByStatus(status); - Category category = new Category(); - category.setId(TestUtils.nextId()); - category.setName("category " + category.getId()); - pet.setCategory(category); - - pet.setStatus(Pet.StatusEnum.PENDING); - List photos = Arrays.asList(new String[]{"http://foo.bar.com/1"}); - pet.setPhotoUrls(photos); - - api.addPet(pet); - - InlineResponse200 fetched = api.getPetByIdInObject(pet.getId()); - assertEquals(pet.getId(), fetched.getId()); - assertEquals(pet.getName(), fetched.getName()); - - Object categoryObj = fetched.getCategory(); - assertNotNull(categoryObj); - assertTrue(categoryObj instanceof Map); - - Map categoryMap = (Map) categoryObj; - Object categoryIdObj = categoryMap.get("id"); - assertTrue(categoryIdObj instanceof Integer); - Integer categoryIdInt = (Integer) categoryIdObj; - assertEquals(category.getId(), Long.valueOf(categoryIdInt)); - assertEquals(category.getName(), categoryMap.get("name")); + // TODO: test validations } - */ - + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); + public void findPetsByTagsTest() { + List tags = null; + List response = api.findPetsByTags(tags); + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() { + Long petId = null; + Pet response = api.getPetById(petId); + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() { + Pet pet = null; api.updatePet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void updatePetWithFormTest() { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); - api.updatePet(pet); - - List pets = api.findPetsByStatus(Arrays.asList(new String[]{"available"})); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); + // TODO: test validations } - -// this API is deprecated -// @Test -// public void testFindPetsByTags() throws Exception { -// Pet pet = createRandomPet(); -// pet.setName("monster"); -// pet.setStatus(Pet.StatusEnum.AVAILABLE); -// -// List tags = new ArrayList(); -// Tag tag1 = new Tag(); -// tag1.setName("friendly"); -// tags.add(tag1); -// pet.setTags(tags); -// -// api.updatePet(pet); -// -// List pets = api.findPetsByTags(Arrays.asList(new String[]{"friendly"})); -// assertNotNull(pets); -// -// boolean found = false; -// for (Pet fetched : pets) { -// if (fetched.getId().equals(pet.getId())) { -// found = true; -// break; -// } -// } -// assertTrue(found); -// } - + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet); + public void uploadFileTest() { + Long petId = null; + String additionalMetadata = null; + File file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); - } - - @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(fetched.getId(), null); - - try { - fetched = api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (RestClientException e) { - assertTrue(e instanceof HttpClientErrorException); - assertEquals(404, ((HttpClientErrorException) e).getStatusCode().value()); - } - } - - @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); - } - - @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"}); - pet.setPhotoUrls(photos); - - return pet; - } - - private String serializeJson(Object o) { - if (mapper == null) { - mapper = createObjectMapper(); - } - try { - return mapper.writeValueAsString(o); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private T deserializeJson(String json, Class klass) { - if (mapper == null) { - mapper = createObjectMapper(); - } - try { - return mapper.readValue(json, klass); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private ObjectMapper createObjectMapper() { - ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - return mapper; + // TODO: test validations } + } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/StoreApiTest.java index 16b9531dea8..d5fe4c7775e 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,102 +1,97 @@ +/* + * 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.api; -import io.swagger.TestUtils; +import io.swagger.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; -import io.swagger.client.*; -import io.swagger.client.api.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; -import java.text.SimpleDateFormat; - -import org.junit.*; -import org.springframework.web.client.RestClientException; -import org.threeten.bp.OffsetDateTime; - -import static org.junit.Assert.*; +/** + * API tests for StoreApi + */ +@Ignore public class StoreApiTest { - StoreApi api = null; - @Before - public void setup() { - api = new StoreApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - // set custom date format that is used by the petstore server - api.getApiClient().setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")); - } + private final StoreApi api = new StoreApi(); + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory(); - assertTrue(inventory.keySet().size() > 0); - } + public void deleteOrderTest() { + String orderId = null; + api.deleteOrder(orderId); - /* + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testGetInventoryInObject() throws Exception { - Object inventoryObj = api.getInventoryInObject(); - assertTrue(inventoryObj instanceof Map); + public void getInventoryTest() { + Map response = api.getInventory(); - Map inventoryMap = (Map) inventoryObj; - assertTrue(inventoryMap.keySet().size() > 0); - - Map.Entry firstEntry = (Map.Entry) inventoryMap.entrySet().iterator().next(); - assertTrue(firstEntry.getKey() instanceof String); - assertTrue(firstEntry.getValue() instanceof Integer); + // TODO: test validations } - */ - + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testPlaceOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getOrderByIdTest() { + Long orderId = null; + Order response = api.getOrderById(orderId); - Order fetched = api.getOrderById(order.getId()); - assertEquals(order.getId(), fetched.getId()); - assertEquals(order.getPetId(), fetched.getPetId()); - assertEquals(order.getQuantity(), fetched.getQuantity()); - assertTrue(order.getShipDate().isEqual(fetched.getShipDate())); + // TODO: test validations } - + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void placeOrderTest() { + Order order = null; + Order response = api.placeOrder(order); - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); - - api.deleteOrder(String.valueOf(order.getId())); - - try { - api.getOrderById(order.getId()); - // fail("expected an error"); - } catch (RestClientException e) { - // ok - } - } - - private Order createOrder() { - Order order = new Order(); - order.setPetId(new Long(200)); - order.setQuantity(new Integer(13)); - order.setShipDate(OffsetDateTime.now().withNano(123000000)); - order.setStatus(Order.StatusEnum.PLACED); - order.setComplete(true); - - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, TestUtils.nextId()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; + // TODO: test validations } + } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java index c7fb92d2552..7184bf98403 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,88 +1,163 @@ +/* + * 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.api; -import io.swagger.TestUtils; +import io.swagger.client.model.User; +import org.junit.Test; +import org.junit.Ignore; -import io.swagger.client.api.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; - -import java.util.Arrays; - -import org.junit.*; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * API tests for UserApi + */ +@Ignore public class UserApiTest { - UserApi api = null; - @Before - public void setup() { - api = new UserApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } + private final UserApi api = new UserApi(); + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUser() throws Exception { - User user = createUser(); - + public void createUserTest() { + User user = null; api.createUser(user); - User fetched = api.getUserByName(user.getUsername()); - assertEquals(user.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUsersWithArray() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithArrayInputTest() { + List user = null; + api.createUsersWithArrayInput(user); - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testCreateUsersWithList() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithListInputTest() { + List user = null; + api.createUsersWithListInput(user); - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testLoginUser() throws Exception { - User user = createUser(); - api.createUser(user); + public void deleteUserTest() { + String username = null; + api.deleteUser(username); - String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + // TODO: test validations } - + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void logoutUser() throws Exception { + public void getUserByNameTest() { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() { api.logoutUser(); - } - private User createUser() { - User user = new User(); - user.setId(TestUtils.nextId()); - user.setUsername("fred" + user.getId()); - user.setFirstName("Fred"); - user.setLastName("Meyer"); - user.setEmail("fred@fredmeyer.com"); - user.setPassword("xxXXxx"); - user.setPhone("408-867-5309"); - user.setUserStatus(123); - - return user; + // TODO: test validations } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() { + String username = null; + User user = null; + api.updateUser(username, user); + + // TODO: test validations + } + } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java deleted file mode 100644 index c1eabc2fd08..00000000000 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.junit.*; -import org.springframework.http.HttpHeaders; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; - -import static org.junit.Assert.*; - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - MultiValueMap queryParams = new LinkedMultiValueMap(); - HttpHeaders headerParams = new HttpHeaders(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams); - - assertEquals(1, queryParams.size()); - assertEquals("my-api-key", queryParams.get("api_key").get(0)); - - // no changes to header parameters - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - MultiValueMap queryParams = new LinkedMultiValueMap(); - HttpHeaders headerParams = new HttpHeaders(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN").get(0)); - } -} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java deleted file mode 100644 index 877c6cfc77c..00000000000 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.junit.*; -import org.springframework.http.HttpHeaders; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; - -import static org.junit.Assert.*; - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - MultiValueMap queryParams = new LinkedMultiValueMap(); - HttpHeaders headerParams = new HttpHeaders(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization").get(0)); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization").get(1)); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization").get(2)); - } -} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/model/EnumValueTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/model/EnumValueTest.java deleted file mode 100644 index e2ce8e1f1e5..00000000000 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/model/EnumValueTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package io.swagger.client.model; - -import org.junit.Test; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - try { - // test serialization (object => json) - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - ObjectWriter ow = mapper.writer(); - String json = ow.writeValueAsString(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); - - // test deserialization (json => object) - EnumTest fromString = mapper.readValue(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - - } catch (Exception e) { - fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); - } - } -} diff --git a/samples/client/petstore/java/retrofit/.openapi-generator-ignore b/samples/client/petstore/java/retrofit/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/retrofit/.openapi-generator-ignore +++ b/samples/client/petstore/java/retrofit/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/retrofit/README.md b/samples/client/petstore/java/retrofit/README.md index 93488cf4e5c..e7653b50147 100644 --- a/samples/client/petstore/java/retrofit/README.md +++ b/samples/client/petstore/java/retrofit/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-retrofit +# petstore-retrofit ## Requirements @@ -24,8 +24,8 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-petstore-retrofit + org.openapitools + petstore-retrofit 1.0.0 compile @@ -34,7 +34,7 @@ After the client library is installed/deployed, you can use it in your Maven pro ## Recommendation -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. ## Author diff --git a/samples/client/petstore/java/retrofit/build.gradle b/samples/client/petstore/java/retrofit/build.gradle index 8ec870ea312..fb1371f1f39 100644 --- a/samples/client/petstore/java/retrofit/build.gradle +++ b/samples/client/petstore/java/retrofit/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-retrofit' + pom.artifactId = 'petstore-retrofit' } } diff --git a/samples/client/petstore/java/retrofit/build.sbt b/samples/client/petstore/java/retrofit/build.sbt index 629c85c2bf3..44fb828418b 100644 --- a/samples/client/petstore/java/retrofit/build.sbt +++ b/samples/client/petstore/java/retrofit/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-retrofit", + organization := "org.openapitools", + name := "petstore-retrofit", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/retrofit/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 0437c4dd8cc..00000000000 --- a/samples/client/petstore/java/retrofit/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ - -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **Map<String, String>** | | [optional] -**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/Animal.md b/samples/client/petstore/java/retrofit/docs/Animal.md deleted file mode 100644 index b3f325c3524..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 77292549927..00000000000 --- a/samples/client/petstore/java/retrofit/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit/docs/ArrayOfNumberOnly.md deleted file mode 100644 index e8cc4cd36dc..00000000000 --- a/samples/client/petstore/java/retrofit/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/ArrayTest.md b/samples/client/petstore/java/retrofit/docs/ArrayTest.md deleted file mode 100644 index 9feee16427f..00000000000 --- a/samples/client/petstore/java/retrofit/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **List<String>** | | [optional] -**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] -**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/Cat.md b/samples/client/petstore/java/retrofit/docs/Cat.md deleted file mode 100644 index be6e56fa8ce..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Cat.md +++ /dev/null @@ -1,12 +0,0 @@ - -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] -**declawed** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/Category.md b/samples/client/petstore/java/retrofit/docs/Category.md deleted file mode 100644 index e2df0803278..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/Dog.md b/samples/client/petstore/java/retrofit/docs/Dog.md deleted file mode 100644 index 71a7dbe809e..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Dog.md +++ /dev/null @@ -1,12 +0,0 @@ - -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] -**breed** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/EnumClass.md b/samples/client/petstore/java/retrofit/docs/EnumClass.md deleted file mode 100644 index c746edc3cb1..00000000000 --- a/samples/client/petstore/java/retrofit/docs/EnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ - -# EnumClass - -## Enum - - -* `_ABC` (value: `"_abc"`) - -* `_EFG` (value: `"-efg"`) - -* `_XYZ_` (value: `"(xyz)"`) - - - diff --git a/samples/client/petstore/java/retrofit/docs/EnumTest.md b/samples/client/petstore/java/retrofit/docs/EnumTest.md deleted file mode 100644 index deb1951c552..00000000000 --- a/samples/client/petstore/java/retrofit/docs/EnumTest.md +++ /dev/null @@ -1,36 +0,0 @@ - -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] -**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] -**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] - - - -## Enum: EnumStringEnum -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" - - - -## Enum: EnumIntegerEnum -Name | Value ----- | ----- -NUMBER_1 | 1 -NUMBER_MINUS_1 | -1 - - - -## Enum: EnumNumberEnum -Name | Value ----- | ----- -NUMBER_1_DOT_1 | 1.1 -NUMBER_MINUS_1_DOT_2 | -1.2 - - - diff --git a/samples/client/petstore/java/retrofit/docs/FakeApi.md b/samples/client/petstore/java/retrofit/docs/FakeApi.md deleted file mode 100644 index 21a4db7c377..00000000000 --- a/samples/client/petstore/java/retrofit/docs/FakeApi.md +++ /dev/null @@ -1,122 +0,0 @@ -# FakeApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters - - - -# **testEndpointParameters** -> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -BigDecimal number = new BigDecimal(); // BigDecimal | None -Double _double = 3.4D; // Double | None -String string = "string_example"; // String | None -byte[] _byte = B; // byte[] | None -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -DateTime dateTime = new DateTime(); // DateTime | None -String password = "password_example"; // String | None -try { - apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **string** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 - - -# **testEnumQueryParameters** -> testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble) - -To test enum query parameters - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -String enumQueryString = "-efg"; // String | Query parameter enum test (string) -BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double) -Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) -try { - apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEnumQueryParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/retrofit/docs/FormatTest.md b/samples/client/petstore/java/retrofit/docs/FormatTest.md deleted file mode 100644 index 44de7d9511a..00000000000 --- a/samples/client/petstore/java/retrofit/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ - -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | | [optional] -**int32** | **Integer** | | [optional] -**int64** | **Long** | | [optional] -**number** | [**BigDecimal**](BigDecimal.md) | | -**_float** | **Float** | | [optional] -**_double** | **Double** | | [optional] -**string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] -**date** | [**LocalDate**](LocalDate.md) | | -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | - - - diff --git a/samples/client/petstore/java/retrofit/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit/docs/HasOnlyReadOnly.md deleted file mode 100644 index c1d0aac5672..00000000000 --- a/samples/client/petstore/java/retrofit/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ - -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/MapTest.md b/samples/client/petstore/java/retrofit/docs/MapTest.md deleted file mode 100644 index c671e97ffbc..00000000000 --- a/samples/client/petstore/java/retrofit/docs/MapTest.md +++ /dev/null @@ -1,17 +0,0 @@ - -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] -**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] - - - -## Enum: Map<String, InnerEnum> -Name | Value ----- | ----- - - - diff --git a/samples/client/petstore/java/retrofit/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index e3487bcc501..00000000000 --- a/samples/client/petstore/java/retrofit/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ - -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**map** | [**Map<String, Animal>**](Animal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/Model200Response.md b/samples/client/petstore/java/retrofit/docs/Model200Response.md deleted file mode 100644 index b47618b28cc..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | [optional] -**PropertyClass** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit/docs/ModelApiResponse.md deleted file mode 100644 index 3eec8686cc9..00000000000 --- a/samples/client/petstore/java/retrofit/docs/ModelApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ModelApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/Name.md b/samples/client/petstore/java/retrofit/docs/Name.md deleted file mode 100644 index ce2fb4dee50..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | -**snakeCase** | **Integer** | | [optional] -**property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/NumberOnly.md b/samples/client/petstore/java/retrofit/docs/NumberOnly.md deleted file mode 100644 index a3feac7fadc..00000000000 --- a/samples/client/petstore/java/retrofit/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/Order.md b/samples/client/petstore/java/retrofit/docs/Order.md deleted file mode 100644 index a1089f5384e..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Order.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**petId** | **Long** | | [optional] -**quantity** | **Integer** | | [optional] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] -**complete** | **Boolean** | | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" - - - diff --git a/samples/client/petstore/java/retrofit/docs/Pet.md b/samples/client/petstore/java/retrofit/docs/Pet.md deleted file mode 100644 index 5b63109ef92..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Pet.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **List<String>** | | -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -AVAILABLE | "available" -PENDING | "pending" -SOLD | "sold" - - - diff --git a/samples/client/petstore/java/retrofit/docs/PetApi.md b/samples/client/petstore/java/retrofit/docs/PetApi.md deleted file mode 100644 index e0314e20e51..00000000000 --- a/samples/client/petstore/java/retrofit/docs/PetApi.md +++ /dev/null @@ -1,448 +0,0 @@ -# PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **addPet** -> addPet(body) - -Add a new pet to the store - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.addPet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete -String apiKey = "apiKey_example"; // String | -try { - apiInstance.deletePet(petId, apiKey); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByStatus** -> List<Pet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter -try { - List result = apiInstance.findPetsByStatus(status); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List tags = Arrays.asList("tags_example"); // List | Tags to filter by -try { - List result = apiInstance.findPetsByTags(tags); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return -try { - Pet result = apiInstance.getPetById(petId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(body) - -Update an existing pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.updatePet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated -String name = "name_example"; // String | Updated name of the pet -String status = "status_example"; // String | Updated status of the pet -try { - apiInstance.updatePetWithForm(petId, name, status); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json - - -# **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update -String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload -try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/java/retrofit/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit/docs/ReadOnlyFirst.md deleted file mode 100644 index 426b7cde95a..00000000000 --- a/samples/client/petstore/java/retrofit/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ - -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit/docs/SpecialModelName.md deleted file mode 100644 index c2c6117c552..00000000000 --- a/samples/client/petstore/java/retrofit/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ - -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/StoreApi.md b/samples/client/petstore/java/retrofit/docs/StoreApi.md deleted file mode 100644 index 0b30791725a..00000000000 --- a/samples/client/petstore/java/retrofit/docs/StoreApi.md +++ /dev/null @@ -1,197 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted -try { - apiInstance.deleteOrder(orderId); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#deleteOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getInventory** -> Map<String, Integer> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.StoreApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -StoreApi apiInstance = new StoreApi(); -try { - Map result = apiInstance.getInventory(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getInventory"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Map<String, Integer>**](Map.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched -try { - Order result = apiInstance.getOrderById(orderId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getOrderById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet -try { - Order result = apiInstance.placeOrder(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#placeOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/retrofit/docs/Tag.md b/samples/client/petstore/java/retrofit/docs/Tag.md deleted file mode 100644 index de6814b55d5..00000000000 --- a/samples/client/petstore/java/retrofit/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/User.md b/samples/client/petstore/java/retrofit/docs/User.md deleted file mode 100644 index 8b6753dd284..00000000000 --- a/samples/client/petstore/java/retrofit/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ - -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Integer** | User Status | [optional] - - - diff --git a/samples/client/petstore/java/retrofit/docs/UserApi.md b/samples/client/petstore/java/retrofit/docs/UserApi.md deleted file mode 100644 index 8cdc15992ee..00000000000 --- a/samples/client/petstore/java/retrofit/docs/UserApi.md +++ /dev/null @@ -1,370 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(body) - -Create user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object -try { - apiInstance.createUser(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithArrayInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithListInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithListInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted -try { - apiInstance.deleteUser(username); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. -try { - User result = apiInstance.getUserByName(username); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserByName"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The user name for login -String password = "password_example"; // String | The password for login in clear text -try { - String result = apiInstance.loginUser(username, password); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#loginUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -try { - apiInstance.logoutUser(); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#logoutUser"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object -try { - apiInstance.updateUser(username, body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index f71111ea7f9..1373ec62643 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-retrofit + org.openapitools + petstore-retrofit jar - swagger-petstore-retrofit + petstore-retrofit 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/retrofit/settings.gradle b/samples/client/petstore/java/retrofit/settings.gradle index 7e540c099de..defa9ab32ba 100644 --- a/samples/client/petstore/java/retrofit/settings.gradle +++ b/samples/client/petstore/java/retrofit/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-retrofit" \ No newline at end of file +rootProject.name = "petstore-retrofit" \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java index a2c326c62c1..24061ed329d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -18,24 +18,24 @@ public interface AnotherFakeApi { * To test special tags * Sync method * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client */ @PATCH("/another-fake/dummy") Client testSpecialTags( - @retrofit.http.Body Client body + @retrofit.http.Body Client client ); /** * To test special tags * Async method - * @param body client model (required) + * @param client client model (required) * @param cb callback method */ @PATCH("/another-fake/dummy") void testSpecialTags( - @retrofit.http.Body Client body, Callback cb + @retrofit.http.Body Client client, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java index 07681e62c98..ad37c67e6b1 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java @@ -9,8 +9,10 @@ import retrofit.mime.*; import java.math.BigDecimal; import io.swagger.client.model.Client; import org.joda.time.DateTime; +import java.io.File; import org.joda.time.LocalDate; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -22,49 +24,49 @@ public interface FakeApi { * * Sync method * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Boolean */ @POST("/fake/outer/boolean") Boolean fakeOuterBooleanSerialize( - @retrofit.http.Body Boolean body + @retrofit.http.Body Boolean booleanPostBody ); /** * * Async method - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @param cb callback method */ @POST("/fake/outer/boolean") void fakeOuterBooleanSerialize( - @retrofit.http.Body Boolean body, Callback cb + @retrofit.http.Body Boolean booleanPostBody, Callback cb ); /** * * Sync method * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite */ @POST("/fake/outer/composite") OuterComposite fakeOuterCompositeSerialize( - @retrofit.http.Body OuterComposite body + @retrofit.http.Body OuterComposite outerComposite ); /** * * Async method - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @param cb callback method */ @POST("/fake/outer/composite") void fakeOuterCompositeSerialize( - @retrofit.http.Body OuterComposite body, Callback cb + @retrofit.http.Body OuterComposite outerComposite, Callback cb ); /** * @@ -114,29 +116,55 @@ public interface FakeApi { void fakeOuterStringSerialize( @retrofit.http.Body String body, Callback cb ); + /** + * + * Sync method + * + * @param query (required) + * @param user (required) + * @return Void + */ + + @PUT("/fake/body-with-query-params") + Void testBodyWithQueryParams( + @retrofit.http.Query("query") String query, @retrofit.http.Body User user + ); + + /** + * + * Async method + * @param query (required) + * @param user (required) + * @param cb callback method + */ + + @PUT("/fake/body-with-query-params") + void testBodyWithQueryParams( + @retrofit.http.Query("query") String query, @retrofit.http.Body User user, Callback cb + ); /** * To test \"client\" model * Sync method * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client */ @PATCH("/fake") Client testClientModel( - @retrofit.http.Body Client body + @retrofit.http.Body Client client ); /** * To test \"client\" model * Async method - * @param body client model (required) + * @param client client model (required) * @param cb callback method */ @PATCH("/fake") void testClientModel( - @retrofit.http.Body Client body, Callback cb + @retrofit.http.Body Client client, Callback cb ); /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -162,7 +190,7 @@ public interface FakeApi { @retrofit.http.FormUrlEncoded @POST("/fake") Void testEndpointParameters( - @retrofit.http.Field("number") BigDecimal number, @retrofit.http.Field("double") Double _double, @retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit.http.Field("byte") byte[] _byte, @retrofit.http.Field("integer") Integer integer, @retrofit.http.Field("int32") Integer int32, @retrofit.http.Field("int64") Long int64, @retrofit.http.Field("float") Float _float, @retrofit.http.Field("string") String string, @retrofit.http.Field("binary") byte[] binary, @retrofit.http.Field("date") LocalDate date, @retrofit.http.Field("dateTime") DateTime dateTime, @retrofit.http.Field("password") String password, @retrofit.http.Field("callback") String paramCallback + @retrofit.http.Field("number") BigDecimal number, @retrofit.http.Field("double") Double _double, @retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit.http.Field("byte") byte[] _byte, @retrofit.http.Field("integer") Integer integer, @retrofit.http.Field("int32") Integer int32, @retrofit.http.Field("int64") Long int64, @retrofit.http.Field("float") Float _float, @retrofit.http.Field("string") String string, @retrofit.http.Field("binary") TypedFile binary, @retrofit.http.Field("date") LocalDate date, @retrofit.http.Field("dateTime") DateTime dateTime, @retrofit.http.Field("password") String password, @retrofit.http.Field("callback") String paramCallback ); /** @@ -188,71 +216,71 @@ public interface FakeApi { @retrofit.http.FormUrlEncoded @POST("/fake") void testEndpointParameters( - @retrofit.http.Field("number") BigDecimal number, @retrofit.http.Field("double") Double _double, @retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit.http.Field("byte") byte[] _byte, @retrofit.http.Field("integer") Integer integer, @retrofit.http.Field("int32") Integer int32, @retrofit.http.Field("int64") Long int64, @retrofit.http.Field("float") Float _float, @retrofit.http.Field("string") String string, @retrofit.http.Field("binary") byte[] binary, @retrofit.http.Field("date") LocalDate date, @retrofit.http.Field("dateTime") DateTime dateTime, @retrofit.http.Field("password") String password, @retrofit.http.Field("callback") String paramCallback, Callback cb + @retrofit.http.Field("number") BigDecimal number, @retrofit.http.Field("double") Double _double, @retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit.http.Field("byte") byte[] _byte, @retrofit.http.Field("integer") Integer integer, @retrofit.http.Field("int32") Integer int32, @retrofit.http.Field("int64") Long int64, @retrofit.http.Field("float") Float _float, @retrofit.http.Field("string") String string, @retrofit.http.Field("binary") TypedFile binary, @retrofit.http.Field("date") LocalDate date, @retrofit.http.Field("dateTime") DateTime dateTime, @retrofit.http.Field("password") String password, @retrofit.http.Field("callback") String paramCallback, Callback cb ); /** * To test enum parameters * Sync method * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return Void */ @retrofit.http.FormUrlEncoded @GET("/fake") Void testEnumParameters( - @retrofit.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit.http.Field("enum_form_string") String enumFormString, @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit.http.Field("enum_query_double") Double enumQueryDouble + @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit.http.Query("enum_query_double") Double enumQueryDouble, @retrofit.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit.http.Field("enum_form_string") String enumFormString ); /** * To test enum parameters * Async method - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @param cb callback method */ @retrofit.http.FormUrlEncoded @GET("/fake") void testEnumParameters( - @retrofit.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit.http.Field("enum_form_string") String enumFormString, @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit.http.Field("enum_query_double") Double enumQueryDouble, Callback cb + @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit.http.Query("enum_query_double") Double enumQueryDouble, @retrofit.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit.http.Field("enum_form_string") String enumFormString, Callback cb ); /** * test inline additionalProperties * Sync method * - * @param param request body (required) + * @param requestBody request body (required) * @return Void */ @POST("/fake/inline-additionalProperties") Void testInlineAdditionalProperties( - @retrofit.http.Body Object param + @retrofit.http.Body String requestBody ); /** * test inline additionalProperties * Async method - * @param param request body (required) + * @param requestBody request body (required) * @param cb callback method */ @POST("/fake/inline-additionalProperties") void testInlineAdditionalProperties( - @retrofit.http.Body Object param, Callback cb + @retrofit.http.Body String requestBody, Callback cb ); /** * test json serialization of form data diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index cde2b07d4b6..500099245f0 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -18,24 +18,24 @@ public interface FakeClassnameTags123Api { * To test class name in snake case * Sync method * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client */ @PATCH("/fake_classname_test") Client testClassname( - @retrofit.http.Body Client body + @retrofit.http.Body Client client ); /** * To test class name in snake case * Async method - * @param body client model (required) + * @param client client model (required) * @param cb callback method */ @PATCH("/fake_classname_test") void testClassname( - @retrofit.http.Body Client body, Callback cb + @retrofit.http.Body Client client, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java index 6f8b1d17830..f5bbf360033 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java @@ -20,25 +20,25 @@ public interface PetApi { * Add a new pet to the store * Sync method * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Void */ @POST("/pet") Void addPet( - @retrofit.http.Body Pet body + @retrofit.http.Body Pet pet ); /** * Add a new pet to the store * Async method - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param cb callback method */ @POST("/pet") void addPet( - @retrofit.http.Body Pet body, Callback cb + @retrofit.http.Body Pet pet, Callback cb ); /** * Deletes a pet @@ -142,25 +142,25 @@ public interface PetApi { * Update an existing pet * Sync method * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Void */ @PUT("/pet") Void updatePet( - @retrofit.http.Body Pet body + @retrofit.http.Body Pet pet ); /** * Update an existing pet * Async method - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param cb callback method */ @PUT("/pet") void updatePet( - @retrofit.http.Body Pet body, Callback cb + @retrofit.http.Body Pet pet, Callback cb ); /** * Updates a pet in the store with form data diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java index f705411a0df..bfe8b83394b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java @@ -87,24 +87,24 @@ public interface StoreApi { * Place an order for a pet * Sync method * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order */ @POST("/store/order") Order placeOrder( - @retrofit.http.Body Order body + @retrofit.http.Body Order order ); /** * Place an order for a pet * Async method - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param cb callback method */ @POST("/store/order") void placeOrder( - @retrofit.http.Body Order body, Callback cb + @retrofit.http.Body Order order, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java index fe85e9b479a..0620d7d312c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java @@ -18,73 +18,73 @@ public interface UserApi { * Create user * Sync method * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return Void */ @POST("/user") Void createUser( - @retrofit.http.Body User body + @retrofit.http.Body User user ); /** * Create user * Async method - * @param body Created user object (required) + * @param user Created user object (required) * @param cb callback method */ @POST("/user") void createUser( - @retrofit.http.Body User body, Callback cb + @retrofit.http.Body User user, Callback cb ); /** * Creates list of users with given input array * Sync method * - * @param body List of user object (required) + * @param user List of user object (required) * @return Void */ @POST("/user/createWithArray") Void createUsersWithArrayInput( - @retrofit.http.Body List body + @retrofit.http.Body List user ); /** * Creates list of users with given input array * Async method - * @param body List of user object (required) + * @param user List of user object (required) * @param cb callback method */ @POST("/user/createWithArray") void createUsersWithArrayInput( - @retrofit.http.Body List body, Callback cb + @retrofit.http.Body List user, Callback cb ); /** * Creates list of users with given input array * Sync method * - * @param body List of user object (required) + * @param user List of user object (required) * @return Void */ @POST("/user/createWithList") Void createUsersWithListInput( - @retrofit.http.Body List body + @retrofit.http.Body List user ); /** * Creates list of users with given input array * Async method - * @param body List of user object (required) + * @param user List of user object (required) * @param cb callback method */ @POST("/user/createWithList") void createUsersWithListInput( - @retrofit.http.Body List body, Callback cb + @retrofit.http.Body List user, Callback cb ); /** * Delete user @@ -186,25 +186,25 @@ public interface UserApi { * Sync method * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Void */ @PUT("/user/{username}") Void updateUser( - @retrofit.http.Path("username") String username, @retrofit.http.Body User body + @retrofit.http.Path("username") String username, @retrofit.http.Body User user ); /** * Updated user * Async method * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @param cb callback method */ @PUT("/user/{username}") void updateUser( - @retrofit.http.Path("username") String username, @retrofit.http.Body User body, Callback cb + @retrofit.http.Path("username") String username, @retrofit.http.Body User user, Callback cb ); } 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 a572c0d6b5b..7a1b9c32152 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 @@ -82,6 +82,58 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + @JsonAdapter(EnumStringRequiredEnum.Adapter.class) + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringRequiredEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -203,6 +255,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -268,6 +338,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -275,7 +346,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -285,6 +356,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 44c40a9d267..545cbe59597 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 @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; @@ -58,7 +59,7 @@ public class FormatTest { private byte[] _byte = null; @SerializedName("binary") - private byte[] binary = null; + private File binary = null; @SerializedName("date") private LocalDate date = null; @@ -226,7 +227,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -236,11 +237,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -334,7 +335,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -343,7 +344,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 1bcc6ac44bf..28c5997ded5 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 @@ -81,9 +81,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 f6a3f8f4195..a7b129c2a4d 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 @@ -40,7 +40,7 @@ public class Name { private String property = null; @SerializedName("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 9c0a4477a04..185b853dce9 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 @@ -30,24 +30,24 @@ import java.io.IOException; public class SpecialModelName { @SerializedName("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -59,13 +59,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -74,7 +74,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index 97a46dba529..be4dfa448b2 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -30,8 +30,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - // Client response = api.testSpecialTags(body); + Client client = null; + // Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeApiTest.java index 49bc4b90504..bc60ff251e7 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -2,7 +2,12 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import java.math.BigDecimal; -import java.util.Date; +import io.swagger.client.model.Client; +import org.joda.time.DateTime; +import java.io.File; +import org.joda.time.LocalDate; +import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; @@ -24,6 +29,85 @@ public class FakeApiTest { } + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + Boolean booleanPostBody = null; + // Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + // api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + */ + @Test + public void testClientModelTest() { + Client client = null; + // Client response = api.testClientModel(client); + + // TODO: test validations + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -33,17 +117,66 @@ public class FakeApiTest { public void testEndpointParametersTest() { BigDecimal number = null; Double _double = null; - String string = null; + String patternWithoutDelimiter = null; byte[] _byte = null; Integer integer = null; Integer int32 = null; Long int64 = null; Float _float = null; - byte[] binary = null; - Date date = null; - Date dateTime = null; + String string = null; + File binary = null; + LocalDate date = null; + DateTime dateTime = null; String password = null; - // Void response = api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + String paramCallback = null; + // api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + // api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + // api.testJsonFormData(param, param2); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 2fd2c16ed50..53ba54bae54 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -26,12 +26,12 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case */ @Test public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + Client client = null; + // Client response = api.testClassname(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/PetApiTest.java index 70f8b5aa13f..91c2c8e8107 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,190 +1,137 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - -import io.swagger.client.*; -import io.swagger.client.CollectionFormats.*; -import io.swagger.client.model.*; - -import retrofit.RetrofitError; -import retrofit.mime.TypedFile; - -import java.io.BufferedWriter; +import io.swagger.client.ApiClient; import java.io.File; -import java.io.FileWriter; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Before; +import org.junit.Test; + import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; -import org.junit.*; -import static org.junit.Assert.*; - +/** + * API tests for PetApi + */ public class PetApiTest { - PetApi api = null; + + private PetApi api; @Before public void setup() { api = new ApiClient().createService(PetApi.class); } + + /** + * Add a new pet to the store + * + * + */ @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); + public void addPetTest() { + Pet pet = null; + // api.addPet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Deletes a pet + * + * + */ @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); + public void deletePetTest() { + Long petId = null; + String apiKey = null; + // api.deletePet(petId, apiKey); - api.updatePet(pet); - - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void findPetsByStatusTest() { + List status = null; + // List response = api.findPetsByStatus(status); - api.updatePet(pet); - - List pets = api.findPetsByStatus(new CSVParams("available")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); + // TODO: test validations } - + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ @Test - public void testFindPetsByTags() throws Exception { - Pet pet = createRandomPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void findPetsByTagsTest() { + List tags = null; + // List response = api.findPetsByTags(tags); - List tags = new ArrayList(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet); - - List pets = api.findPetsByTags(new CSVParams("friendly")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); + // TODO: test validations } - + + /** + * Find pet by ID + * + * Returns a single pet + */ @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet); + public void getPetByIdTest() { + Long petId = null; + // Pet response = api.getPetById(petId); - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); + // TODO: test validations } - + + /** + * Update an existing pet + * + * + */ @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); + public void updatePetTest() { + Pet pet = null; + // api.updatePet(pet); - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(fetched.getId(), null); - - try { - fetched = api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (RetrofitError e) { - assertEquals(404, e.getResponse().getStatus()); - } + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + */ @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); + public void updatePetWithFormTest() { + Long petId = null; + String name = null; + String status = null; + // api.updatePetWithForm(petId, name, status); - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new TypedFile("text/plain", file)); + // TODO: test validations } - + + /** + * uploads an image + * + * + */ @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); + public void uploadFileTest() { + Long petId = null; + String additionalMetadata = null; + File file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"}); - pet.setPhotoUrls(photos); - - return pet; + // TODO: test validations } + } diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/StoreApiTest.java index a290fadb847..6b118ea7810 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,80 +1,77 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.model.*; +import io.swagger.client.model.Order; +import org.junit.Before; +import org.junit.Test; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import retrofit.RetrofitError; - -import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; -import org.junit.*; -import static org.junit.Assert.*; - +/** + * API tests for StoreApi + */ public class StoreApiTest { - StoreApi api = null; + + private StoreApi api; @Before public void setup() { api = new ApiClient().createService(StoreApi.class); } + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory(); - assertTrue(inventory.keySet().size() > 0); - } + public void deleteOrderTest() { + String orderId = null; + // api.deleteOrder(orderId); + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + */ @Test - public void testPlaceOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getInventoryTest() { + // Map response = api.getInventory(); - Order fetched = api.getOrderById(order.getId()); - assertEquals(order.getId(), fetched.getId()); - assertEquals(order.getPetId(), fetched.getPetId()); - assertEquals(order.getQuantity(), fetched.getQuantity()); - assertEquals(order.getShipDate().withZone(DateTimeZone.UTC), fetched.getShipDate().withZone(DateTimeZone.UTC)); + // TODO: test validations } - + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getOrderByIdTest() { + Long orderId = null; + // Order response = api.getOrderById(orderId); - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); - - api.deleteOrder(String.valueOf(order.getId())); - - try { - api.getOrderById(order.getId()); - // fail("expected an error"); - } catch (RetrofitError e) { - // ok - } + // TODO: test validations } + + /** + * Place an order for a pet + * + * + */ + @Test + public void placeOrderTest() { + Order order = null; + // Order response = api.placeOrder(order); - private Order createOrder() { - Order order = new Order(); - order.setPetId(new Long(200)); - order.setQuantity(new Integer(13)); - order.setShipDate(DateTime.now()); - order.setStatus(Order.StatusEnum.PLACED); - order.setComplete(true); - - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, TestUtils.nextId()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; + // TODO: test validations } + } diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java index 84fae0e990f..34a6a2c5721 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,85 +1,131 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.model.*; +import io.swagger.client.model.User; +import org.junit.Before; +import org.junit.Test; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -import java.util.Arrays; - -import org.junit.*; -import static org.junit.Assert.*; - +/** + * API tests for UserApi + */ public class UserApiTest { - UserApi api = null; + + private UserApi api; @Before public void setup() { api = new ApiClient().createService(UserApi.class); } + + /** + * Create user + * + * This can only be done by the logged in user. + */ @Test - public void testCreateUser() throws Exception { - User user = createUser(); + public void createUserTest() { + User user = null; + // api.createUser(user); - api.createUser(user); - - User fetched = api.getUserByName(user.getUsername()); - assertEquals(user.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithArray() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithArrayInputTest() { + List user = null; + // api.createUsersWithArrayInput(user); - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithList() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithListInputTest() { + List user = null; + // api.createUsersWithListInput(user); - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})); - - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + + /** + * Delete user + * + * This can only be done by the logged in user. + */ @Test - public void testLoginUser() throws Exception { - User user = createUser(); - api.createUser(user); + public void deleteUserTest() { + String username = null; + // api.deleteUser(username); - String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + // TODO: test validations } - + + /** + * Get user by user name + * + * + */ @Test - public void logoutUser() throws Exception { - api.logoutUser(); - } + public void getUserByNameTest() { + String username = null; + // User response = api.getUserByName(username); - private User createUser() { - User user = new User(); - user.setId(TestUtils.nextId()); - user.setUsername("fred" + user.getId()); - user.setFirstName("Fred"); - user.setLastName("Meyer"); - user.setEmail("fred@fredmeyer.com"); - user.setPassword("xxXXxx"); - user.setPhone("408-867-5309"); - user.setUserStatus(123); - - return user; + // TODO: test validations } + + /** + * Logs user into the system + * + * + */ + @Test + public void loginUserTest() { + String username = null; + String password = null; + // String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + */ + @Test + public void logoutUserTest() { + // api.logoutUser(); + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + String username = null; + User user = null; + // api.updateUser(username, user); + + // TODO: test validations + } + } diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator-ignore b/samples/client/petstore/java/retrofit2-play24/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/retrofit2-play24/.openapi-generator-ignore +++ b/samples/client/petstore/java/retrofit2-play24/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/retrofit2-play24/README.md b/samples/client/petstore/java/retrofit2-play24/README.md index 730060e131b..d37f5a50944 100644 --- a/samples/client/petstore/java/retrofit2-play24/README.md +++ b/samples/client/petstore/java/retrofit2-play24/README.md @@ -1,4 +1,4 @@ -# swagger-java-client +# petstore-java-client-retrofit2-play24 ## Requirements @@ -24,8 +24,8 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-java-client + org.openapitools + petstore-java-client-retrofit2-play24 1.0.0 compile diff --git a/samples/client/petstore/java/retrofit2-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 4c8ee19db6d..714331ea310 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-java-client' + pom.artifactId = 'petstore-java-client-retrofit2-play24' } } diff --git a/samples/client/petstore/java/retrofit2-play24/build.sbt b/samples/client/petstore/java/retrofit2-play24/build.sbt index 77681f6f5a6..d754ac539e1 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.sbt +++ b/samples/client/petstore/java/retrofit2-play24/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-java-client", + organization := "org.openapitools", + name := "petstore-java-client-retrofit2-play24", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md index bcc1a3a45ce..e1a16c24a1b 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md b/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md index 9526fadf552..67740bc517a 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8application/json; charset=utf-8, - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2-play24/docs/FakeClassnameTags123Api.md index 6b6078b2afd..6c2ce76dfac 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md b/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Name.md b/samples/client/petstore/java/retrofit2-play24/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Name.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play24/docs/OuterBoolean.md b/samples/client/petstore/java/retrofit2-play24/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/OuterNumber.md b/samples/client/petstore/java/retrofit2-play24/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/OuterString.md b/samples/client/petstore/java/retrofit2-play24/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md index 0bfc5532bbf..1dde66bd791 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md b/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md index 77314313236..41600763d6c 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md index 47754bafed3..5b5b7f10467 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index 2dfa72a3303..305b7e5e341 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-java-client + org.openapitools + petstore-java-client-retrofit2-play24 jar - swagger-java-client + petstore-java-client-retrofit2-play24 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/retrofit2-play24/settings.gradle b/samples/client/petstore/java/retrofit2-play24/settings.gradle index 55640f75122..38086de5588 100644 --- a/samples/client/petstore/java/retrofit2-play24/settings.gradle +++ b/samples/client/petstore/java/retrofit2-play24/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-java-client" \ No newline at end of file +rootProject.name = "petstore-java-client-retrofit2-play24" \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 24b3310021c..1d34d859b66 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; @@ -23,7 +25,7 @@ public interface AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -31,7 +33,7 @@ public interface AnotherFakeApi { }) @PATCH("another-fake/dummy") F.Promise> testSpecialTags( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } 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 64649d8607a..f37c261309c 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 @@ -8,12 +8,16 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import java.time.LocalDate; import java.time.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -27,23 +31,23 @@ public interface FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Call<Boolean> */ @POST("fake/outer/boolean") F.Promise> fakeOuterBooleanSerialize( - @retrofit2.http.Body Boolean body + @retrofit2.http.Body Boolean booleanPostBody ); /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Call<OuterComposite> */ @POST("fake/outer/composite") F.Promise> fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outerComposite ); /** @@ -68,10 +72,25 @@ public interface FakeApi { @retrofit2.http.Body String body ); + /** + * + * + * @param query (required) + * @param user (required) + * @return Call<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @PUT("fake/body-with-query-params") + F.Promise> testBodyWithQueryParams( + @retrofit2.http.Query("query") String query, @retrofit2.http.Body User user + ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -79,7 +98,7 @@ public interface FakeApi { }) @PATCH("fake") F.Promise> testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); /** @@ -104,32 +123,32 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @POST("fake") F.Promise> testEndpointParameters( - @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback + @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") MultipartBody.Part binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback ); /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return Call<Void> */ @retrofit2.http.FormUrlEncoded @GET("fake") F.Promise> testEnumParameters( - @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble + @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return Call<Void> */ @Headers({ @@ -137,7 +156,7 @@ public interface FakeApi { }) @POST("fake/inline-additionalProperties") F.Promise> testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body String requestBody ); /** 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 b3640b889a7..b87b58db675 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 @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; @@ -23,7 +25,7 @@ public interface FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -31,7 +33,7 @@ public interface FakeClassnameTags123Api { }) @PATCH("fake_classname_test") F.Promise> testClassname( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } 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 cee6252af7a..da2ee80fada 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 @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.io.File; import io.swagger.client.model.ModelApiResponse; @@ -25,7 +27,7 @@ public interface PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Call<Void> */ @Headers({ @@ -33,7 +35,7 @@ public interface PetApi { }) @POST("pet") F.Promise> addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -84,7 +86,7 @@ public interface PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Call<Void> */ @Headers({ @@ -92,7 +94,7 @@ public interface PetApi { }) @PUT("pet") F.Promise> updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -120,7 +122,7 @@ public interface PetApi { @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") F.Promise> uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file") MultipartBody.Part file ); } 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 3cfefc29b9d..20fec4408e8 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 @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Order; @@ -54,12 +56,12 @@ public interface StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Call<Order> */ @POST("store/order") F.Promise> placeOrder( - @retrofit2.http.Body Order body + @retrofit2.http.Body Order order ); } 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 2a9cc3b9909..918158a7c09 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 @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.User; @@ -23,34 +25,34 @@ public interface UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return Call<Void> */ @POST("user") F.Promise> createUser( - @retrofit2.http.Body User body + @retrofit2.http.Body User user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Call<Void> */ @POST("user/createWithArray") F.Promise> createUsersWithArrayInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Call<Void> */ @POST("user/createWithList") F.Promise> createUsersWithListInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** @@ -100,12 +102,12 @@ public interface UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Call<Void> */ @PUT("user/{username}") F.Promise> updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Path("username") String username, @retrofit2.http.Body User user ); } 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 59a060b266c..d0cfaa66374 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 @@ -69,6 +69,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -166,6 +206,25 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -232,6 +291,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -239,7 +299,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -249,6 +309,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 111e5068092..bf511465c46 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 @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -57,7 +58,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -228,7 +229,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -237,12 +238,13 @@ public class FormatTest { * Get binary * @return binary **/ + @Valid @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -341,7 +343,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -350,7 +352,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 5f9a94de22f..b93d37211d2 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 @@ -80,9 +80,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 12361b87e91..f307cfde2f3 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 @@ -39,7 +39,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..1317c490439 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,65 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..f0565bac76c --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,65 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..6bbd477c34c --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,65 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 9b2fa79d42f..19efbcc1419 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 @@ -29,24 +29,24 @@ import javax.validation.Valid; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -58,13 +58,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -73,7 +73,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index c32ef080d65..c7995abd833 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -29,8 +29,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - // Client response = api.testSpecialTags(body); + Client client = null; + // Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeApiTest.java index ab4b7c2c53d..9f2c4b9c39e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -3,8 +3,11 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import java.math.BigDecimal; import io.swagger.client.model.Client; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; +import java.io.File; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; @@ -25,20 +28,79 @@ public class FakeApiTest { api = new ApiClient().createService(FakeApi.class); } - /** - * To test \"client\" model + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + Boolean booleanPostBody = null; + // Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); + + // TODO: test validations + } + /** + * + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + /** + * + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + /** + * + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + /** + * * * */ @Test - public void testClientModelTest() { - Client body = null; - // Client response = api.testClientModel(body); + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + // api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** + * To test \"client\" model + * + * To test \"client\" model + */ + @Test + public void testClientModelTest() { + Client client = null; + // Client response = api.testClientModel(client); // TODO: test validations } - /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -55,34 +117,57 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; - DateTime dateTime = null; + OffsetDateTime dateTime = null; String password = null; String paramCallback = null; - // Void response = 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 } - /** * To test enum parameters * - * + * To test enum parameters */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; - BigDecimal enumQueryInteger = null; + Integer enumQueryInteger = null; Double enumQueryDouble = null; - // Void response = api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + // api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + // api.testJsonFormData(param, param2); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 2fd2c16ed50..d88adc9ef8d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -22,18 +22,16 @@ public class FakeClassnameTags123ApiTest { api = new ApiClient().createService(FakeClassnameTags123Api.class); } - /** * To test class name in snake case * - * + * To test class name in snake case */ @Test public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + Client client = null; + // Client response = api.testClassname(client); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/PetApiTest.java index a3688eb35c5..a4692725c0b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/PetApiTest.java @@ -24,7 +24,6 @@ public class PetApiTest { api = new ApiClient().createService(PetApi.class); } - /** * Add a new pet to the store * @@ -32,12 +31,11 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet body = null; - // Void response = api.addPet(body); + Pet pet = null; + // api.addPet(pet); // TODO: test validations } - /** * Deletes a pet * @@ -47,11 +45,10 @@ public class PetApiTest { public void deletePetTest() { Long petId = null; String apiKey = null; - // Void response = api.deletePet(petId, apiKey); + // api.deletePet(petId, apiKey); // TODO: test validations } - /** * Finds Pets by status * @@ -64,7 +61,6 @@ public class PetApiTest { // TODO: test validations } - /** * Finds Pets by tags * @@ -77,7 +73,6 @@ public class PetApiTest { // TODO: test validations } - /** * Find pet by ID * @@ -90,7 +85,6 @@ public class PetApiTest { // TODO: test validations } - /** * Update an existing pet * @@ -98,12 +92,11 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet body = null; - // Void response = api.updatePet(body); + Pet pet = null; + // api.updatePet(pet); // TODO: test validations } - /** * Updates a pet in the store with form data * @@ -114,11 +107,10 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - // Void response = api.updatePetWithForm(petId, name, status); + // api.updatePetWithForm(petId, name, status); // TODO: test validations } - /** * uploads an image * @@ -133,5 +125,4 @@ public class PetApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/StoreApiTest.java index 1da787edf19..c9d4dfa6598 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -22,7 +22,6 @@ public class StoreApiTest { api = new ApiClient().createService(StoreApi.class); } - /** * Delete purchase order by ID * @@ -31,11 +30,10 @@ public class StoreApiTest { @Test public void deleteOrderTest() { String orderId = null; - // Void response = api.deleteOrder(orderId); + // api.deleteOrder(orderId); // TODO: test validations } - /** * Returns pet inventories by status * @@ -47,7 +45,6 @@ public class StoreApiTest { // TODO: test validations } - /** * Find purchase order by ID * @@ -60,7 +57,6 @@ public class StoreApiTest { // TODO: test validations } - /** * Place an order for a pet * @@ -68,10 +64,9 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order body = null; - // Order response = api.placeOrder(body); + Order order = null; + // Order response = api.placeOrder(order); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/UserApiTest.java index cd8553d8419..0456e19e04c 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/UserApiTest.java @@ -22,7 +22,6 @@ public class UserApiTest { api = new ApiClient().createService(UserApi.class); } - /** * Create user * @@ -30,12 +29,11 @@ public class UserApiTest { */ @Test public void createUserTest() { - User body = null; - // Void response = api.createUser(body); + User user = null; + // api.createUser(user); // TODO: test validations } - /** * Creates list of users with given input array * @@ -43,12 +41,11 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List body = null; - // Void response = api.createUsersWithArrayInput(body); + List user = null; + // api.createUsersWithArrayInput(user); // TODO: test validations } - /** * Creates list of users with given input array * @@ -56,12 +53,11 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List body = null; - // Void response = api.createUsersWithListInput(body); + List user = null; + // api.createUsersWithListInput(user); // TODO: test validations } - /** * Delete user * @@ -70,11 +66,10 @@ public class UserApiTest { @Test public void deleteUserTest() { String username = null; - // Void response = api.deleteUser(username); + // api.deleteUser(username); // TODO: test validations } - /** * Get user by user name * @@ -87,7 +82,6 @@ public class UserApiTest { // TODO: test validations } - /** * Logs user into the system * @@ -101,7 +95,6 @@ public class UserApiTest { // TODO: test validations } - /** * Logs out current logged in user session * @@ -109,11 +102,10 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - // Void response = api.logoutUser(); + // api.logoutUser(); // TODO: test validations } - /** * Updated user * @@ -122,10 +114,9 @@ public class UserApiTest { @Test public void updateUserTest() { String username = null; - User body = null; - // Void response = api.updateUser(username, body); + User user = null; + // api.updateUser(username, user); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator-ignore b/samples/client/petstore/java/retrofit2-play25/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator-ignore +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION index 855ff9501eb..096bf47efe3 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/README.md b/samples/client/petstore/java/retrofit2-play25/README.md index 730060e131b..4307ca07fbc 100644 --- a/samples/client/petstore/java/retrofit2-play25/README.md +++ b/samples/client/petstore/java/retrofit2-play25/README.md @@ -1,4 +1,4 @@ -# swagger-java-client +# petstore-java-client-retrofit2-play25 ## Requirements @@ -24,8 +24,8 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-java-client + org.openapitools + petstore-java-client-retrofit2-play25 1.0.0 compile diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index 01f25ad289c..8197e915993 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-java-client' + pom.artifactId = 'petstore-java-client-retrofit2-play25' } } diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index addc43ee197..49e5cc4d0e9 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-java-client", + organization := "org.openapitools", + name := "petstore-java-client-retrofit2-play25", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md index bcc1a3a45ce..e1a16c24a1b 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md b/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md index 9526fadf552..67740bc517a 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8application/json; charset=utf-8, - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2-play25/docs/FakeClassnameTags123Api.md index 715fed0dc0b..6c2ce76dfac 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeClassnameTags123Api.md @@ -9,7 +9,9 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) + +To test class name in snake case To test class name in snake case @@ -31,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -45,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md b/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Name.md b/samples/client/petstore/java/retrofit2-play25/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Name.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play25/docs/OuterBoolean.md b/samples/client/petstore/java/retrofit2-play25/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/OuterNumber.md b/samples/client/petstore/java/retrofit2-play25/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/OuterString.md b/samples/client/petstore/java/retrofit2-play25/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md index 0bfc5532bbf..1dde66bd791 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md b/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md index 77314313236..41600763d6c 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md index 47754bafed3..5b5b7f10467 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index 0b877f37cd8..9181b7d41b4 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-java-client + org.openapitools + petstore-java-client-retrofit2-play25 jar - swagger-java-client + petstore-java-client-retrofit2-play25 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/retrofit2-play25/settings.gradle b/samples/client/petstore/java/retrofit2-play25/settings.gradle index 55640f75122..1a1d1329c84 100644 --- a/samples/client/petstore/java/retrofit2-play25/settings.gradle +++ b/samples/client/petstore/java/retrofit2-play25/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-java-client" \ No newline at end of file +rootProject.name = "petstore-java-client-retrofit2-play25" \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 8a8b70536ad..f3b29972988 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; @@ -23,7 +25,7 @@ public interface AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -31,7 +33,7 @@ public interface AnotherFakeApi { }) @PATCH("another-fake/dummy") CompletionStage> testSpecialTags( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java index 3d1b685c6d0..473dfaf2c08 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java @@ -8,12 +8,16 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -27,23 +31,23 @@ public interface FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Call<Boolean> */ @POST("fake/outer/boolean") CompletionStage> fakeOuterBooleanSerialize( - @retrofit2.http.Body Boolean body + @retrofit2.http.Body Boolean booleanPostBody ); /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Call<OuterComposite> */ @POST("fake/outer/composite") CompletionStage> fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outerComposite ); /** @@ -68,10 +72,25 @@ public interface FakeApi { @retrofit2.http.Body String body ); + /** + * + * + * @param query (required) + * @param user (required) + * @return Call<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @PUT("fake/body-with-query-params") + CompletionStage> testBodyWithQueryParams( + @retrofit2.http.Query("query") String query, @retrofit2.http.Body User user + ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -79,7 +98,7 @@ public interface FakeApi { }) @PATCH("fake") CompletionStage> testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); /** @@ -104,32 +123,32 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @POST("fake") CompletionStage> testEndpointParameters( - @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback + @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") MultipartBody.Part binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback ); /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return Call<Void> */ @retrofit2.http.FormUrlEncoded @GET("fake") CompletionStage> testEnumParameters( - @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble + @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return Call<Void> */ @Headers({ @@ -137,7 +156,7 @@ public interface FakeApi { }) @POST("fake/inline-additionalProperties") CompletionStage> testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body String requestBody ); /** diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 29195c16acb..5f64638f3be 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; @@ -22,8 +24,8 @@ import retrofit2.Response; public interface FakeClassnameTags123Api { /** * To test class name in snake case - * - * @param body client model (required) + * To test class name in snake case + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -31,7 +33,7 @@ public interface FakeClassnameTags123Api { }) @PATCH("fake_classname_test") CompletionStage> testClassname( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java index eabf6f7f2ea..89e7808b468 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.io.File; import io.swagger.client.model.ModelApiResponse; @@ -25,7 +27,7 @@ public interface PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Call<Void> */ @Headers({ @@ -33,7 +35,7 @@ public interface PetApi { }) @POST("pet") CompletionStage> addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -84,7 +86,7 @@ public interface PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Call<Void> */ @Headers({ @@ -92,7 +94,7 @@ public interface PetApi { }) @PUT("pet") CompletionStage> updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -120,7 +122,7 @@ public interface PetApi { @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") CompletionStage> uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file") MultipartBody.Part file ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/StoreApi.java index e0c0ebe12ff..5afb0c182ca 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/StoreApi.java @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Order; @@ -54,12 +56,12 @@ public interface StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Call<Order> */ @POST("store/order") CompletionStage> placeOrder( - @retrofit2.http.Body Order body + @retrofit2.http.Body Order order ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java index bd9052c78ee..227b80772d7 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java @@ -8,6 +8,8 @@ import retrofit2.Call; import retrofit2.http.*; import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.User; @@ -23,34 +25,34 @@ public interface UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return Call<Void> */ @POST("user") CompletionStage> createUser( - @retrofit2.http.Body User body + @retrofit2.http.Body User user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Call<Void> */ @POST("user/createWithArray") CompletionStage> createUsersWithArrayInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Call<Void> */ @POST("user/createWithList") CompletionStage> createUsersWithListInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** @@ -100,12 +102,12 @@ public interface UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Call<Void> */ @PUT("user/{username}") CompletionStage> updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Path("username") String username, @retrofit2.http.Body User user ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java index 59a060b266c..d0cfaa66374 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java @@ -69,6 +69,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -166,6 +206,25 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -232,6 +291,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -239,7 +299,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -249,6 +309,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java index 0b8cad1e86e..f8bb913975f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -57,7 +58,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private File binary = null; @JsonProperty("date") private LocalDate date = null; @@ -228,7 +229,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -237,12 +238,13 @@ public class FormatTest { * Get binary * @return binary **/ + @Valid @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -341,7 +343,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -350,7 +352,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java index 5f9a94de22f..b93d37211d2 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java @@ -80,9 +80,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java index 12361b87e91..f307cfde2f3 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java @@ -39,7 +39,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..1317c490439 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,65 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..f0565bac76c --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,65 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..6bbd477c34c --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,65 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java index 9b2fa79d42f..19efbcc1419 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -29,24 +29,24 @@ import javax.validation.Valid; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -58,13 +58,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -73,7 +73,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index c32ef080d65..c7995abd833 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -29,8 +29,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - // Client response = api.testSpecialTags(body); + Client client = null; + // Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeApiTest.java index fa8f9a1945c..3f6252d956f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -3,9 +3,11 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import java.math.BigDecimal; import io.swagger.client.model.Client; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; +import java.io.File; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; @@ -26,7 +28,6 @@ public class FakeApiTest { api = new ApiClient().createService(FakeApi.class); } - /** * * @@ -34,12 +35,11 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - // Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + // Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } - /** * * @@ -47,12 +47,11 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } - /** * * @@ -65,7 +64,6 @@ public class FakeApiTest { // TODO: test validations } - /** * * @@ -78,7 +76,19 @@ public class FakeApiTest { // TODO: test validations } - + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + // api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } /** * To test \"client\" model * @@ -86,12 +96,11 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client body = null; - // Client response = api.testClientModel(body); + Client client = null; + // Client response = api.testClientModel(client); // TODO: test validations } - /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -108,16 +117,15 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; - DateTime dateTime = null; + OffsetDateTime dateTime = null; String password = null; String paramCallback = null; - // Void response = 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 } - /** * To test enum parameters * @@ -125,17 +133,41 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - // Void response = api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + // api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + // api.testJsonFormData(param, param2); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 2fd2c16ed50..d88adc9ef8d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -22,18 +22,16 @@ public class FakeClassnameTags123ApiTest { api = new ApiClient().createService(FakeClassnameTags123Api.class); } - /** * To test class name in snake case * - * + * To test class name in snake case */ @Test public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + Client client = null; + // Client response = api.testClassname(client); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/PetApiTest.java index a3688eb35c5..a4692725c0b 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/PetApiTest.java @@ -24,7 +24,6 @@ public class PetApiTest { api = new ApiClient().createService(PetApi.class); } - /** * Add a new pet to the store * @@ -32,12 +31,11 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet body = null; - // Void response = api.addPet(body); + Pet pet = null; + // api.addPet(pet); // TODO: test validations } - /** * Deletes a pet * @@ -47,11 +45,10 @@ public class PetApiTest { public void deletePetTest() { Long petId = null; String apiKey = null; - // Void response = api.deletePet(petId, apiKey); + // api.deletePet(petId, apiKey); // TODO: test validations } - /** * Finds Pets by status * @@ -64,7 +61,6 @@ public class PetApiTest { // TODO: test validations } - /** * Finds Pets by tags * @@ -77,7 +73,6 @@ public class PetApiTest { // TODO: test validations } - /** * Find pet by ID * @@ -90,7 +85,6 @@ public class PetApiTest { // TODO: test validations } - /** * Update an existing pet * @@ -98,12 +92,11 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet body = null; - // Void response = api.updatePet(body); + Pet pet = null; + // api.updatePet(pet); // TODO: test validations } - /** * Updates a pet in the store with form data * @@ -114,11 +107,10 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - // Void response = api.updatePetWithForm(petId, name, status); + // api.updatePetWithForm(petId, name, status); // TODO: test validations } - /** * uploads an image * @@ -133,5 +125,4 @@ public class PetApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/StoreApiTest.java index 1da787edf19..c9d4dfa6598 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -22,7 +22,6 @@ public class StoreApiTest { api = new ApiClient().createService(StoreApi.class); } - /** * Delete purchase order by ID * @@ -31,11 +30,10 @@ public class StoreApiTest { @Test public void deleteOrderTest() { String orderId = null; - // Void response = api.deleteOrder(orderId); + // api.deleteOrder(orderId); // TODO: test validations } - /** * Returns pet inventories by status * @@ -47,7 +45,6 @@ public class StoreApiTest { // TODO: test validations } - /** * Find purchase order by ID * @@ -60,7 +57,6 @@ public class StoreApiTest { // TODO: test validations } - /** * Place an order for a pet * @@ -68,10 +64,9 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order body = null; - // Order response = api.placeOrder(body); + Order order = null; + // Order response = api.placeOrder(order); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/UserApiTest.java index cd8553d8419..0456e19e04c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/UserApiTest.java @@ -22,7 +22,6 @@ public class UserApiTest { api = new ApiClient().createService(UserApi.class); } - /** * Create user * @@ -30,12 +29,11 @@ public class UserApiTest { */ @Test public void createUserTest() { - User body = null; - // Void response = api.createUser(body); + User user = null; + // api.createUser(user); // TODO: test validations } - /** * Creates list of users with given input array * @@ -43,12 +41,11 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List body = null; - // Void response = api.createUsersWithArrayInput(body); + List user = null; + // api.createUsersWithArrayInput(user); // TODO: test validations } - /** * Creates list of users with given input array * @@ -56,12 +53,11 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List body = null; - // Void response = api.createUsersWithListInput(body); + List user = null; + // api.createUsersWithListInput(user); // TODO: test validations } - /** * Delete user * @@ -70,11 +66,10 @@ public class UserApiTest { @Test public void deleteUserTest() { String username = null; - // Void response = api.deleteUser(username); + // api.deleteUser(username); // TODO: test validations } - /** * Get user by user name * @@ -87,7 +82,6 @@ public class UserApiTest { // TODO: test validations } - /** * Logs user into the system * @@ -101,7 +95,6 @@ public class UserApiTest { // TODO: test validations } - /** * Logs out current logged in user session * @@ -109,11 +102,10 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - // Void response = api.logoutUser(); + // api.logoutUser(); // TODO: test validations } - /** * Updated user * @@ -122,10 +114,9 @@ public class UserApiTest { @Test public void updateUserTest() { String username = null; - User body = null; - // Void response = api.updateUser(username, body); + User user = null; + // api.updateUser(username, user); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator-ignore b/samples/client/petstore/java/retrofit2/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator-ignore +++ b/samples/client/petstore/java/retrofit2/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/retrofit2/README.md b/samples/client/petstore/java/retrofit2/README.md index d5f7ec9f1ce..382c6c9603a 100644 --- a/samples/client/petstore/java/retrofit2/README.md +++ b/samples/client/petstore/java/retrofit2/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-retrofit2 +# petstore-retrofit2 ## Requirements @@ -24,18 +24,14 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-petstore-retrofit2 + org.openapitools + petstore-retrofit2 1.0.0 compile ``` -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. - ## Author apiteam@swagger.io diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index bcbaf119988..f4017a3f71f 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-retrofit2' + pom.artifactId = 'petstore-retrofit2' } } diff --git a/samples/client/petstore/java/retrofit2/build.sbt b/samples/client/petstore/java/retrofit2/build.sbt index 4513bfe6a5d..ef3a285ecb9 100644 --- a/samples/client/petstore/java/retrofit2/build.sbt +++ b/samples/client/petstore/java/retrofit2/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-retrofit2", + organization := "org.openapitools", + name := "petstore-retrofit2", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md index bcc1a3a45ce..e1a16c24a1b 100644 --- a/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/retrofit2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index 9526fadf552..67740bc517a 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8application/json; charset=utf-8, - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md index 6b6078b2afd..6c2ce76dfac 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/retrofit2/docs/Fake_classname_tags123Api.md deleted file mode 100644 index dd2015369e4..00000000000 --- a/samples/client/petstore/java/retrofit2/docs/Fake_classname_tags123Api.md +++ /dev/null @@ -1,52 +0,0 @@ -# Fake_classname_tags123Api - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.Fake_classname_tags123Api; - - -Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling Fake_classname_tags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/retrofit2/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/retrofit2/docs/FakeclassnametagsApi.md deleted file mode 100644 index 21b6f7b2009..00000000000 --- a/samples/client/petstore/java/retrofit2/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/retrofit2/docs/FormatTest.md b/samples/client/petstore/java/retrofit2/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/retrofit2/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2/docs/Name.md b/samples/client/petstore/java/retrofit2/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/retrofit2/docs/Name.md +++ b/samples/client/petstore/java/retrofit2/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/retrofit2/docs/OuterBoolean.md b/samples/client/petstore/java/retrofit2/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2/docs/OuterNumber.md b/samples/client/petstore/java/retrofit2/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2/docs/OuterString.md b/samples/client/petstore/java/retrofit2/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2/docs/PetApi.md b/samples/client/petstore/java/retrofit2/docs/PetApi.md index 0bfc5532bbf..1dde66bd791 100644 --- a/samples/client/petstore/java/retrofit2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/retrofit2/docs/StoreApi.md b/samples/client/petstore/java/retrofit2/docs/StoreApi.md index 77314313236..41600763d6c 100644 --- a/samples/client/petstore/java/retrofit2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/retrofit2/docs/UserApi.md b/samples/client/petstore/java/retrofit2/docs/UserApi.md index 47754bafed3..5b5b7f10467 100644 --- a/samples/client/petstore/java/retrofit2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 8aeb47c55b5..eefa92c58a4 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-retrofit2 + org.openapitools + petstore-retrofit2 jar - swagger-petstore-retrofit2 + petstore-retrofit2 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/retrofit2/settings.gradle b/samples/client/petstore/java/retrofit2/settings.gradle index c42bfff90c4..22463123dd4 100644 --- a/samples/client/petstore/java/retrofit2/settings.gradle +++ b/samples/client/petstore/java/retrofit2/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-retrofit2" \ No newline at end of file +rootProject.name = "petstore-retrofit2" \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java index aa07fc781cc..72d64abacfb 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java @@ -57,7 +57,7 @@ public class JSON { classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "")); } }) ; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 086d3d6b652..0993ec3eb33 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -20,7 +20,7 @@ public interface AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -28,7 +28,7 @@ public interface AnotherFakeApi { }) @PATCH("another-fake/dummy") Call testSpecialTags( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } 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 06810d19a1f..717edb676b1 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 @@ -11,9 +11,11 @@ import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -24,23 +26,23 @@ public interface FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Call<Boolean> */ @POST("fake/outer/boolean") Call fakeOuterBooleanSerialize( - @retrofit2.http.Body Boolean body + @retrofit2.http.Body Boolean booleanPostBody ); /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Call<OuterComposite> */ @POST("fake/outer/composite") Call fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outerComposite ); /** @@ -65,10 +67,25 @@ public interface FakeApi { @retrofit2.http.Body String body ); + /** + * + * + * @param query (required) + * @param user (required) + * @return Call<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @PUT("fake/body-with-query-params") + Call testBodyWithQueryParams( + @retrofit2.http.Query("query") String query, @retrofit2.http.Body User user + ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -76,7 +93,7 @@ public interface FakeApi { }) @PATCH("fake") Call testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); /** @@ -101,32 +118,32 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @POST("fake") Call testEndpointParameters( - @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback + @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") MultipartBody.Part binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback ); /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return Call<Void> */ @retrofit2.http.FormUrlEncoded @GET("fake") Call testEnumParameters( - @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble + @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return Call<Void> */ @Headers({ @@ -134,7 +151,7 @@ public interface FakeApi { }) @POST("fake/inline-additionalProperties") Call testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body String requestBody ); /** 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 5fddb84307f..609491ce54c 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 @@ -20,7 +20,7 @@ public interface FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Call<Client> */ @Headers({ @@ -28,7 +28,7 @@ public interface FakeClassnameTags123Api { }) @PATCH("fake_classname_test") Call testClassname( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } 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 a3e4edbc79d..c13edbbdd06 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 @@ -22,7 +22,7 @@ public interface PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Call<Void> */ @Headers({ @@ -30,7 +30,7 @@ public interface PetApi { }) @POST("pet") Call addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -83,7 +83,7 @@ public interface PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Call<Void> */ @Headers({ @@ -91,7 +91,7 @@ public interface PetApi { }) @PUT("pet") Call updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -119,7 +119,7 @@ public interface PetApi { @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Call uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file") MultipartBody.Part file ); } 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 ef1a16963b1..6d7aeb41cd2 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 @@ -51,12 +51,12 @@ public interface StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Call<Order> */ @POST("store/order") Call placeOrder( - @retrofit2.http.Body Order body + @retrofit2.http.Body Order order ); } 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 e9b60ea44ed..219c98181e3 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 @@ -20,34 +20,34 @@ public interface UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return Call<Void> */ @POST("user") Call createUser( - @retrofit2.http.Body User body + @retrofit2.http.Body User user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Call<Void> */ @POST("user/createWithArray") Call createUsersWithArrayInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Call<Void> */ @POST("user/createWithList") Call createUsersWithListInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** @@ -97,12 +97,12 @@ public interface UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Call<Void> */ @PUT("user/{username}") Call updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Path("username") String username, @retrofit2.http.Body User user ); } 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 a572c0d6b5b..7a1b9c32152 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 @@ -82,6 +82,58 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + @JsonAdapter(EnumStringRequiredEnum.Adapter.class) + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringRequiredEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -203,6 +255,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -268,6 +338,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -275,7 +346,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -285,6 +356,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 3223d766753..24ce7363eac 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 @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; @@ -58,7 +59,7 @@ public class FormatTest { private byte[] _byte = null; @SerializedName("binary") - private byte[] binary = null; + private File binary = null; @SerializedName("date") private LocalDate date = null; @@ -226,7 +227,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -236,11 +237,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -334,7 +335,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -343,7 +344,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 1bcc6ac44bf..28c5997ded5 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 @@ -81,9 +81,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 f6a3f8f4195..a7b129c2a4d 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 @@ -40,7 +40,7 @@ public class Name { private String property = null; @SerializedName("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 9c0a4477a04..185b853dce9 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 @@ -30,24 +30,24 @@ import java.io.IOException; public class SpecialModelName { @SerializedName("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -59,13 +59,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -74,7 +74,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index bf5a476ab29..00000000000 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index c32ef080d65..c7995abd833 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -29,8 +29,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - // Client response = api.testSpecialTags(body); + Client client = null; + // Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeApiTest.java index 49bc4b90504..3f6252d956f 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -2,7 +2,12 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import java.math.BigDecimal; -import java.util.Date; +import io.swagger.client.model.Client; +import java.io.File; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; @@ -23,7 +28,79 @@ public class FakeApiTest { api = new ApiClient().createService(FakeApi.class); } - + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + Boolean booleanPostBody = null; + // Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); + + // TODO: test validations + } + /** + * + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + /** + * + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + /** + * + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + // api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** + * To test \"client\" model + * + * To test \"client\" model + */ + @Test + public void testClientModelTest() { + Client client = null; + // Client response = api.testClientModel(client); + + // TODO: test validations + } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -33,19 +110,64 @@ public class FakeApiTest { public void testEndpointParametersTest() { BigDecimal number = null; Double _double = null; - String string = null; + String patternWithoutDelimiter = null; byte[] _byte = null; Integer integer = null; Integer int32 = null; Long int64 = null; Float _float = null; - byte[] binary = null; - Date date = null; - Date dateTime = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; String password = null; - // Void response = api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + String paramCallback = null; + // api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + } + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + // api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + // api.testJsonFormData(param, param2); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 2fd2c16ed50..d88adc9ef8d 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -22,18 +22,16 @@ public class FakeClassnameTags123ApiTest { api = new ApiClient().createService(FakeClassnameTags123Api.class); } - /** * To test class name in snake case * - * + * To test class name in snake case */ @Test public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + Client client = null; + // Client response = api.testClassname(client); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java index 25f807c8cae..a4692725c0b 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,190 +1,128 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.CollectionFormats.*; -import io.swagger.client.model.*; - -import java.io.BufferedWriter; import java.io.File; -import java.io.FileWriter; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Before; +import org.junit.Test; + import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; -import org.junit.*; - -import retrofit2.Response; - -import okhttp3.MediaType; -import okhttp3.RequestBody; -import okhttp3.MultipartBody; - -import static org.junit.Assert.*; - +/** + * API tests for PetApi + */ public class PetApiTest { - PetApi api = null; + + private PetApi api; @Before public void setup() { api = new ApiClient().createService(PetApi.class); } + /** + * Add a new pet to the store + * + * + */ @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createRandomPet(); - Response rp2 = api.addPet(pet).execute(); + public void addPetTest() { + Pet pet = null; + // api.addPet(pet); - Response rp = api.getPetById(pet.getId()).execute(); - Pet fetched = rp.body(); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + /** + * Deletes a pet + * + * + */ @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); + public void deletePetTest() { + Long petId = null; + String apiKey = null; + // api.deletePet(petId, apiKey); - api.updatePet(pet).execute(); - - Pet fetched = api.getPetById(pet.getId()).execute().body(); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + // TODO: test validations } - + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void findPetsByStatusTest() { + List status = null; + // List response = api.findPetsByStatus(status); - api.updatePet(pet).execute(); - - List pets = api.findPetsByStatus(new CSVParams("available")).execute().body(); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); + // TODO: test validations } - + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ @Test - public void testFindPetsByTags() throws Exception { - Pet pet = createRandomPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); + public void findPetsByTagsTest() { + List tags = null; + // List response = api.findPetsByTags(tags); - List tags = new ArrayList(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet).execute(); - - List pets = api.findPetsByTags(new CSVParams("friendly")).execute().body(); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); + // TODO: test validations } - + /** + * Find pet by ID + * + * Returns a single pet + */ @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet).execute(); + public void getPetByIdTest() { + Long petId = null; + // Pet response = api.getPetById(petId); - Pet fetched = api.getPetById(pet.getId()).execute().body(); - - api.updatePetWithForm(fetched.getId(), "furt", null).execute(); - Pet updated = api.getPetById(fetched.getId()).execute().body(); - - assertEquals(updated.getName(), "furt"); + // TODO: test validations } - + /** + * Update an existing pet + * + * + */ @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet).execute(); + public void updatePetTest() { + Pet pet = null; + // api.updatePet(pet); - Pet fetched = api.getPetById(pet.getId()).execute().body(); - api.deletePet(fetched.getId(), null).execute(); - - assertFalse(api.getPetById(fetched.getId()).execute().isSuccessful()); + // TODO: test validations } - + /** + * Updates a pet in the store with form data + * + * + */ @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet).execute(); + public void updatePetWithFormTest() { + Long petId = null; + String name = null; + String status = null; + // api.updatePetWithForm(petId, name, status); - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - final RequestBody body = RequestBody.create(MediaType.parse("text/plain"), file); - api.uploadFile(pet.getId(), null, MultipartBody.Part.createFormData("datafile", file.getName(), body)).execute(); + // TODO: test validations } - + /** + * uploads an image + * + * + */ @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); + public void uploadFileTest() { + Long petId = null; + String additionalMetadata = null; + File file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"}); - pet.setPhotoUrls(photos); - - return pet; + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/StoreApiTest.java index 22009672396..c9d4dfa6598 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,77 +1,72 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.api.*; -import io.swagger.client.model.*; +import io.swagger.client.model.Order; +import org.junit.Before; +import org.junit.Test; -import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; -import org.junit.*; -import org.threeten.bp.OffsetDateTime; - -import retrofit2.Response; -import static org.junit.Assert.*; - +/** + * API tests for StoreApi + */ public class StoreApiTest { - private StoreApi api = null; + + private StoreApi api; @Before public void setup() { api = new ApiClient().createService(StoreApi.class); } + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory().execute().body(); - assertTrue(inventory.keySet().size() > 0); - } + public void deleteOrderTest() { + String orderId = null; + // api.deleteOrder(orderId); + // TODO: test validations + } + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + */ @Test - public void testPlaceOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order).execute(); + public void getInventoryTest() { + // Map response = api.getInventory(); - Order fetched = api.getOrderById(order.getId()).execute().body(); - assertEquals(order.getId(), fetched.getId()); - assertEquals(order.getPetId(), fetched.getPetId()); - assertEquals(order.getQuantity(), fetched.getQuantity()); - assertEquals(order.getShipDate().toInstant(), fetched.getShipDate().toInstant()); + // TODO: test validations } - + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - Response aa = api.placeOrder(order).execute(); + public void getOrderByIdTest() { + Long orderId = null; + // Order response = api.getOrderById(orderId); - Order fetched = api.getOrderById(order.getId()).execute().body(); - assertEquals(fetched.getId(), order.getId()); - - api.deleteOrder(String.valueOf(order.getId())).execute(); - - api.getOrderById(order.getId()).execute(); - //also in retrofit 1 should return an error but don't, check server api impl. + // TODO: test validations } + /** + * Place an order for a pet + * + * + */ + @Test + public void placeOrderTest() { + Order order = null; + // Order response = api.placeOrder(order); - private Order createOrder() { - Order order = new Order(); - order.setPetId(200L); - order.setQuantity(13); - //Ensure 3 fractional digits because of a bug in the petstore server - order.setShipDate(OffsetDateTime.now().withNano(123000000)); - order.setStatus(Order.StatusEnum.PLACED); - order.setComplete(true); - - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, TestUtils.nextId()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java index 70fbb8fef98..0456e19e04c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,86 +1,122 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.api.*; -import io.swagger.client.model.*; +import io.swagger.client.model.User; +import org.junit.Before; +import org.junit.Test; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -import java.util.Arrays; - -import org.junit.*; -import static org.junit.Assert.*; - +/** + * API tests for UserApi + */ public class UserApiTest { - UserApi api = null; + + private UserApi api; @Before public void setup() { api = new ApiClient().createService(UserApi.class); } + /** + * Create user + * + * This can only be done by the logged in user. + */ @Test - public void testCreateUser() throws Exception { - User user = createUser(); + public void createUserTest() { + User user = null; + // api.createUser(user); - api.createUser(user).execute(); - - User fetched = api.getUserByName(user.getUsername()).execute().body(); - assertEquals(user.getId(), fetched.getId()); + // TODO: test validations } - + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithArray() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithArrayInputTest() { + List user = null; + // api.createUsersWithArrayInput(user); - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})).execute(); - - User fetched = api.getUserByName(user1.getUsername()).execute().body(); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithList() throws Exception { - User user1 = createUser(); - user1.setUsername("user" + user1.getId()); - User user2 = createUser(); - user2.setUsername("user" + user2.getId()); + public void createUsersWithListInputTest() { + List user = null; + // api.createUsersWithListInput(user); - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})).execute(); - - User fetched = api.getUserByName(user1.getUsername()).execute().body(); - assertEquals(user1.getId(), fetched.getId()); + // TODO: test validations } - + /** + * Delete user + * + * This can only be done by the logged in user. + */ @Test - public void testLoginUser() throws Exception { - User user = createUser(); - api.createUser(user).execute(); + public void deleteUserTest() { + String username = null; + // api.deleteUser(username); - String token = api.loginUser(user.getUsername(), user.getPassword()).execute().body(); - assertTrue(token.startsWith("logged in user session:")); + // TODO: test validations } - + /** + * Get user by user name + * + * + */ @Test - public void logoutUser() throws Exception { - api.logoutUser().execute(); + public void getUserByNameTest() { + String username = null; + // User response = api.getUserByName(username); + + // TODO: test validations } + /** + * Logs user into the system + * + * + */ + @Test + public void loginUserTest() { + String username = null; + String password = null; + // String response = api.loginUser(username, password); - private User createUser() { - User user = new User(); - user.setId(TestUtils.nextId()); - user.setUsername("fred"); - user.setFirstName("Fred"); - user.setLastName("Meyer"); - user.setEmail("fred@fredmeyer.com"); - user.setPassword("xxXXxx"); - user.setPhone("408-867-5309"); - user.setUserStatus(123); + // TODO: test validations + } + /** + * Logs out current logged in user session + * + * + */ + @Test + public void logoutUserTest() { + // api.logoutUser(); - return user; + // TODO: test validations + } + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + String username = null; + User user = null; + // api.updateUser(username, user); + + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator-ignore b/samples/client/petstore/java/retrofit2rx/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/retrofit2rx/.openapi-generator-ignore +++ b/samples/client/petstore/java/retrofit2rx/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/retrofit2rx/README.md b/samples/client/petstore/java/retrofit2rx/README.md index a1f0b3468be..a8eb41bfadb 100644 --- a/samples/client/petstore/java/retrofit2rx/README.md +++ b/samples/client/petstore/java/retrofit2rx/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-retrofit2-rx +# petstore-retrofit2-rx ## Requirements @@ -24,18 +24,14 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-petstore-retrofit2-rx + org.openapitools + petstore-retrofit2-rx 1.0.0 compile ``` -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. - ## Author apiteam@swagger.io diff --git a/samples/client/petstore/java/retrofit2rx/build.gradle b/samples/client/petstore/java/retrofit2rx/build.gradle index 43f0fcbe3e3..79af8dae49d 100644 --- a/samples/client/petstore/java/retrofit2rx/build.gradle +++ b/samples/client/petstore/java/retrofit2rx/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-retrofit2-rx' + pom.artifactId = 'petstore-retrofit2-rx' } } diff --git a/samples/client/petstore/java/retrofit2rx/build.sbt b/samples/client/petstore/java/retrofit2rx/build.sbt index b0c73c5aeaf..023b614314e 100644 --- a/samples/client/petstore/java/retrofit2rx/build.sbt +++ b/samples/client/petstore/java/retrofit2rx/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-retrofit2-rx", + organization := "org.openapitools", + name := "petstore-retrofit2-rx", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md index bcc1a3a45ce..e1a16c24a1b 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index 9526fadf552..67740bc517a 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8application/json; charset=utf-8, - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md index 6b6078b2afd..6c2ce76dfac 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/retrofit2rx/docs/Fake_classname_tags123Api.md deleted file mode 100644 index dd2015369e4..00000000000 --- a/samples/client/petstore/java/retrofit2rx/docs/Fake_classname_tags123Api.md +++ /dev/null @@ -1,52 +0,0 @@ -# Fake_classname_tags123Api - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.Fake_classname_tags123Api; - - -Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling Fake_classname_tags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeclassnametagsApi.md deleted file mode 100644 index 21b6f7b2009..00000000000 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md b/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx/docs/Name.md b/samples/client/petstore/java/retrofit2rx/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Name.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx/docs/OuterBoolean.md b/samples/client/petstore/java/retrofit2rx/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/OuterNumber.md b/samples/client/petstore/java/retrofit2rx/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/OuterString.md b/samples/client/petstore/java/retrofit2rx/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md index 0bfc5532bbf..1dde66bd791 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md index 77314313236..41600763d6c 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md index 47754bafed3..5b5b7f10467 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index 92c39cffb45..d438ede5b46 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-retrofit2-rx + org.openapitools + petstore-retrofit2-rx jar - swagger-petstore-retrofit2-rx + petstore-retrofit2-rx 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/retrofit2rx/settings.gradle b/samples/client/petstore/java/retrofit2rx/settings.gradle index 6c54013a532..b87bf376548 100644 --- a/samples/client/petstore/java/retrofit2rx/settings.gradle +++ b/samples/client/petstore/java/retrofit2rx/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-retrofit2-rx" \ No newline at end of file +rootProject.name = "petstore-retrofit2-rx" \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/JSON.java index aa07fc781cc..72d64abacfb 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/JSON.java @@ -57,7 +57,7 @@ public class JSON { classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "")); } }) ; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 94301cef446..036edc191d9 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -20,7 +20,7 @@ public interface AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Observable<Client> */ @Headers({ @@ -28,7 +28,7 @@ public interface AnotherFakeApi { }) @PATCH("another-fake/dummy") Observable testSpecialTags( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } 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 0defac625ef..7bd244afe88 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 @@ -11,9 +11,11 @@ import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -24,23 +26,23 @@ public interface FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Observable<Boolean> */ @POST("fake/outer/boolean") Observable fakeOuterBooleanSerialize( - @retrofit2.http.Body Boolean body + @retrofit2.http.Body Boolean booleanPostBody ); /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Observable<OuterComposite> */ @POST("fake/outer/composite") Observable fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outerComposite ); /** @@ -65,10 +67,25 @@ public interface FakeApi { @retrofit2.http.Body String body ); + /** + * + * + * @param query (required) + * @param user (required) + * @return Observable<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @PUT("fake/body-with-query-params") + Observable testBodyWithQueryParams( + @retrofit2.http.Query("query") String query, @retrofit2.http.Body User user + ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Observable<Client> */ @Headers({ @@ -76,7 +93,7 @@ public interface FakeApi { }) @PATCH("fake") Observable testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); /** @@ -101,32 +118,32 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @POST("fake") Observable testEndpointParameters( - @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback + @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") MultipartBody.Part binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback ); /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return Observable<Void> */ @retrofit2.http.FormUrlEncoded @GET("fake") Observable testEnumParameters( - @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble + @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return Observable<Void> */ @Headers({ @@ -134,7 +151,7 @@ public interface FakeApi { }) @POST("fake/inline-additionalProperties") Observable testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body String 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 c22e2a0e58d..c985321b45b 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 @@ -20,7 +20,7 @@ public interface FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Observable<Client> */ @Headers({ @@ -28,7 +28,7 @@ public interface FakeClassnameTags123Api { }) @PATCH("fake_classname_test") Observable testClassname( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } 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 403ccb07b84..6c03af8a47c 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 @@ -22,7 +22,7 @@ public interface PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Observable<Void> */ @Headers({ @@ -30,7 +30,7 @@ public interface PetApi { }) @POST("pet") Observable addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -83,7 +83,7 @@ public interface PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Observable<Void> */ @Headers({ @@ -91,7 +91,7 @@ public interface PetApi { }) @PUT("pet") Observable updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -119,7 +119,7 @@ public interface PetApi { @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Observable uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file") MultipartBody.Part file ); } 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 1b31e032989..dfe0d3d210a 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 @@ -51,12 +51,12 @@ public interface StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Observable<Order> */ @POST("store/order") Observable placeOrder( - @retrofit2.http.Body Order body + @retrofit2.http.Body Order order ); } 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 1c042954cd5..549dc5d5a1e 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 @@ -20,34 +20,34 @@ public interface UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return Observable<Void> */ @POST("user") Observable createUser( - @retrofit2.http.Body User body + @retrofit2.http.Body User user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Observable<Void> */ @POST("user/createWithArray") Observable createUsersWithArrayInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Observable<Void> */ @POST("user/createWithList") Observable createUsersWithListInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** @@ -97,12 +97,12 @@ public interface UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Observable<Void> */ @PUT("user/{username}") Observable updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Path("username") String username, @retrofit2.http.Body User user ); } 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 a572c0d6b5b..7a1b9c32152 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 @@ -82,6 +82,58 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + @JsonAdapter(EnumStringRequiredEnum.Adapter.class) + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringRequiredEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -203,6 +255,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -268,6 +338,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -275,7 +346,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -285,6 +356,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); 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 3223d766753..24ce7363eac 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 @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; @@ -58,7 +59,7 @@ public class FormatTest { private byte[] _byte = null; @SerializedName("binary") - private byte[] binary = null; + private File binary = null; @SerializedName("date") private LocalDate date = null; @@ -226,7 +227,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -236,11 +237,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -334,7 +335,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -343,7 +344,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } 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 1bcc6ac44bf..28c5997ded5 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 @@ -81,9 +81,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override 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 f6a3f8f4195..a7b129c2a4d 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 @@ -40,7 +40,7 @@ public class Name { private String property = null; @SerializedName("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/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 9c0a4477a04..185b853dce9 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 @@ -30,24 +30,24 @@ import java.io.IOException; public class SpecialModelName { @SerializedName("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -59,13 +59,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -74,7 +74,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index c32ef080d65..c7995abd833 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -29,8 +29,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - // Client response = api.testSpecialTags(body); + Client client = null; + // Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeApiTest.java index 49bc4b90504..3f6252d956f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -2,7 +2,12 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import java.math.BigDecimal; -import java.util.Date; +import io.swagger.client.model.Client; +import java.io.File; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; @@ -23,7 +28,79 @@ public class FakeApiTest { api = new ApiClient().createService(FakeApi.class); } - + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + Boolean booleanPostBody = null; + // Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); + + // TODO: test validations + } + /** + * + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + /** + * + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + /** + * + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + // api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + /** + * To test \"client\" model + * + * To test \"client\" model + */ + @Test + public void testClientModelTest() { + Client client = null; + // Client response = api.testClientModel(client); + + // TODO: test validations + } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -33,19 +110,64 @@ public class FakeApiTest { public void testEndpointParametersTest() { BigDecimal number = null; Double _double = null; - String string = null; + String patternWithoutDelimiter = null; byte[] _byte = null; Integer integer = null; Integer int32 = null; Long int64 = null; Float _float = null; - byte[] binary = null; - Date date = null; - Date dateTime = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; String password = null; - // Void response = api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + String paramCallback = null; + // api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + } + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + // api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + // api.testJsonFormData(param, param2); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 2fd2c16ed50..d88adc9ef8d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -22,18 +22,16 @@ public class FakeClassnameTags123ApiTest { api = new ApiClient().createService(FakeClassnameTags123Api.class); } - /** * To test class name in snake case * - * + * To test class name in snake case */ @Test public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + Client client = null; + // Client response = api.testClassname(client); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java index 330504b6bd8..a4692725c0b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,255 +1,128 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import io.swagger.client.CollectionFormats.*; -import io.swagger.client.model.*; - -import java.io.BufferedWriter; import java.io.File; -import java.io.FileWriter; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; +import org.junit.Before; +import org.junit.Test; + import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; -import org.junit.*; - -import okhttp3.MediaType; -import okhttp3.MultipartBody; -import okhttp3.RequestBody; - -import static org.junit.Assert.*; - +/** + * API tests for PetApi + */ public class PetApiTest { - PetApi api = null; + + private PetApi api; @Before public void setup() { api = new ApiClient().createService(PetApi.class); } + /** + * Add a new pet to the store + * + * + */ @Test - public void testCreateAndGetPet() throws Exception { - final Pet pet = createRandomPet(); - api.addPet(pet).subscribe(new SkeletonSubscriber() { - @Override - public void onCompleted() { - api.getPetById(pet.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Pet fetched) { - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - } - }); - - } - }); + public void addPetTest() { + Pet pet = null; + // api.addPet(pet); + // TODO: test validations } - + /** + * Deletes a pet + * + * + */ @Test - public void testUpdatePet() throws Exception { - final Pet pet = createRandomPet(); - pet.setName("programmer"); - - api.updatePet(pet).subscribe(new SkeletonSubscriber() { - @Override - public void onCompleted() { - api.getPetById(pet.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Pet fetched) { - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - } - }); - - } - }); + public void deletePetTest() { + Long petId = null; + String apiKey = null; + // api.deletePet(petId, apiKey); + // TODO: test validations } - + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ @Test - public void testFindPetsByStatus() throws Exception { - final Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - api.updatePet(pet).subscribe(new SkeletonSubscriber() { - @Override - public void onCompleted() { - api.findPetsByStatus(new CSVParams("available")).subscribe(new SkeletonSubscriber>() { - @Override - public void onNext(List pets) { - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); - } - }); - - } - }); + public void findPetsByStatusTest() { + List status = null; + // List response = api.findPetsByStatus(status); + // TODO: test validations } - + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ @Test - public void testFindPetsByTags() throws Exception { - final Pet pet = createRandomPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - List tags = new ArrayList(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet).subscribe(new SkeletonSubscriber() { - @Override - public void onCompleted() { - api.findPetsByTags(new CSVParams("friendly")).subscribe(new SkeletonSubscriber>() { - @Override - public void onNext(List pets) { - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); - } - }); - - } - }); + public void findPetsByTagsTest() { + List tags = null; + // List response = api.findPetsByTags(tags); + // TODO: test validations } - + /** + * Find pet by ID + * + * Returns a single pet + */ @Test - public void testUpdatePetWithForm() throws Exception { - final Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet).subscribe(SkeletonSubscriber.failTestOnError()); - api.getPetById(pet.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(final Pet fetched) { - api.updatePetWithForm(fetched.getId(), "furt", null) - .subscribe(new SkeletonSubscriber() { - @Override - public void onCompleted() { - api.getPetById(fetched.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Pet updated) { - assertEquals(updated.getName(), "furt"); - } - }); - - } - }); - } - }); - + public void getPetByIdTest() { + Long petId = null; + // Pet response = api.getPetById(petId); + // TODO: test validations } - + /** + * Update an existing pet + * + * + */ @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet).subscribe(SkeletonSubscriber.failTestOnError()); + public void updatePetTest() { + Pet pet = null; + // api.updatePet(pet); - api.getPetById(pet.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Pet fetched) { - - api.deletePet(fetched.getId(), null).subscribe(SkeletonSubscriber.failTestOnError()); - api.getPetById(fetched.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Pet deletedPet) { - fail("Should not have found deleted pet."); - } - - @Override - public void onError(Throwable e) { - // expected, because the pet has been deleted. - } - }); - } - }); + // TODO: test validations } - + /** + * Updates a pet in the store with form data + * + * + */ @Test - public void testUploadFile() throws Exception { - File file = File.createTempFile("test", "hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); + public void updatePetWithFormTest() { + Long petId = null; + String name = null; + String status = null; + // api.updatePetWithForm(petId, name, status); - writer.write("Hello world!"); - writer.close(); - - Pet pet = createRandomPet(); - api.addPet(pet).subscribe(SkeletonSubscriber.failTestOnError()); - - final RequestBody body = RequestBody.create(MediaType.parse("text/plain"), file); - api.uploadFile(pet.getId(), "a test file", MultipartBody.Part.createFormData("datafile", file.getName(), body)).subscribe(new SkeletonSubscriber() { - @Override - public void onError(Throwable e) { - // this also yields a 400 for other tests, so I guess it's okay... - } - }); + // TODO: test validations } - + /** + * uploads an image + * + * + */ @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); + public void uploadFileTest() { + Long petId = null; + String additionalMetadata = null; + File file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"})); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(System.currentTimeMillis()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"}); - pet.setPhotoUrls(photos); - - return pet; + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/SkeletonSubscriber.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/SkeletonSubscriber.java deleted file mode 100644 index 47d0df05e28..00000000000 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/SkeletonSubscriber.java +++ /dev/null @@ -1,30 +0,0 @@ -package io.swagger.client.api; - -import junit.framework.TestFailure; -import rx.Subscriber; - -/** - * Skeleton subscriber for tests that will fail when onError() is called unexpectedly. - */ -public abstract class SkeletonSubscriber extends Subscriber { - - public static SkeletonSubscriber failTestOnError() { - return new SkeletonSubscriber() { - }; - } - - @Override - public void onCompleted() { - // space for rent - } - - @Override - public void onNext(T t) { - // space for rent - } - - @Override - public void onError(Throwable e) { - throw new RuntimeException("Subscriber onError() called with unhandled exception!", e); - } -} diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/StoreApiTest.java index d5084750a3d..c9d4dfa6598 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,96 +1,72 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import io.swagger.client.model.*; +import io.swagger.client.model.Order; +import org.junit.Before; +import org.junit.Test; -import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; -import org.junit.*; -import org.threeten.bp.OffsetDateTime; - -import static org.junit.Assert.*; - +/** + * API tests for StoreApi + */ public class StoreApiTest { - private StoreApi api = null; + + private StoreApi api; @Before public void setup() { api = new ApiClient().createService(StoreApi.class); } + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ @Test - public void testGetInventory() throws Exception { - api.getInventory().subscribe(new SkeletonSubscriber>() { - @Override - public void onNext(Map inventory) { - assertTrue(inventory.keySet().size() > 0); - } - }); + public void deleteOrderTest() { + String orderId = null; + // api.deleteOrder(orderId); + // TODO: test validations } - + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + */ @Test - public void testPlaceOrder() throws Exception { - final Order order = createOrder(); - api.placeOrder(order).subscribe(SkeletonSubscriber.failTestOnError()); - api.getOrderById(order.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Order fetched) { - assertEquals(order.getId(), fetched.getId()); - assertEquals(order.getPetId(), fetched.getPetId()); - assertEquals(order.getQuantity(), fetched.getQuantity()); - assertEquals(order.getShipDate().toInstant(), fetched.getShipDate().toInstant()); - } - }); - } + public void getInventoryTest() { + // Map response = api.getInventory(); + // TODO: test validations + } + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ @Test - public void testDeleteOrder() throws Exception { - final Order order = createOrder(); - api.placeOrder(order).subscribe(SkeletonSubscriber.failTestOnError()); + public void getOrderByIdTest() { + Long orderId = null; + // Order response = api.getOrderById(orderId); - api.getOrderById(order.getId()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Order fetched) { - assertEquals(fetched.getId(), order.getId()); - } - }); - - - api.deleteOrder(String.valueOf(order.getId())).subscribe(SkeletonSubscriber.failTestOnError()); - api.getOrderById(order.getId()) - .subscribe(new SkeletonSubscriber() { - @Override - public void onNext(Order order) { - throw new RuntimeException("Should not have found deleted order."); - } - - @Override - public void onError(Throwable e) { - // should not find deleted order. - } - } - ); + // TODO: test validations } + /** + * Place an order for a pet + * + * + */ + @Test + public void placeOrderTest() { + Order order = null; + // Order response = api.placeOrder(order); - private Order createOrder() { - Order order = new Order(); - order.setPetId(200L); - order.setQuantity(13); - //Ensure 3 fractional digits because of a bug in the petstore server - order.setShipDate(OffsetDateTime.now().withNano(123000000)); - order.setStatus(Order.StatusEnum.PLACED); - order.setComplete(true); - - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, System.currentTimeMillis()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/UserApiTest.java index 02c3942b210..0456e19e04c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,107 +1,122 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import io.swagger.client.model.*; +import io.swagger.client.model.User; +import org.junit.Before; +import org.junit.Test; - -import java.util.Arrays; - -import org.junit.*; - -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** - * NOTE: This serves as a sample and test case for the generator, which is why this is java-7 code. - * Much looks much nicer with no anonymous classes. + * API tests for UserApi */ public class UserApiTest { - UserApi api = null; + + private UserApi api; @Before public void setup() { api = new ApiClient().createService(UserApi.class); } + /** + * Create user + * + * This can only be done by the logged in user. + */ @Test - public void testCreateUser() throws Exception { - final User user = createUser(); + public void createUserTest() { + User user = null; + // api.createUser(user); - api.createUser(user).subscribe(new SkeletonSubscriber() { - @Override - public void onCompleted() { - api.getUserByName(user.getUsername()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(User fetched) { - assertEquals(user.getId(), fetched.getId()); - } - }); - } - }); + // TODO: test validations } - + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithArray() throws Exception { - final User user1 = createUser(); - user1.setUsername("abc123"); - User user2 = createUser(); - user2.setUsername("123abc"); + public void createUsersWithArrayInputTest() { + List user = null; + // api.createUsersWithArrayInput(user); - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})).subscribe(SkeletonSubscriber.failTestOnError()); - - api.getUserByName(user1.getUsername()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(User fetched) { - assertEquals(user1.getId(), fetched.getId()); - } - }); + // TODO: test validations } - + /** + * Creates list of users with given input array + * + * + */ @Test - public void testCreateUsersWithList() throws Exception { - final User user1 = createUser(); - user1.setUsername("abc123"); - User user2 = createUser(); - user2.setUsername("123abc"); + public void createUsersWithListInputTest() { + List user = null; + // api.createUsersWithListInput(user); - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})).subscribe(SkeletonSubscriber.failTestOnError()); - - api.getUserByName(user1.getUsername()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(User fetched) { - assertEquals(user1.getId(), fetched.getId()); - } - }); + // TODO: test validations } - + /** + * Delete user + * + * This can only be done by the logged in user. + */ @Test - public void testLoginUser() throws Exception { - User user = createUser(); - api.createUser(user); + public void deleteUserTest() { + String username = null; + // api.deleteUser(username); - api.loginUser(user.getUsername(), user.getPassword()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(String token) { - assertTrue(token.startsWith("logged in user session:")); - } - }); + // TODO: test validations } - + /** + * Get user by user name + * + * + */ @Test - public void logoutUser() throws Exception { - api.logoutUser(); - } + public void getUserByNameTest() { + String username = null; + // User response = api.getUserByName(username); - private User createUser() { - User user = new User(); - user.setId(System.currentTimeMillis()); - user.setUsername("fred"); - user.setFirstName("Fred"); - user.setLastName("Meyer"); - user.setEmail("fred@fredmeyer.com"); - user.setPassword("xxXXxx"); - user.setPhone("408-867-5309"); - user.setUserStatus(123); - - return user; + // TODO: test validations } -} \ No newline at end of file + /** + * Logs user into the system + * + * + */ + @Test + public void loginUserTest() { + String username = null; + String password = null; + // String response = api.loginUser(username, password); + + // TODO: test validations + } + /** + * Logs out current logged in user session + * + * + */ + @Test + public void logoutUserTest() { + // api.logoutUser(); + + // TODO: test validations + } + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + String username = null; + User user = null; + // api.updateUser(username, user); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator-ignore b/samples/client/petstore/java/retrofit2rx2/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator-ignore +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/retrofit2rx2/README.md b/samples/client/petstore/java/retrofit2rx2/README.md index 6e85a88354f..b092012e38f 100644 --- a/samples/client/petstore/java/retrofit2rx2/README.md +++ b/samples/client/petstore/java/retrofit2rx2/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-retrofit2-rx2 +# petstore-retrofit2-rx2 ## Requirements @@ -24,8 +24,8 @@ After the client library is installed/deployed, you can use it in your Maven pro ```xml - io.swagger - swagger-petstore-retrofit2-rx2 + org.openapitools + petstore-retrofit2-rx2 1.0.0 compile diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 2e0e6d3aa2c..fc7fcf23f4c 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' buildscript { @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-retrofit2-rx2' + pom.artifactId = 'petstore-retrofit2-rx2' } } diff --git a/samples/client/petstore/java/retrofit2rx2/build.sbt b/samples/client/petstore/java/retrofit2rx2/build.sbt index 7cd73d96695..73856859866 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.sbt +++ b/samples/client/petstore/java/retrofit2rx2/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( - organization := "io.swagger", - name := "swagger-petstore-retrofit2-rx2", + organization := "org.openapitools", + name := "petstore-retrofit2-rx2", version := "1.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), diff --git a/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md index bcc1a3a45ce..e1a16c24a1b 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -23,9 +23,9 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md index 9526fadf552..67740bc517a 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters @@ -17,7 +18,7 @@ Method | HTTP request | Description # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -31,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -45,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -58,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -76,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -90,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -103,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -135,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -148,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -180,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -193,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -211,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -225,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -268,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +File binary = new File("/path/to/file"); // File | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -295,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -316,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8application/json; charset=utf-8, - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -335,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -374,17 +419,15 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties - - ### Example ```java // Import classes: @@ -393,9 +436,9 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body +String requestBody = new HashMap(); // String | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +449,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **requestBody** | [**String**](String.md)| request body | ### Return type @@ -427,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -464,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md index 6b6078b2afd..6c2ce76dfac 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -33,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -47,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md b/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md index c7a3acb3cb7..986f70236e1 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**File**](File.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Name.md b/samples/client/petstore/java/retrofit2rx2/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Name.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx2/docs/OuterBoolean.md b/samples/client/petstore/java/retrofit2rx2/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/OuterNumber.md b/samples/client/petstore/java/retrofit2rx2/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/OuterString.md b/samples/client/petstore/java/retrofit2rx2/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md index 0bfc5532bbf..1dde66bd791 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,9 +403,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload +File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); diff --git a/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md b/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md index 77314313236..41600763d6c 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md index 47754bafed3..5b5b7f10467 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index 6b2cc2ac838..0ffd258fae9 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - io.swagger - swagger-petstore-retrofit2-rx2 + org.openapitools + petstore-retrofit2-rx2 jar - swagger-petstore-retrofit2-rx2 + petstore-retrofit2-rx2 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java + https://github.com/openapitools/openapi-generator + OpenAPI Java - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator @@ -24,10 +24,10 @@ - Swagger - apiteam@swagger.io - Swagger - http://swagger.io + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org diff --git a/samples/client/petstore/java/retrofit2rx2/settings.gradle b/samples/client/petstore/java/retrofit2rx2/settings.gradle index 136124300af..33bd8f7d553 100644 --- a/samples/client/petstore/java/retrofit2rx2/settings.gradle +++ b/samples/client/petstore/java/retrofit2rx2/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-retrofit2-rx2" \ No newline at end of file +rootProject.name = "petstore-retrofit2-rx2" \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/JSON.java index aa07fc781cc..72d64abacfb 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/JSON.java @@ -57,7 +57,7 @@ public class JSON { classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "")); } }) ; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 4b14191983a..36a43904b75 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -21,7 +21,7 @@ public interface AnotherFakeApi { /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Observable<Client> */ @Headers({ @@ -29,7 +29,7 @@ public interface AnotherFakeApi { }) @PATCH("another-fake/dummy") Observable testSpecialTags( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java index 7c1fd4ae0d5..1faa10919e1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java @@ -12,9 +12,11 @@ import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.ArrayList; import java.util.HashMap; @@ -25,23 +27,23 @@ public interface FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Observable<Boolean> */ @POST("fake/outer/boolean") Observable fakeOuterBooleanSerialize( - @retrofit2.http.Body Boolean body + @retrofit2.http.Body Boolean booleanPostBody ); /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Observable<OuterComposite> */ @POST("fake/outer/composite") Observable fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outerComposite ); /** @@ -66,10 +68,25 @@ public interface FakeApi { @retrofit2.http.Body String body ); + /** + * + * + * @param query (required) + * @param user (required) + * @return Completable + */ + @Headers({ + "Content-Type:application/json" + }) + @PUT("fake/body-with-query-params") + Completable testBodyWithQueryParams( + @retrofit2.http.Query("query") String query, @retrofit2.http.Body User user + ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Observable<Client> */ @Headers({ @@ -77,7 +94,7 @@ public interface FakeApi { }) @PATCH("fake") Observable testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); /** @@ -102,32 +119,32 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @POST("fake") Completable testEndpointParameters( - @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback + @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") MultipartBody.Part binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback ); /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return Completable */ @retrofit2.http.FormUrlEncoded @GET("fake") Completable testEnumParameters( - @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble + @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return Completable */ @Headers({ @@ -135,7 +152,7 @@ public interface FakeApi { }) @POST("fake/inline-additionalProperties") Completable testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body String requestBody ); /** diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 835ffeb5348..b36184b44d4 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -21,7 +21,7 @@ public interface FakeClassnameTags123Api { /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Observable<Client> */ @Headers({ @@ -29,7 +29,7 @@ public interface FakeClassnameTags123Api { }) @PATCH("fake_classname_test") Observable testClassname( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java index 7ade1e0d697..13e0900ce87 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java @@ -23,7 +23,7 @@ public interface PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Completable */ @Headers({ @@ -31,7 +31,7 @@ public interface PetApi { }) @POST("pet") Completable addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -84,7 +84,7 @@ public interface PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Completable */ @Headers({ @@ -92,7 +92,7 @@ public interface PetApi { }) @PUT("pet") Completable updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); /** @@ -120,7 +120,7 @@ public interface PetApi { @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Observable uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file") MultipartBody.Part file ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java index c09f971d51f..63eeb3c859c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java @@ -52,12 +52,12 @@ public interface StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Observable<Order> */ @POST("store/order") Observable placeOrder( - @retrofit2.http.Body Order body + @retrofit2.http.Body Order order ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java index dd1ec578abf..76cd91fc36d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java @@ -21,34 +21,34 @@ public interface UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return Completable */ @POST("user") Completable createUser( - @retrofit2.http.Body User body + @retrofit2.http.Body User user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Completable */ @POST("user/createWithArray") Completable createUsersWithArrayInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Completable */ @POST("user/createWithList") Completable createUsersWithListInput( - @retrofit2.http.Body List body + @retrofit2.http.Body List user ); /** @@ -98,12 +98,12 @@ public interface UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Completable */ @PUT("user/{username}") Completable updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Path("username") String username, @retrofit2.http.Body User user ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java index a572c0d6b5b..7a1b9c32152 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java @@ -82,6 +82,58 @@ public class EnumTest { @SerializedName("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + @JsonAdapter(EnumStringRequiredEnum.Adapter.class) + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringRequiredEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -203,6 +255,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -268,6 +338,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -275,7 +346,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -285,6 +356,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java index 3223d766753..24ce7363eac 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; @@ -58,7 +59,7 @@ public class FormatTest { private byte[] _byte = null; @SerializedName("binary") - private byte[] binary = null; + private File binary = null; @SerializedName("date") private LocalDate date = null; @@ -226,7 +227,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(File binary) { this.binary = binary; return this; } @@ -236,11 +237,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public File getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(File binary) { this.binary = binary; } @@ -334,7 +335,7 @@ public class FormatTest { Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && - Arrays.equals(this.binary, formatTest.binary) && + Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -343,7 +344,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java index 1bcc6ac44bf..28c5997ded5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java @@ -81,9 +81,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java index f6a3f8f4195..a7b129c2a4d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java @@ -40,7 +40,7 @@ public class Name { private String property = null; @SerializedName("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -88,12 +88,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -109,12 +109,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -126,7 +126,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java index 9c0a4477a04..185b853dce9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -30,24 +30,24 @@ import java.io.IOException; public class SpecialModelName { @SerializedName("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -59,13 +59,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -74,7 +74,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index c32ef080d65..c7995abd833 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -29,8 +29,8 @@ public class AnotherFakeApiTest { */ @Test public void testSpecialTagsTest() { - Client body = null; - // Client response = api.testSpecialTags(body); + Client client = null; + // Client response = api.testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeApiTest.java index 2adb033dc5a..3f6252d956f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -3,9 +3,11 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import java.math.BigDecimal; import io.swagger.client.model.Client; +import java.io.File; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Before; import org.junit.Test; @@ -33,8 +35,8 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - // Boolean response = api.fakeOuterBooleanSerialize(body); + Boolean booleanPostBody = null; + // Boolean response = api.fakeOuterBooleanSerialize(booleanPostBody); // TODO: test validations } @@ -45,8 +47,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(body); + OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } @@ -74,6 +76,19 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + // api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } /** * To test \"client\" model * @@ -81,8 +96,8 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client body = null; - // Client response = api.testClientModel(body); + Client client = null; + // Client response = api.testClientModel(client); // TODO: test validations } @@ -102,12 +117,12 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + File binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; String paramCallback = null; - // Void response = 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 } @@ -118,15 +133,27 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - // Void response = api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + List enumFormStringArray = null; + String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + String requestBody = null; + // api.testInlineAdditionalProperties(requestBody); // TODO: test validations } @@ -139,7 +166,7 @@ public class FakeApiTest { public void testJsonFormDataTest() { String param = null; String param2 = null; - // Void response = api.testJsonFormData(param, param2); + // api.testJsonFormData(param, param2); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 2fd2c16ed50..d88adc9ef8d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -22,18 +22,16 @@ public class FakeClassnameTags123ApiTest { api = new ApiClient().createService(FakeClassnameTags123Api.class); } - /** * To test class name in snake case * - * + * To test class name in snake case */ @Test public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + Client client = null; + // Client response = api.testClassname(client); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/PetApiTest.java index a3688eb35c5..a4692725c0b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/PetApiTest.java @@ -24,7 +24,6 @@ public class PetApiTest { api = new ApiClient().createService(PetApi.class); } - /** * Add a new pet to the store * @@ -32,12 +31,11 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet body = null; - // Void response = api.addPet(body); + Pet pet = null; + // api.addPet(pet); // TODO: test validations } - /** * Deletes a pet * @@ -47,11 +45,10 @@ public class PetApiTest { public void deletePetTest() { Long petId = null; String apiKey = null; - // Void response = api.deletePet(petId, apiKey); + // api.deletePet(petId, apiKey); // TODO: test validations } - /** * Finds Pets by status * @@ -64,7 +61,6 @@ public class PetApiTest { // TODO: test validations } - /** * Finds Pets by tags * @@ -77,7 +73,6 @@ public class PetApiTest { // TODO: test validations } - /** * Find pet by ID * @@ -90,7 +85,6 @@ public class PetApiTest { // TODO: test validations } - /** * Update an existing pet * @@ -98,12 +92,11 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet body = null; - // Void response = api.updatePet(body); + Pet pet = null; + // api.updatePet(pet); // TODO: test validations } - /** * Updates a pet in the store with form data * @@ -114,11 +107,10 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - // Void response = api.updatePetWithForm(petId, name, status); + // api.updatePetWithForm(petId, name, status); // TODO: test validations } - /** * uploads an image * @@ -133,5 +125,4 @@ public class PetApiTest { // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/StoreApiTest.java index 1da787edf19..c9d4dfa6598 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -22,7 +22,6 @@ public class StoreApiTest { api = new ApiClient().createService(StoreApi.class); } - /** * Delete purchase order by ID * @@ -31,11 +30,10 @@ public class StoreApiTest { @Test public void deleteOrderTest() { String orderId = null; - // Void response = api.deleteOrder(orderId); + // api.deleteOrder(orderId); // TODO: test validations } - /** * Returns pet inventories by status * @@ -47,7 +45,6 @@ public class StoreApiTest { // TODO: test validations } - /** * Find purchase order by ID * @@ -60,7 +57,6 @@ public class StoreApiTest { // TODO: test validations } - /** * Place an order for a pet * @@ -68,10 +64,9 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order body = null; - // Order response = api.placeOrder(body); + Order order = null; + // Order response = api.placeOrder(order); // TODO: test validations } - } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/UserApiTest.java index cd8553d8419..0456e19e04c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/UserApiTest.java @@ -22,7 +22,6 @@ public class UserApiTest { api = new ApiClient().createService(UserApi.class); } - /** * Create user * @@ -30,12 +29,11 @@ public class UserApiTest { */ @Test public void createUserTest() { - User body = null; - // Void response = api.createUser(body); + User user = null; + // api.createUser(user); // TODO: test validations } - /** * Creates list of users with given input array * @@ -43,12 +41,11 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List body = null; - // Void response = api.createUsersWithArrayInput(body); + List user = null; + // api.createUsersWithArrayInput(user); // TODO: test validations } - /** * Creates list of users with given input array * @@ -56,12 +53,11 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List body = null; - // Void response = api.createUsersWithListInput(body); + List user = null; + // api.createUsersWithListInput(user); // TODO: test validations } - /** * Delete user * @@ -70,11 +66,10 @@ public class UserApiTest { @Test public void deleteUserTest() { String username = null; - // Void response = api.deleteUser(username); + // api.deleteUser(username); // TODO: test validations } - /** * Get user by user name * @@ -87,7 +82,6 @@ public class UserApiTest { // TODO: test validations } - /** * Logs user into the system * @@ -101,7 +95,6 @@ public class UserApiTest { // TODO: test validations } - /** * Logs out current logged in user session * @@ -109,11 +102,10 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - // Void response = api.logoutUser(); + // api.logoutUser(); // TODO: test validations } - /** * Updated user * @@ -122,10 +114,9 @@ public class UserApiTest { @Test public void updateUserTest() { String username = null; - User body = null; - // Void response = api.updateUser(username, body); + User user = null; + // api.updateUser(username, user); // TODO: test validations } - } diff --git a/samples/client/petstore/java/vertx/.openapi-generator-ignore b/samples/client/petstore/java/vertx/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator-ignore +++ b/samples/client/petstore/java/vertx/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/README.md b/samples/client/petstore/java/vertx/README.md index 485b282f4d6..d152c973720 100644 --- a/samples/client/petstore/java/vertx/README.md +++ b/samples/client/petstore/java/vertx/README.md @@ -1,24 +1,35 @@ -# swagger-petstore-vertx +# petstore-vertx + +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-vertx - 1.0.0 - compile + org.openapitools + petstore-vertx + 1.0.0 + compile ``` @@ -38,19 +49,21 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.swagger:swagger-petstore-vertx:1.0.0" +compile "org.openapitools:petstore-vertx:1.0.0" ``` ### Others At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-vertx-1.0.0.jar -* target/lib/*.jar +* `target/petstore-vertx-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -61,22 +74,22 @@ Please follow the [installation](#installation) instruction and execute the foll import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; -import io.swagger.client.api.FakeApi; +import io.swagger.client.api.AnotherFakeApi; import java.io.File; import java.util.*; -public class FakeApiExample { +public class AnotherFakeApiExample { public static void main(String[] args) { - FakeApi apiInstance = new FakeApi(); - Boolean body = true; // Boolean | Input boolean as post body + AnotherFakeApi apiInstance = new AnotherFakeApi(); + Client client = new Client(); // Client | client model try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Client result = apiInstance.testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); e.printStackTrace(); } } @@ -90,13 +103,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store @@ -130,9 +146,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -146,15 +164,16 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index cf2ca3f977c..b10a98e8f1b 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' -group = 'io.swagger' +group = 'org.openapitools' version = '1.0.0' repositories { @@ -16,7 +16,7 @@ targetCompatibility = JavaVersion.VERSION_1_8 install { repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-vertx' + pom.artifactId = 'petstore-vertx' } } @@ -26,7 +26,7 @@ task execute(type:JavaExec) { } ext { - swagger_annotations_version = "1.5.15" + swagger_annotations_version = "1.5.17" jackson_version = "2.6.4" vertx_version = "3.4.2" junit_version = "4.12" diff --git a/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md b/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..a4e6f902bf9 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(client) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client client = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(client); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/vertx/docs/EnumTest.md b/samples/client/petstore/java/vertx/docs/EnumTest.md index 08fee344882..ca048bcc515 100644 --- a/samples/client/petstore/java/vertx/docs/EnumTest.md +++ b/samples/client/petstore/java/vertx/docs/EnumTest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -19,6 +20,15 @@ LOWER | "lower" EMPTY | "" + +## Enum: EnumStringRequiredEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + ## Enum: EnumIntegerEnum Name | Value diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index 0418b476a66..493d872386c 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -8,15 +8,17 @@ Method | HTTP request | Description [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data # **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) +> Boolean fakeOuterBooleanSerialize(booleanPostBody) @@ -30,9 +32,9 @@ Test serialization of outer boolean types FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body +Boolean booleanPostBody = true; // Boolean | Input boolean as post body try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + Boolean result = apiInstance.fakeOuterBooleanSerialize(booleanPostBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -44,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + **booleanPostBody** | **Boolean**| Input boolean as post body | [optional] ### Return type @@ -57,11 +59,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -75,9 +77,9 @@ Test serialization of object with outer number type FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -89,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -102,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterNumberSerialize** @@ -134,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type @@ -147,7 +149,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: */* # **fakeOuterStringSerialize** @@ -179,7 +181,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type @@ -192,11 +194,55 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined + - **Accept**: */* + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String query = "query_example"; // String | +User user = new User(); // User | +try { + apiInstance.testBodyWithQueryParams(query, user); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: Not defined # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,9 +256,9 @@ To test \"client\" model FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -224,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -267,13 +313,13 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = _byte_example; // byte[] | None +byte[] _byte = null; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None +Long int64 = 56L; // Long | None Float _float = 3.4F; // Float | None String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None +AsyncFile binary = new AsyncFile(); // AsyncFile | None LocalDate date = new LocalDate(); // LocalDate | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None @@ -294,12 +340,12 @@ Name | Type | Description | Notes **_double** | **Double**| None | **patternWithoutDelimiter** | **String**| None | **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] + **integer** | **Integer**| None | [optional] [enum: ] + **int32** | **Integer**| None | [optional] [enum: ] **int64** | **Long**| None | [optional] **_float** | **Float**| None | [optional] **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] + **binary** | **AsyncFile**| None | [optional] **date** | **LocalDate**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional] **password** | **String**| None | [optional] @@ -315,12 +361,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -334,16 +380,16 @@ To test enum parameters FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) String enumHeaderString = "-efg"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) String enumQueryString = "-efg"; // String | Query parameter enum test (string) Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) +List enumFormStringArray = new List(); // List | Form parameter enum test (string array) +String enumFormString = "enumFormString_example"; // String | Form parameter enum test (string) try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -354,14 +400,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] **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] [enum: 1, -2] **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)] ### Return type @@ -373,8 +419,50 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* - - **Accept**: */* + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String requestBody = new HashMap(); // String | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**String**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined # **testJsonFormData** @@ -382,8 +470,6 @@ No authorization required test json serialization of form data - - ### Example ```java // Import classes: @@ -419,6 +505,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined diff --git a/samples/client/petstore/java/vertx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/vertx/docs/FakeClassnameTags123Api.md index bc728bfce5b..01f56c717d8 100644 --- a/samples/client/petstore/java/vertx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/vertx/docs/FakeClassnameTags123Api.md @@ -9,7 +9,9 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) + +To test class name in snake case To test class name in snake case @@ -31,9 +33,9 @@ api_key_query.setApiKey("YOUR API KEY"); //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model +Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -45,7 +47,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/vertx/docs/FormatTest.md b/samples/client/petstore/java/vertx/docs/FormatTest.md index c7a3acb3cb7..9a8ae6ea4ef 100644 --- a/samples/client/petstore/java/vertx/docs/FormatTest.md +++ b/samples/client/petstore/java/vertx/docs/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **_double** | **Double** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**binary** | [**AsyncFile**](AsyncFile.md) | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] diff --git a/samples/client/petstore/java/vertx/docs/Name.md b/samples/client/petstore/java/vertx/docs/Name.md index ce2fb4dee50..64060f82de4 100644 --- a/samples/client/petstore/java/vertx/docs/Name.md +++ b/samples/client/petstore/java/vertx/docs/Name.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] +**_123number** | **Integer** | | [optional] diff --git a/samples/client/petstore/java/vertx/docs/OuterBoolean.md b/samples/client/petstore/java/vertx/docs/OuterBoolean.md new file mode 100644 index 00000000000..0c792032f84 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/OuterBoolean.md @@ -0,0 +1,9 @@ + +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/vertx/docs/OuterNumber.md b/samples/client/petstore/java/vertx/docs/OuterNumber.md new file mode 100644 index 00000000000..ab7613b1810 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/OuterNumber.md @@ -0,0 +1,9 @@ + +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/vertx/docs/OuterString.md b/samples/client/petstore/java/vertx/docs/OuterString.md new file mode 100644 index 00000000000..3079fce4a0d --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/OuterString.md @@ -0,0 +1,9 @@ + +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/vertx/docs/PetApi.md b/samples/client/petstore/java/vertx/docs/PetApi.md index 022fd697a8d..88dc8997937 100644 --- a/samples/client/petstore/java/vertx/docs/PetApi.md +++ b/samples/client/petstore/java/vertx/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```java // Import classes: @@ -38,9 +36,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -51,7 +49,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -64,7 +62,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -72,8 +70,6 @@ null (empty response body) Deletes a pet - - ### Example ```java // Import classes: @@ -90,7 +86,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete +Long petId = 56L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); @@ -118,7 +114,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -252,7 +248,7 @@ api_key.setApiKey("YOUR API KEY"); //api_key.setApiKeyPrefix("Token"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return +Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -283,12 +279,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```java // Import classes: @@ -305,9 +299,9 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -318,7 +312,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -331,7 +325,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -339,8 +333,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```java // Import classes: @@ -357,7 +349,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated +Long petId = 56L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { @@ -387,7 +379,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -395,8 +387,6 @@ null (empty response body) uploads an image - - ### Example ```java // Import classes: @@ -413,7 +403,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update +Long petId = 56L; // Long | ID of pet to update String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server AsyncFile file = new AsyncFile(); // AsyncFile | file to upload try { diff --git a/samples/client/petstore/java/vertx/docs/SpecialModelName.md b/samples/client/petstore/java/vertx/docs/SpecialModelName.md index c2c6117c552..6cf53410ace 100644 --- a/samples/client/petstore/java/vertx/docs/SpecialModelName.md +++ b/samples/client/petstore/java/vertx/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] diff --git a/samples/client/petstore/java/vertx/docs/StoreApi.md b/samples/client/petstore/java/vertx/docs/StoreApi.md index 7aed6450e6a..339e3181b09 100644 --- a/samples/client/petstore/java/vertx/docs/StoreApi.md +++ b/samples/client/petstore/java/vertx/docs/StoreApi.md @@ -52,7 +52,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -121,7 +121,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched +Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +135,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | **Long**| ID of pet that needs to be fetched | [enum: ] ### Return type @@ -152,12 +152,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,9 +164,9 @@ Place an order for a pet StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -180,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/java/vertx/docs/UserApi.md b/samples/client/petstore/java/vertx/docs/UserApi.md index 2e6987951c8..f982ddbf57b 100644 --- a/samples/client/petstore/java/vertx/docs/UserApi.md +++ b/samples/client/petstore/java/vertx/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -30,9 +30,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -43,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,16 +56,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,9 +72,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -87,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -100,16 +98,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```java // Import classes: @@ -118,9 +114,9 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -131,7 +127,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -144,7 +140,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -188,7 +184,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -196,8 +192,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -206,7 +200,7 @@ Get user by user name UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -220,7 +214,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -241,8 +235,6 @@ No authorization required Logs user into the system - - ### Example ```java // Import classes: @@ -288,8 +280,6 @@ No authorization required Logs out current logged in user session - - ### Example ```java // Import classes: @@ -320,11 +310,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -339,9 +329,9 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -353,7 +343,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,5 +356,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/java/vertx/git_push.sh b/samples/client/petstore/java/vertx/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/java/vertx/git_push.sh +++ b/samples/client/petstore/java/vertx/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index dec8d7a8a2f..a7e7b8bb4ce 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -1,248 +1,267 @@ - 4.0.0 - io.swagger - swagger-petstore-vertx - jar - swagger-petstore-vertx - 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + org.openapitools + petstore-vertx + jar + petstore-vertx + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + OpenAPI + team@openapitools.org + OpenAPI + http://openapitools.org + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.0.0 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - - - - sign-artifacts - + - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + - - - + - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.vertx - vertx-rx-java - ${vertx-version} - - - io.vertx - vertx-web-client - ${vertx-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - + + + io.vertx + vertx-rx-java + ${vertx-version} + + + io.vertx + vertx-web-client + ${vertx-version} + - - - junit - junit - ${junit-version} - test - - - io.vertx - vertx-unit - ${vertx-version} - test - - + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + - - UTF-8 - 3.4.2 - 1.5.18 - 2.6.4 - 4.12 - + + + junit + junit + ${junit-version} + test + + + io.vertx + vertx-unit + ${vertx-version} + test + + + + + UTF-8 + 3.4.2 + 1.5.18 + 2.6.4 + 4.12 + diff --git a/samples/client/petstore/java/vertx/settings.gradle b/samples/client/petstore/java/vertx/settings.gradle index 79fdf018f45..911412bf062 100644 --- a/samples/client/petstore/java/vertx/settings.gradle +++ b/samples/client/petstore/java/vertx/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-petstore-vertx" \ No newline at end of file +rootProject.name = "petstore-vertx" \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..c8eef15ade2 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,14 @@ +package io.swagger.client.api; + +import io.swagger.client.model.Client; +import io.vertx.core.AsyncResult; +import io.vertx.core.Handler; +import io.vertx.core.json.JsonObject; + +import java.util.*; + +public interface AnotherFakeApi { + + void testSpecialTags(Client client, Handler> handler); + +} diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApiImpl.java new file mode 100644 index 00000000000..fb96d1647ac --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApiImpl.java @@ -0,0 +1,74 @@ +package io.swagger.client.api; + +import io.swagger.client.model.Client; + +import io.vertx.core.AsyncResult; +import io.vertx.core.Handler; +import io.vertx.core.MultiMap; +import io.vertx.core.json.JsonObject; + +import com.fasterxml.jackson.core.type.TypeReference; + +import java.util.*; + +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; + + +public class AnotherFakeApiImpl implements AnotherFakeApi { + + private ApiClient apiClient; + + public AnotherFakeApiImpl() { + this(null); + } + + public AnotherFakeApiImpl(ApiClient apiClient) { + this.apiClient = apiClient != null ? apiClient : Configuration.getDefaultApiClient(); + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + * @param client client model (required) + * @param resultHandler Asynchronous result handler + */ + public void testSpecialTags(Client client, Handler> resultHandler) { + Object localVarBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'client' when calling testSpecialTags")); + return; + } + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + // query params + List localVarQueryParams = new ArrayList<>(); + + // header params + MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); + + // form params + // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) + Map localVarFormParams = new HashMap<>(); + + String[] localVarAccepts = { "application/json" }; + String[] localVarContentTypes = { "application/json" }; + String[] localVarAuthNames = new String[] { }; + TypeReference localVarReturnType = new TypeReference() {}; + apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + } +} diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApi.java index 6f38f02eaf5..1e7485a9b7c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApi.java @@ -1,10 +1,12 @@ package io.swagger.client.api; +import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; @@ -13,19 +15,23 @@ import java.util.*; public interface FakeApi { - void fakeOuterBooleanSerialize(Boolean body, Handler> handler); + void fakeOuterBooleanSerialize(Boolean booleanPostBody, Handler> handler); - void fakeOuterCompositeSerialize(OuterComposite body, Handler> handler); + void fakeOuterCompositeSerialize(OuterComposite outerComposite, Handler> handler); void fakeOuterNumberSerialize(BigDecimal body, Handler> handler); void fakeOuterStringSerialize(String body, Handler> handler); - void testClientModel(Client body, Handler> handler); + void testBodyWithQueryParams(String query, User user, Handler> handler); - void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> handler); + void testClientModel(Client client, Handler> handler); - void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, Handler> handler); + void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> handler); + + void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> handler); + + void testInlineAdditionalProperties(String requestBody, Handler> handler); void testJsonFormData(String param, String param2, Handler> handler); diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApiImpl.java index 2fa1e3adf45..2d20d889ac0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeApiImpl.java @@ -1,10 +1,12 @@ package io.swagger.client.api; +import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -44,11 +46,11 @@ public class FakeApiImpl implements FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @param resultHandler Asynchronous result handler */ - public void fakeOuterBooleanSerialize(Boolean body, Handler> resultHandler) { - Object localVarBody = body; + public void fakeOuterBooleanSerialize(Boolean booleanPostBody, Handler> resultHandler) { + Object localVarBody = booleanPostBody; // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -63,7 +65,7 @@ public class FakeApiImpl implements FakeApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { }; + String[] localVarAccepts = { "*/*" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; @@ -72,11 +74,11 @@ public class FakeApiImpl implements FakeApi { /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @param resultHandler Asynchronous result handler */ - public void fakeOuterCompositeSerialize(OuterComposite body, Handler> resultHandler) { - Object localVarBody = body; + public void fakeOuterCompositeSerialize(OuterComposite outerComposite, Handler> resultHandler) { + Object localVarBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -91,7 +93,7 @@ public class FakeApiImpl implements FakeApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { }; + String[] localVarAccepts = { "*/*" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; @@ -119,7 +121,7 @@ public class FakeApiImpl implements FakeApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { }; + String[] localVarAccepts = { "*/*" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; @@ -147,24 +149,66 @@ public class FakeApiImpl implements FakeApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { }; + String[] localVarAccepts = { "*/*" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) + * + * + * @param query (required) + * @param user (required) * @param resultHandler Asynchronous result handler */ - public void testClientModel(Client body, Handler> resultHandler) { - Object localVarBody = body; + public void testBodyWithQueryParams(String query, User user, Handler> resultHandler) { + Object localVarBody = user; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling testClientModel")); + // verify the required parameter 'query' is set + if (query == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams")); + return; + } + + // verify the required parameter 'user' is set + if (user == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams")); + return; + } + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + // query params + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + // header params + MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); + + // form params + // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) + Map localVarFormParams = new HashMap<>(); + + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "application/json" }; + String[] localVarAuthNames = new String[] { }; + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + } + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @param resultHandler Asynchronous result handler + */ + public void testClientModel(Client client, Handler> resultHandler) { + Object localVarBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'client' when calling testClientModel")); return; } @@ -206,7 +250,7 @@ public class FakeApiImpl implements FakeApi { * @param paramCallback None (optional) * @param resultHandler Asynchronous result handler */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'number' is set @@ -260,8 +304,8 @@ if (dateTime != null) localVarFormParams.put("dateTime", dateTime); if (password != null) localVarFormParams.put("password", password); if (paramCallback != null) localVarFormParams.put("callback", paramCallback); - String[] localVarAccepts = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }; - String[] localVarContentTypes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }; + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; String[] localVarAuthNames = new String[] { "http_basic_test" }; apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); @@ -269,17 +313,17 @@ if (paramCallback != null) localVarFormParams.put("callback", paramCallback); /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @param resultHandler Asynchronous result handler */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, Handler> resultHandler) { + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> resultHandler) { Object localVarBody = null; // create path and map variables @@ -290,6 +334,7 @@ if (paramCallback != null) localVarFormParams.put("callback", paramCallback); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); // header params MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); @@ -303,14 +348,47 @@ if (enumHeaderString != null) Map localVarFormParams = new HashMap<>(); if (enumFormStringArray != null) localVarFormParams.put("enum_form_string_array", enumFormStringArray); if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); -if (enumQueryDouble != null) localVarFormParams.put("enum_query_double", enumQueryDouble); - String[] localVarAccepts = { "*/*" }; - String[] localVarContentTypes = { "*/*" }; + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; String[] localVarAuthNames = new String[] { }; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @param resultHandler Asynchronous result handler + */ + public void testInlineAdditionalProperties(String requestBody, Handler> resultHandler) { + Object localVarBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties")); + return; + } + + // create path and map variables + String localVarPath = "/fake/inline-additionalProperties"; + + // query params + List localVarQueryParams = new ArrayList<>(); + + // header params + MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); + + // form params + // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) + Map localVarFormParams = new HashMap<>(); + + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "application/json" }; + String[] localVarAuthNames = new String[] { }; + + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + } /** * test json serialization of form data * @@ -349,7 +427,7 @@ if (enumQueryDouble != null) localVarFormParams.put("enum_query_double", enumQue if (param2 != null) localVarFormParams.put("param2", param2); String[] localVarAccepts = { }; - String[] localVarContentTypes = { "application/json" }; + String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; String[] localVarAuthNames = new String[] { }; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 5392347e320..f7cc75d9bbd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -9,6 +9,6 @@ import java.util.*; public interface FakeClassnameTags123Api { - void testClassname(Client body, Handler> handler); + void testClassname(Client client, Handler> handler); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123ApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123ApiImpl.java index 2bd0ed4b690..0cb39bb3eae 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123ApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/FakeClassnameTags123ApiImpl.java @@ -39,16 +39,16 @@ public class FakeClassnameTags123ApiImpl implements FakeClassnameTags123Api { /** * To test class name in snake case - * - * @param body client model (required) + * To test class name in snake case + * @param client client model (required) * @param resultHandler Asynchronous result handler */ - public void testClassname(Client body, Handler> resultHandler) { - Object localVarBody = body; + public void testClassname(Client client, Handler> resultHandler) { + Object localVarBody = client; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling testClassname")); + // verify the required parameter 'client' is set + if (client == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'client' when calling testClassname")); return; } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApi.java index 79d5552087a..51bfd7dad35 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApi.java @@ -11,7 +11,7 @@ import java.util.*; public interface PetApi { - void addPet(Pet body, Handler> handler); + void addPet(Pet pet, Handler> handler); void deletePet(Long petId, String apiKey, Handler> handler); @@ -21,7 +21,7 @@ public interface PetApi { void getPetById(Long petId, Handler> handler); - void updatePet(Pet body, Handler> handler); + void updatePet(Pet pet, Handler> handler); void updatePetWithForm(Long petId, String name, String status, Handler> handler); diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApiImpl.java index 477a3d31c99..7ab13fb9eb5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApiImpl.java @@ -42,15 +42,15 @@ public class PetApiImpl implements PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param resultHandler Asynchronous result handler */ - public void addPet(Pet body, Handler> resultHandler) { - Object localVarBody = body; + public void addPet(Pet pet, Handler> resultHandler) { + Object localVarBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling addPet")); + // verify the required parameter 'pet' is set + if (pet == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'pet' when calling addPet")); return; } @@ -67,7 +67,7 @@ public class PetApiImpl implements PetApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { "application/json", "application/xml" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; @@ -104,7 +104,7 @@ public class PetApiImpl implements PetApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; @@ -217,15 +217,15 @@ public class PetApiImpl implements PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param resultHandler Asynchronous result handler */ - public void updatePet(Pet body, Handler> resultHandler) { - Object localVarBody = body; + public void updatePet(Pet pet, Handler> resultHandler) { + Object localVarBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling updatePet")); + // verify the required parameter 'pet' is set + if (pet == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'pet' when calling updatePet")); return; } @@ -242,7 +242,7 @@ public class PetApiImpl implements PetApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { "application/json", "application/xml" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; @@ -280,7 +280,7 @@ public class PetApiImpl implements PetApi { if (name != null) localVarFormParams.put("name", name); if (status != null) localVarFormParams.put("status", status); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApi.java index 0090903a0d4..8c9a18347e4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApi.java @@ -15,6 +15,6 @@ public interface StoreApi { void getOrderById(Long orderId, Handler> handler); - void placeOrder(Order body, Handler> handler); + void placeOrder(Order order, Handler> handler); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApiImpl.java index 649bc6150b2..6176167d1d7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/StoreApiImpl.java @@ -65,7 +65,7 @@ public class StoreApiImpl implements StoreApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; @@ -135,15 +135,15 @@ public class StoreApiImpl implements StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param resultHandler Asynchronous result handler */ - public void placeOrder(Order body, Handler> resultHandler) { - Object localVarBody = body; + public void placeOrder(Order order, Handler> resultHandler) { + Object localVarBody = order; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling placeOrder")); + // verify the required parameter 'order' is set + if (order == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'order' when calling placeOrder")); return; } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApi.java index 9b14dd77464..44465ad0665 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApi.java @@ -9,11 +9,11 @@ import java.util.*; public interface UserApi { - void createUser(User body, Handler> handler); + void createUser(User user, Handler> handler); - void createUsersWithArrayInput(List body, Handler> handler); + void createUsersWithArrayInput(List user, Handler> handler); - void createUsersWithListInput(List body, Handler> handler); + void createUsersWithListInput(List user, Handler> handler); void deleteUser(String username, Handler> handler); @@ -23,6 +23,6 @@ public interface UserApi { void logoutUser(Handler> handler); - void updateUser(String username, User body, Handler> handler); + void updateUser(String username, User user, Handler> handler); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApiImpl.java index 0be6abfe1b0..c6ce8ccbd05 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/UserApiImpl.java @@ -40,15 +40,15 @@ public class UserApiImpl implements UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @param resultHandler Asynchronous result handler */ - public void createUser(User body, Handler> resultHandler) { - Object localVarBody = body; + public void createUser(User user, Handler> resultHandler) { + Object localVarBody = user; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling createUser")); + // verify the required parameter 'user' is set + if (user == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'user' when calling createUser")); return; } @@ -65,7 +65,7 @@ public class UserApiImpl implements UserApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; @@ -74,15 +74,15 @@ public class UserApiImpl implements UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @param resultHandler Asynchronous result handler */ - public void createUsersWithArrayInput(List body, Handler> resultHandler) { - Object localVarBody = body; + public void createUsersWithArrayInput(List user, Handler> resultHandler) { + Object localVarBody = user; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + // verify the required parameter 'user' is set + if (user == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); return; } @@ -99,7 +99,7 @@ public class UserApiImpl implements UserApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; @@ -108,15 +108,15 @@ public class UserApiImpl implements UserApi { /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @param resultHandler Asynchronous result handler */ - public void createUsersWithListInput(List body, Handler> resultHandler) { - Object localVarBody = body; + public void createUsersWithListInput(List user, Handler> resultHandler) { + Object localVarBody = user; - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + // verify the required parameter 'user' is set + if (user == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); return; } @@ -133,7 +133,7 @@ public class UserApiImpl implements UserApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; @@ -167,7 +167,7 @@ public class UserApiImpl implements UserApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; @@ -176,7 +176,7 @@ public class UserApiImpl implements UserApi { /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @param resultHandler Asynchronous result handler */ public void getUserByName(String username, Handler> resultHandler) { @@ -271,7 +271,7 @@ public class UserApiImpl implements UserApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; @@ -281,11 +281,11 @@ public class UserApiImpl implements UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @param resultHandler Asynchronous result handler */ - public void updateUser(String username, User body, Handler> resultHandler) { - Object localVarBody = body; + public void updateUser(String username, User user, Handler> resultHandler) { + Object localVarBody = user; // verify the required parameter 'username' is set if (username == null) { @@ -293,9 +293,9 @@ public class UserApiImpl implements UserApi { return; } - // verify the required parameter 'body' is set - if (body == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling updateUser")); + // verify the required parameter 'user' is set + if (user == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'user' when calling updateUser")); return; } @@ -312,7 +312,7 @@ public class UserApiImpl implements UserApi { // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) Map localVarFormParams = new HashMap<>(); - String[] localVarAccepts = { "application/xml", "application/json" }; + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/AnotherFakeApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/AnotherFakeApi.java new file mode 100644 index 00000000000..d29cfbaa53e --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/AnotherFakeApi.java @@ -0,0 +1,49 @@ +package io.swagger.client.api.rxjava; + +import io.swagger.client.model.Client; + +import java.util.*; + +import rx.Single; +import io.vertx.core.AsyncResult; +import io.vertx.core.Handler; + + +public class AnotherFakeApi { + + private final io.swagger.client.api.AnotherFakeApi delegate; + + public AnotherFakeApi(io.swagger.client.api.AnotherFakeApi delegate) { + this.delegate = delegate; + } + + public io.swagger.client.api.AnotherFakeApi getDelegate() { + return delegate; + } + + /** + * To test special tags + * To test special tags + * @param client client model (required) + * @param resultHandler Asynchronous result handler + */ + public void testSpecialTags(Client client, Handler> resultHandler) { + delegate.testSpecialTags(client, resultHandler); + } + + /** + * To test special tags + * To test special tags + * @param client client model (required) + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestSpecialTags(Client client) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { + delegate.testSpecialTags(client, fut); + })); + } + + public static AnotherFakeApi newInstance(io.swagger.client.api.AnotherFakeApi arg) { + return arg != null ? new AnotherFakeApi(arg) : null; + } +} diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeApi.java index ed8537ecaf1..fee577e5360 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeApi.java @@ -1,10 +1,12 @@ package io.swagger.client.api.rxjava; +import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import java.util.*; @@ -28,43 +30,43 @@ public class FakeApi { /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @param resultHandler Asynchronous result handler */ - public void fakeOuterBooleanSerialize(Boolean body, Handler> resultHandler) { - delegate.fakeOuterBooleanSerialize(body, resultHandler); + public void fakeOuterBooleanSerialize(Boolean booleanPostBody, Handler> resultHandler) { + delegate.fakeOuterBooleanSerialize(booleanPostBody, resultHandler); } /** * * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * @param booleanPostBody Input boolean as post body (optional) * @return Asynchronous result handler (RxJava Single) */ - public Single rxFakeOuterBooleanSerialize(Boolean body) { + public Single rxFakeOuterBooleanSerialize(Boolean booleanPostBody) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.fakeOuterBooleanSerialize(body, fut); + delegate.fakeOuterBooleanSerialize(booleanPostBody, fut); })); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @param resultHandler Asynchronous result handler */ - public void fakeOuterCompositeSerialize(OuterComposite body, Handler> resultHandler) { - delegate.fakeOuterCompositeSerialize(body, resultHandler); + public void fakeOuterCompositeSerialize(OuterComposite outerComposite, Handler> resultHandler) { + delegate.fakeOuterCompositeSerialize(outerComposite, resultHandler); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Asynchronous result handler (RxJava Single) */ - public Single rxFakeOuterCompositeSerialize(OuterComposite body) { + public Single rxFakeOuterCompositeSerialize(OuterComposite outerComposite) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.fakeOuterCompositeSerialize(body, fut); + delegate.fakeOuterCompositeSerialize(outerComposite, fut); })); } /** @@ -110,24 +112,47 @@ public class FakeApi { })); } /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) + * + * + * @param query (required) + * @param user (required) * @param resultHandler Asynchronous result handler */ - public void testClientModel(Client body, Handler> resultHandler) { - delegate.testClientModel(body, resultHandler); + public void testBodyWithQueryParams(String query, User user, Handler> resultHandler) { + delegate.testBodyWithQueryParams(query, user, resultHandler); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestBodyWithQueryParams(String query, User user) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { + delegate.testBodyWithQueryParams(query, user, fut); + })); + } + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @param resultHandler Asynchronous result handler + */ + public void testClientModel(Client client, Handler> resultHandler) { + delegate.testClientModel(client, resultHandler); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestClientModel(Client body) { + public Single rxTestClientModel(Client client) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testClientModel(body, fut); + delegate.testClientModel(client, fut); })); } /** @@ -149,7 +174,7 @@ public class FakeApi { * @param paramCallback None (optional) * @param resultHandler Asynchronous result handler */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, resultHandler); } @@ -172,7 +197,7 @@ public class FakeApi { * @param paramCallback None (optional) * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestEndpointParameters(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) { + public Single rxTestEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, fut); })); @@ -180,36 +205,57 @@ public class FakeApi { /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @param resultHandler Asynchronous result handler */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, Handler> resultHandler) { - delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, resultHandler); + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> resultHandler) { + delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, resultHandler); } /** * To test enum parameters * To test enum parameters - * @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 enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional) * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) { + public Single rxTestEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, fut); + delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, fut); + })); + } + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @param resultHandler Asynchronous result handler + */ + public void testInlineAdditionalProperties(String requestBody, Handler> resultHandler) { + delegate.testInlineAdditionalProperties(requestBody, resultHandler); + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestInlineAdditionalProperties(String requestBody) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { + delegate.testInlineAdditionalProperties(requestBody, fut); })); } /** diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeClassnameTags123Api.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeClassnameTags123Api.java index 07d434fcd25..701ffc83c7f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/FakeClassnameTags123Api.java @@ -23,23 +23,23 @@ public class FakeClassnameTags123Api { /** * To test class name in snake case - * - * @param body client model (required) + * To test class name in snake case + * @param client client model (required) * @param resultHandler Asynchronous result handler */ - public void testClassname(Client body, Handler> resultHandler) { - delegate.testClassname(body, resultHandler); + public void testClassname(Client client, Handler> resultHandler) { + delegate.testClassname(client, resultHandler); } /** * To test class name in snake case - * - * @param body client model (required) + * To test class name in snake case + * @param client client model (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestClassname(Client body) { + public Single rxTestClassname(Client client) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testClassname(body, fut); + delegate.testClassname(client, fut); })); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/PetApi.java index 16cb5e30bae..f718fb26bf4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/PetApi.java @@ -26,22 +26,22 @@ public class PetApi { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param resultHandler Asynchronous result handler */ - public void addPet(Pet body, Handler> resultHandler) { - delegate.addPet(body, resultHandler); + public void addPet(Pet pet, Handler> resultHandler) { + delegate.addPet(pet, resultHandler); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxAddPet(Pet body) { + public Single rxAddPet(Pet pet) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.addPet(body, fut); + delegate.addPet(pet, fut); })); } /** @@ -133,22 +133,22 @@ public class PetApi { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param resultHandler Asynchronous result handler */ - public void updatePet(Pet body, Handler> resultHandler) { - delegate.updatePet(body, resultHandler); + public void updatePet(Pet pet, Handler> resultHandler) { + delegate.updatePet(pet, resultHandler); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxUpdatePet(Pet body) { + public Single rxUpdatePet(Pet pet) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.updatePet(body, fut); + delegate.updatePet(pet, fut); })); } /** diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/StoreApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/StoreApi.java index 4e05647723b..74ef463ba73 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/StoreApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/StoreApi.java @@ -85,22 +85,22 @@ public class StoreApi { /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param resultHandler Asynchronous result handler */ - public void placeOrder(Order body, Handler> resultHandler) { - delegate.placeOrder(body, resultHandler); + public void placeOrder(Order order, Handler> resultHandler) { + delegate.placeOrder(order, resultHandler); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxPlaceOrder(Order body) { + public Single rxPlaceOrder(Order order) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.placeOrder(body, fut); + delegate.placeOrder(order, fut); })); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/UserApi.java index f0b4238f40a..ed38412cce2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/UserApi.java @@ -24,64 +24,64 @@ public class UserApi { /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @param resultHandler Asynchronous result handler */ - public void createUser(User body, Handler> resultHandler) { - delegate.createUser(body, resultHandler); + public void createUser(User user, Handler> resultHandler) { + delegate.createUser(user, resultHandler); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxCreateUser(User body) { + public Single rxCreateUser(User user) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.createUser(body, fut); + delegate.createUser(user, fut); })); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @param resultHandler Asynchronous result handler */ - public void createUsersWithArrayInput(List body, Handler> resultHandler) { - delegate.createUsersWithArrayInput(body, resultHandler); + public void createUsersWithArrayInput(List user, Handler> resultHandler) { + delegate.createUsersWithArrayInput(user, resultHandler); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxCreateUsersWithArrayInput(List body) { + public Single rxCreateUsersWithArrayInput(List user) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.createUsersWithArrayInput(body, fut); + delegate.createUsersWithArrayInput(user, fut); })); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @param resultHandler Asynchronous result handler */ - public void createUsersWithListInput(List body, Handler> resultHandler) { - delegate.createUsersWithListInput(body, resultHandler); + public void createUsersWithListInput(List user, Handler> resultHandler) { + delegate.createUsersWithListInput(user, resultHandler); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxCreateUsersWithListInput(List body) { + public Single rxCreateUsersWithListInput(List user) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.createUsersWithListInput(body, fut); + delegate.createUsersWithListInput(user, fut); })); } /** @@ -108,7 +108,7 @@ public class UserApi { /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @param resultHandler Asynchronous result handler */ public void getUserByName(String username, Handler> resultHandler) { @@ -118,7 +118,7 @@ public class UserApi { /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Asynchronous result handler (RxJava Single) */ public Single rxGetUserByName(String username) { @@ -172,23 +172,23 @@ public class UserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @param resultHandler Asynchronous result handler */ - public void updateUser(String username, User body, Handler> resultHandler) { - delegate.updateUser(username, body, resultHandler); + public void updateUser(String username, User user, Handler> resultHandler) { + delegate.updateUser(username, user, resultHandler); } /** * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxUpdateUser(String username, User body) { + public Single rxUpdateUser(String username, User user) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.updateUser(username, body, fut); + delegate.updateUser(username, user, fut); })); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..9a512f19a76 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -41,7 +42,7 @@ public class AdditionalPropertiesClass { public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { if (this.mapProperty == null) { - this.mapProperty = new HashMap(); + this.mapProperty = new HashMap<>(); } this.mapProperty.put(key, mapPropertyItem); return this; @@ -67,7 +68,7 @@ public class AdditionalPropertiesClass { public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..65e06a82bfa 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..a1f03fa677e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -38,7 +39,7 @@ public class ArrayOfArrayOfNumberOnly { public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..ef99bc812ba 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -38,7 +39,7 @@ public class ArrayOfNumberOnly { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..7402f995d0d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -44,7 +45,7 @@ public class ArrayTest { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -70,7 +71,7 @@ public class ArrayTest { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -96,7 +97,7 @@ public class ArrayTest { public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..5be236f7232 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..6c16366280a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..0af140c0fb9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..41bd1a100d0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..6597c52b7b3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -128,7 +129,7 @@ public class EnumArrays { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..09fd0a2ebdc 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..2bb7dd17d43 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -66,6 +67,46 @@ public class EnumTest { @JsonProperty("enum_string") private EnumStringEnum enumString = null; + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired = null; + /** * Gets or Sets enumInteger */ @@ -163,6 +204,24 @@ public class EnumTest { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; @@ -228,6 +287,7 @@ public class EnumTest { } EnumTest enumTest = (EnumTest) o; return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && Objects.equals(this.outerEnum, enumTest.outerEnum); @@ -235,7 +295,7 @@ public class EnumTest { @Override public int hashCode() { - return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @@ -245,6 +305,7 @@ public class EnumTest { sb.append("class EnumTest {\n"); sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).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"); diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/FormatTest.java index 4118656d29e..22c76ce2cb0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,11 +14,13 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; 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.vertx.core.file.AsyncFile; import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; @@ -54,7 +56,7 @@ public class FormatTest { private byte[] _byte = null; @JsonProperty("binary") - private byte[] binary = null; + private AsyncFile binary = null; @JsonProperty("date") private LocalDate date = null; @@ -222,7 +224,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(AsyncFile binary) { this.binary = binary; return this; } @@ -232,11 +234,11 @@ public class FormatTest { * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public AsyncFile getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(AsyncFile binary) { this.binary = binary; } @@ -329,7 +331,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -339,7 +341,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..6137eb3d2ed 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..65abf528469 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -76,7 +77,7 @@ public class MapTest { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -102,7 +103,7 @@ public class MapTest { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..2cd70e77ca6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -83,7 +84,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Model200Response.java index 58624475e43..46fb5650ff0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -77,9 +78,9 @@ public class Model200Response { 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); + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..7530e42d991 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..432b1acf7c4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Name.java index f2b9b1703bd..e12c1072478 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -36,7 +37,7 @@ public class Name { private String property = null; @JsonProperty("123Number") - private Integer _123Number = null; + private Integer _123number = null; public Name name(Integer name) { this.name = name; @@ -84,12 +85,12 @@ public class Name { } /** - * Get _123Number - * @return _123Number + * Get _123number + * @return _123number **/ @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; + public Integer get123number() { + return _123number; } @@ -105,12 +106,12 @@ public class Name { 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); + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123Number); + return Objects.hash(name, snakeCase, property, _123number); } @@ -122,7 +123,7 @@ public class Name { 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(" _123number: ").append(toIndentedString(_123number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..d49eac55c7b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..dec431cf77e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterBoolean.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterBoolean.java new file mode 100644 index 00000000000..78bfcb1442a --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterBoolean.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterNumber.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterNumber.java new file mode 100644 index 00000000000..d775aa68499 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterNumber.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterNumber + */ + +public class OuterNumber { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterString.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterString.java new file mode 100644 index 00000000000..fa2539d33de --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterString.java @@ -0,0 +1,63 @@ +/* + * 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.model; + +import java.util.Objects; +import java.util.Arrays; + +/** + * OuterString + */ + +public class OuterString { + + @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(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..da8a23e3d75 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -39,7 +40,7 @@ public class Pet { private String name = null; @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") private List tags = null; @@ -168,7 +169,7 @@ public class Pet { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..29ff60bcedf 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/SpecialModelName.java index 784eb8baca8..3676b70365a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,24 +27,24 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + private Long $specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } /** - * Get specialPropertyName - * @return specialPropertyName + * Get $specialPropertyName + * @return $specialPropertyName **/ @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } @@ -55,13 +56,13 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @@ -70,7 +71,7 @@ public class SpecialModelName { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..83e16041f49 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..fc1d6c27da3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..0d75f30d0b6 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,76 @@ +/* + * 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.api; + +import io.swagger.client.model.Client; + +import io.swagger.client.Configuration; + +import org.junit.Test; +import org.junit.Ignore; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.runner.RunWith; + +import io.vertx.core.AsyncResult; +import io.vertx.core.Handler; +import io.vertx.core.json.JsonObject; +import io.vertx.core.Vertx; +import io.vertx.ext.unit.junit.VertxUnitRunner; +import io.vertx.ext.unit.junit.RunTestOnContext; +import io.vertx.ext.unit.TestContext; +import io.vertx.ext.unit.Async; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@RunWith(VertxUnitRunner.class) +@Ignore +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Rule + public RunTestOnContext rule = new RunTestOnContext(); + + @BeforeClass + public void setupApiClient() { + JsonObject config = new JsonObject(); + Vertx vertx = rule.vertx(); + Configuration.setupDefaultApiClient(vertx, config); + + api = new AnotherFakeApiImpl(); + } + + /** + * To test special tags + * To test special tags + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testSpecialTagsTest(TestContext context) { + Async async = context.async(); + Client client = null; + api.testSpecialTags(client, result -> { + // TODO: test validations + async.complete(); + }); + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeApiTest.java index ac9a1de6628..81f9ccbbbb9 100644 --- a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -12,11 +12,13 @@ package io.swagger.client.api; +import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import io.swagger.client.Configuration; @@ -70,8 +72,8 @@ public class FakeApiTest { @Test public void fakeOuterBooleanSerializeTest(TestContext context) { Async async = context.async(); - Boolean body = null; - api.fakeOuterBooleanSerialize(body, result -> { + Boolean booleanPostBody = null; + api.fakeOuterBooleanSerialize(booleanPostBody, result -> { // TODO: test validations async.complete(); }); @@ -86,8 +88,8 @@ public class FakeApiTest { @Test public void fakeOuterCompositeSerializeTest(TestContext context) { Async async = context.async(); - OuterComposite body = null; - api.fakeOuterCompositeSerialize(body, result -> { + OuterComposite outerComposite = null; + api.fakeOuterCompositeSerialize(outerComposite, result -> { // TODO: test validations async.complete(); }); @@ -125,6 +127,23 @@ public class FakeApiTest { }); } + /** + * + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testBodyWithQueryParamsTest(TestContext context) { + Async async = context.async(); + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user, result -> { + // TODO: test validations + async.complete(); + }); + } + /** * To test \"client\" model * To test \"client\" model @@ -134,8 +153,8 @@ public class FakeApiTest { @Test public void testClientModelTest(TestContext context) { Async async = context.async(); - Client body = null; - api.testClientModel(body, result -> { + Client client = null; + api.testClientModel(client, result -> { // TODO: test validations async.complete(); }); @@ -159,7 +178,7 @@ public class FakeApiTest { Long int64 = null; Float _float = null; String string = null; - byte[] binary = null; + AsyncFile binary = null; LocalDate date = null; OffsetDateTime dateTime = null; String password = null; @@ -179,15 +198,31 @@ public class FakeApiTest { @Test public void testEnumParametersTest(TestContext context) { Async async = context.async(); - List enumFormStringArray = null; - String enumFormString = null; List enumHeaderStringArray = null; String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; Integer enumQueryInteger = null; Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, result -> { + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, result -> { + // TODO: test validations + async.complete(); + }); + } + + /** + * test inline additionalProperties + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testInlineAdditionalPropertiesTest(TestContext context) { + Async async = context.async(); + String requestBody = null; + api.testInlineAdditionalProperties(requestBody, result -> { // TODO: test validations async.complete(); }); diff --git a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index 068b2407ee5..1f51f807170 100644 --- a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -59,15 +59,15 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case - * + * To test class name in snake case * * @param context Vertx test context for doing assertions */ @Test public void testClassnameTest(TestContext context) { Async async = context.async(); - Client body = null; - api.testClassname(body, result -> { + Client client = null; + api.testClassname(client, result -> { // TODO: test validations async.complete(); }); diff --git a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/PetApiTest.java index f0b765e0b50..eb3539af77e 100644 --- a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/PetApiTest.java @@ -68,8 +68,8 @@ public class PetApiTest { @Test public void addPetTest(TestContext context) { Async async = context.async(); - Pet body = null; - api.addPet(body, result -> { + Pet pet = null; + api.addPet(pet, result -> { // TODO: test validations async.complete(); }); @@ -149,8 +149,8 @@ public class PetApiTest { @Test public void updatePetTest(TestContext context) { Async async = context.async(); - Pet body = null; - api.updatePet(body, result -> { + Pet pet = null; + api.updatePet(pet, result -> { // TODO: test validations async.complete(); }); diff --git a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/StoreApiTest.java index d273c79ad54..31e65350851 100644 --- a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -113,8 +113,8 @@ public class StoreApiTest { @Test public void placeOrderTest(TestContext context) { Async async = context.async(); - Order body = null; - api.placeOrder(body, result -> { + Order order = null; + api.placeOrder(order, result -> { // TODO: test validations async.complete(); }); diff --git a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/UserApiTest.java index 407a9abb4a2..e0361506870 100644 --- a/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/UserApiTest.java @@ -66,8 +66,8 @@ public class UserApiTest { @Test public void createUserTest(TestContext context) { Async async = context.async(); - User body = null; - api.createUser(body, result -> { + User user = null; + api.createUser(user, result -> { // TODO: test validations async.complete(); }); @@ -82,8 +82,8 @@ public class UserApiTest { @Test public void createUsersWithArrayInputTest(TestContext context) { Async async = context.async(); - List body = null; - api.createUsersWithArrayInput(body, result -> { + List user = null; + api.createUsersWithArrayInput(user, result -> { // TODO: test validations async.complete(); }); @@ -98,8 +98,8 @@ public class UserApiTest { @Test public void createUsersWithListInputTest(TestContext context) { Async async = context.async(); - List body = null; - api.createUsersWithListInput(body, result -> { + List user = null; + api.createUsersWithListInput(user, result -> { // TODO: test validations async.complete(); }); @@ -179,8 +179,8 @@ public class UserApiTest { public void updateUserTest(TestContext context) { Async async = context.async(); String username = null; - User body = null; - api.updateUser(username, body, result -> { + User user = null; + api.updateUser(username, user, result -> { // TODO: test validations async.complete(); });